Skip to main content
Chemtoli007
Known Participant
January 25, 2017
Question

How to print first page of PDF from Second Paper Tray of multifunction printer using JavaScript button?

  • January 25, 2017
  • 1 reply
  • 1110 views

Hello everyone,

Could you please tell me how to make a JavaScript button on PDF file which has only 3 pages so when I press Page 1 of JavaScript button the multi function printer (Ricoh Aficio Mp 4000) automatically prints first page from second tray.

P.S. I'm using Acrobat DC Pro.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
January 25, 2017

You can't use JS to send the print to a specific tray. The closest you can get to that is to tell the printer to choose the paper tray based on the page size.

Chemtoli007
Known Participant
January 25, 2017

try67

What's the JavaScript code to do that?

try67
Community Expert
Community Expert
January 25, 2017

First of all you need to get the correct internal name of the printer in Acrobat.

To do that execute this code in the JS Console:

app.printerNames.join("\n");

It will output the names of the printers on your computer. Copy the name of the printer you want to use from that list and insert it into line #6 in the code below. Then execute that code to print the first page of the file to that printer, with the option to use the tray that matches the page size:

var pp = this.getPrintParams();

fv = pp.constants.flagValues;

pp.flags = pp.flags | fv.setPageSize;

pp.firstPage = 0;

pp.lastPage = 0;

pp.printerName = "<Printer name>";

this.print(pp);