in reply to Print a PDF from a script

You don't even need Perl for this, as long as the printer is the default printer. If you right-click on a .pdf file, you will notice that there is a context menu entry labeled 'print'. Looking for the corresponding action with Regedit.exe, you will find some special invocation of acrord32.exe using the /p command line switch (or so I think I remember). Use system() with that switch to make Acrobat Reader print the .pdf.

For the second part of your problem, setting the default printer temporarily to something different, look at what Win32::Printer has to offer, together with Win32::Printer::Enum.

Replies are listed 'Best First'.
Re: Re: Print a PDF from a script
by Chief Engineer Scott (Novice) on May 11, 2004 at 12:05 UTC
    Sorry, I guess my question was unclear, what I have is a database table with a number of records, for each record there is a PDF document number, a path to the PDF, and the \\printserver\printer reference where the user requires the PDF to be printed, I think this would rule out the use of WIN32. Example Table Batch Acrobat.pdf c:\cfusion\batch\ \\zz-test-web\IT-URD2 DaVinci.PDF c:\cfusion\drawing\ \\zz-test-web\AD-MAN3 Rates.pdf c:\cfusion\specs\ \\zz-test-web\ED-URA5 In each case I would like to pass the PDF directly to the printer for printer, or if that is not possible, somehow open it "silently" and have the contents printed. Any help will be greatly appreciated

      Why do you believe that this "rules out WIN32" ?

      My approach would directly print the .pdf files without any further interaction, but unless you clarify what your problem with my approach is, I can't help you.