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
Copy link to clipboard
Copied
Try this:
this.print({bUI: false, nStart: 2, nEnd: this.numPages - 1, bSilent: true, bShrinkToFit: true});