Skip to main content
Participant
Dec 9, 2020 2:36 PM UTC
Question

How do I create a PDF print button that only prints certain pages?

I am trying to create a custom print button on a PDF form that will print pages 2-4, SKIP page 5, and continue printing page 6-7.  Is this possible?  I am not very familiar with JavaScript and have tried looking at other post on this topic but I can not figure out how to not print page 5.

 

Any help would be apprecitated.  

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Participant
Dec 9, 2020 3:59 PM UTC

Thank you this worked.  I have been trying to figure this out all week.  

Translate
try67
Community Expert
Community Expert
Dec 9, 2020 3:08 PM UTC

Yes, this can be done using a script, like this:

 

 

var pp = this.getPrintParms();
pp.printRange = [[1,3], [5,6]];
this.print(pp);

Notice the page numbers are zero-based, so page 2 of the file is 1 in the script, page 6 is 7, etc.

 

Edit: Got the page numbers mixed up... Fixed now.

Translate
Nesa Nurani
Community Expert
Community Expert
Dec 9, 2020 3:08 PM UTC

You can add this code to button: (keep in mind page 1 is 0, page 2 is 1, page 3 is 2...etc)

var x = this.getPrintParams();
x.printRange = [[1,3], [5,6]];
this.print(x);
Translate