Skip to main content
Participant
July 16, 2018
Question

Can I add a print button to interactive pdf that would print only specific section of the document? In example pages from pdf bookmark.

  • July 16, 2018
  • 2 replies
  • 2972 views

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!

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
July 16, 2018

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);

Participant
July 17, 2018

Thank you guys! It works

Participant
July 17, 2018

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?

Inspiring
July 16, 2018

Yes, but you'll have to use JavaScript. Here's a link to the documentation: Acrobat DC SDK Documentation