How to reference the last page in a document with the "nEnd" parameter

New Here ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

I'm working on writing a script that will silently print the 3rd page until the end. The reason being is that I constantly print bills and the first two pages are unnecessary for my printing purposes.

So far this is what I have.

this.print({bUI: false, nStart: 2, nEnd: 3, bSilent: true, bShrinkToFit: true});

The issue with this is this would only work for a 4 page document. My documents are anywhere from 3 pages to more than 4. (Varies, sometimes as much as 20.)

I need a way to reference generically, the last page, whatever the last page may be. For the nEnd parameter, is there a way to reference the last page in the current PDF?

Thanks,

-Y

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
TOPICS
How to, JavaScript

Views

61

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

LATEST

Try this:

 

this.print({bUI: false, nStart: 2, nEnd: this.numPages - 1, bSilent: true, bShrinkToFit: true});

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines