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!


In reply to Acrobat PDF printing by AMROBINS

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.