These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Printing separate pages of PDF file via javaScript

Peterburger
Registered: Mar 15 2008
Posts: 12

Hello fellows,

Problem is that I want to make separate pages (like 0, 2, 4-10, 22, 34)
of PDF file printable in one batch via JavaScript by using local printer
which end user can choose...

This can be done manually in print definition window,
so it should be included in the Javascript also!
Can't find method to do this...

I think to heard that it is possible with LiveCycle Designer,
but I'm not familiar with that prgm...

Is there a possibility somehow to define script like:
this.print({bUI: true, nStart: "0, 2, 4-10, 22, 34"});

One possibility could be to set selected Pages propertion "Not printable",
but that is also missing, as far as I understand!

Best regards,

El User

P.S. End user should not have to have nothing else than Acrobat Reader...

George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
Whether the PDF was created by LiveCycle Designer or through some other means, printing using JavaScript is limited to what you see in the Acrobat JavaScript reference. Unfortunately, you cannot specify a discontinuous range with JavaScript, but you can issue more than one print statement to print all of the pages you want. This will create multiple print jobs, so the user will have to OK each one. An alternative is to pop-up an alert window (e.g., using app.response or app.execDialog) and give the discontinuous range for the user to copy & paste into the Print dialog's Pages area.George