• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Community Beginner ,
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

514

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
Community Expert ,
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});

Votes

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