Skip to main content
Inspiring
May 8, 2024
Answered

Print selected pages

  • May 8, 2024
  • 2 replies
  • 911 views

I'm using Run a Javascript to print pages 1 and 3 of a document using this code:

 

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

 

It works, but it pops up the print dialog box first.  I'm wondering if there is a way to bypass the print dialog box and directly print pages 1 and 3.  Thanks.

This topic has been closed for replies.
Correct answer try67

Add this line before the print command:

x.interactive = pp.constants.interactionLevel.automatic;

2 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
May 8, 2024

Add this line before the print command:

x.interactive = pp.constants.interactionLevel.automatic;

BrianG934Author
Inspiring
May 9, 2024

Thank you!

Amal.
Legend
May 8, 2024

Hi there

Hope you are doing well and thanks for reaching out.

The workflow you are trying to achieve is might be possible using JavaScript. For more information please check the help pages listed below:
https://acrobatusers.com/tutorials/javascript_console/
https://helpx.adobe.com/acrobat/using/applying-actions-scripts-pdfs.html

Hope it will help

Regards
Amal