Copy link to clipboard
Copied
I have a pdf document with 30 pages. I would like to print pages 2 and 3 to the Adobe PDF printer using javascript. I tried the following javascript code in a button on page 2 but it does not work:
var pp = this.getPrintParams();
pp.printerName = "Adobe PDF";
pp.pageHandling = pp.constants.handling.fit;
this.print(pp);
pp.this.print(false, this.pageNum,(this.pageNum+1));
I would like the two pages to print without bringing up the print menu box. Any help would be appreciated. Thanks.
Not possible. Instead, you should use the extractPages method. That will allow you to specify the path of the new file.
You can print to postscript, then open the postscript file in Acrobat to convert it to PDF. This will flatten the PDF.
See this entry in the Acrobat JavaScript Reference:
https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/JS_API_AcroJS.html#id799
Also, if the PrintParams object is used, then all printing parameters must be set in the PrintParams object. The PrintParams object cannot be mixed with other print function inputs.
Copy link to clipboard
Copied
Not possible. Instead, you should use the extractPages method. That will allow you to specify the path of the new file.
Copy link to clipboard
Copied
You can print to postscript, then open the postscript file in Acrobat to convert it to PDF. This will flatten the PDF.
See this entry in the Acrobat JavaScript Reference:
https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/JS_API_AcroJS.html#id799
Also, if the PrintParams object is used, then all printing parameters must be set in the PrintParams object. The PrintParams object cannot be mixed with other print function inputs.