Skip to main content
Participant
December 9, 2020
Question

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

  • December 9, 2020
  • 3 replies
  • 1816 views

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 has been closed for replies.

3 replies

Participant
December 9, 2020

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

try67
Community Expert
Community Expert
December 9, 2020

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.

Nesa Nurani
Community Expert
Community Expert
December 9, 2020

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