Skip to main content
Participant
Oct 8, 2020 11:16 AM UTC
Answered

Code for printing specific page

Hello,

I am looking for a javascript code that can send a specific page to the printer.
The people who will use it all have acrobat reader DC

 

I have foud the code below but is doesn't work for printing the first page.

 

var pp = this.getPrintParams();

pp.printRange = [1];

this.print(pp);

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Oct 8, 2020 12:04 PM UTC

Use this:

 

var pp = this.getPrintParams();
pp.printRange = [[0,0]];
this.print(pp);

3 replies

Participant
Oct 15, 2020 9:02 PM UTC

Thank you very much.

It works !

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Oct 8, 2020 12:04 PM UTC

Use this:

 

var pp = this.getPrintParams();
pp.printRange = [[0,0]];
this.print(pp);

Translate
Bernd Alheit
Community Expert
Community Expert
Oct 8, 2020 11:28 AM UTC

Info: the number of the first page is 0.

Translate