Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
try67
What's the JavaScript code to do that?
Copy link to clipboard
Copied
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);
Find more inspiration, events, and resources on the new Adobe Community
Explore Now