Copy link to clipboard
Copied
As in the title. I need to place the "print" button to my document that would print only chosen pages. "Execute a menu item" option in acrobat does allow to specify the range of pages automatically. Thanks for help!
Copy link to clipboard
Copied
Yes, but you'll have to use JavaScript. Here's a link to the documentation: Acrobat DC SDK Documentation
Copy link to clipboard
Copied
Yes, you can do it using a script. Here's a simple example of how to print pages 2-5:
var pp = this.getPrintParams();
pp.firstPage = 1;
pp.lastPage = 4;
this.print(pp);
Copy link to clipboard
Copied
Thank you guys! It works
Copy link to clipboard
Copied
One more question: this solution works properly when document is viewed in Acrobat, but does not work when document is opened in web browser. In chrome button opens print dialog, but page range is set to whole document by default (seems that chrome ignores a part of the script). In firefox it does not work at all (probably because it does not support pdf forms anly longer). Not to mention Edge, where every interactive element displays quite strange... Suprisingly, in Internet Explorer everything works fine.
Is it possible to use script which would avoid this struggles?
Copy link to clipboard
Copied
No. The issue is with the faulty PDF plugins used by these browsers (IE uses Adobe Reader, so it works fine there).
You should instruct the users not to open the file inside the browser if they want it to work correctly, but to save it locally and then open it using Adobe Reader.
Also, you should complain to the developers of these applications about their shoddy work.
Copy link to clipboard
Copied
Ok, thank you try67​. I was affraid that it is the matter of plugins...
Thanks a lot!
Copy link to clipboard
Copied
Actually, try this code. It's the only other way of doing it using a script:
this.print({nStart: 1, nEnd: 4});
Copy link to clipboard
Copied
Tried this one, but gave the same results...
Copy link to clipboard
Copied
That's what I thought would happen, but worth a shot, I guess...
Copy link to clipboard
Copied
All PDF form makers should know this great trick:
https://www.abracadabrapdf.net/ressources-et-tutos/creation/forcer-utilisation-pdf-avec-acrobat-read...
(Google translate is your friend)
Copy link to clipboard
Copied
I've been scouring the Interwebs for an hour looking for this. I'm running AA Pro DC Ver 2020.0012.20048 on a Mac.
Thank you so much.