Announcement

Collapse
No announcement yet.

Script to print a pdf file

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script to print a pdf file

    Hi!

    I would like to have a script that will print a pdf (Adobe Acrobat) file without open it. Is there a script for this purpose?

    Thank you very much
    Last edited by miloh; 19th October 2006, 15:07.

  • #2
    Re: Script to print a pdf file

    Can you give more background about the scenario in which this is going to operate?

    Thanks
    Server 2000 MCP
    Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    Comment


    • #3
      Re: Script to print a pdf file

      I have created a form in Ms Access. This form has a text field for the user to enter the pdf file name and two command buttons to print the selected file. I would like to have a vbscript for each command button to do the following tasks:

      - Command button 1: Open the file, print the file, then close the file.
      - Command button 2: Print the file without displaying the file on the screen.

      Thank you very much for your help.
      Miloh
      Last edited by miloh; 19th October 2006, 18:25.

      Comment


      • #4
        Re: Script to print a pdf file

        Originally posted by miloh
        ...- Command button 2: Print the file without open it.
        One of the requirements to print something is that it is first opened. Even Word opens when you print a .doc file. There might be a way to open the default pdf application then close it.
        Andrew

        ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

        Comment


        • #5
          Re: Script to print a pdf file

          Hey,

          Here is an example that uses the context menu to do this:

          Set objShell = CreateObject("Shell.Application")
          Set objFolder = objShell.Namespace("C:\")
          Set objFolderItem = objFolder.ParseName("1.pdf")

          objFolderItem.InvokeVerb("&Print")


          All you need is a directory walker, which you can find plenty of code on the web.

          If you still got troubles let me know.


          Good luck.

          Comment


          • #6
            Re: Script to print a pdf file

            Originally posted by syslog View Post
            Hey,

            Here is an example that uses the context menu to do this:

            Set objShell = CreateObject("Shell.Application")
            Set objFolder = objShell.Namespace("C:\")
            Set objFolderItem = objFolder.ParseName("1.pdf")

            objFolderItem.InvokeVerb("&Print")


            All you need is a directory walker, which you can find plenty of code on the web.

            If you still got troubles let me know.


            Good luck.
            This will open the default pdf viewer and print the file but not without opening the file first.
            Andrew

            ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

            Comment


            • #7
              Re: Script to print a pdf file

              Oops sorry,

              Here is a solution that works:

              1. Download Smart Print Control at http://www.vbgold.com/Downloads.shtml.
              2. Register the component.
              3. Create instance of it and it reveal the requested option - object.PrintPDFFile

              Let me know if you have questions.

              Regards,
              Syslog.

              Comment


              • #8
                Re: Script to print a pdf file

                This works for me. Thanks very much for your help.

                Sincerely,
                Miloh

                Comment

                Working...
                X