AMROBINS has asked for the wisdom of the Perl Monks concerning the following question:
We have been running Acrobat 6 to perform our PDF printing for many years now using the code below.
We've now migrated to Acrobat XI and the printing no longer works.
I believe the PrintPagesSilent function is no longer applicable to XI but I'm not sure of the replacement syntax to use for XI?
A simplified version of the current (old) code...
$doc = Win32::OLE->new('AcroExch.AVDoc'); $doc->Open($file,""); $doc->PrintPagesSilent(0,-1,3,1,0); $doc->Close(0);
The current documentation for Acrobat XI has;
AVDocPrintPages ()
Syntax:
void AVDocPrintPages(AVDoc doc, AVPageIndex firstPage, AVPageIndex lastPage, ASInt32 psLevel, ASBool binaryOK, ASBool shrinkToFit)
Prints without displaying any user dialog boxes. The current printer, page settings, and job settings are used. Printing is complete when this method returns.
Parameters:
doc — The document from which pages are printed.
firstPage — The first page in doc to print.
lastPage — The last page in doc to print.
psLevel — Applies to PostScript printing. It must be either 1 or 2. If 1, Level 1 PostScript code is generated. If 2, Level 2 PostScript code is generated.
binaryOK — Applies to PostScript printing. If true, the PostScript code may contain binary data. If false, all binary data is encoded into an ASCII format.
shrinkToFit — If true, the page is shrunk (if necessary) to fit into the imageable area of a page in the printer. If false, pages are printed at actual size and may appear clipped on the printed page.
I've tried using Win32::API as an alternative but that seems to present other issues.
Anyone used AVDocPrintPages with Acrobat XI?
...using PrintPagesSilent or PrintPages doesn't produce an error but nothing appears on the print queue. Does this suggests the commands are still valid but not working for some other reason?
Thanks in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Acrobat PDF printing
by soonix (Chancellor) on May 13, 2015 at 11:39 UTC |