Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
Jan 25, 2017 Jan 25, 2017

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.

TOPICS
Acrobat SDK and JavaScript , Windows
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2017 Jan 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 25, 2017 Jan 25, 2017

try67

What's the JavaScript code to do that?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2017 Jan 25, 2017
LATEST

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);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines