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

Define default printer by page format or filename

Community Beginner ,
Dec 14, 2017 Dec 14, 2017

Hi! As there are no solutions at the Printing & Prepress community, I would like to launch the topic over here.

How to set up default printer by page format/page dimensions?

For example, I print A6 pdf shipping labels (real A6 pdf format) with a labelprinter. Other A4 pdf documents must be printed by another printer.

Now I sometimes forget to change the printer and the last chosen printer isn't always the right choice.

Is there an existing method or javascript to set up the default printer, affected by the pdf page format?

In that way in my case the default printer will be automatically selected by this unique variable: the page format or page dimensions.

Another way might be by the pdf filename, as those files have a certain pattern/structure.

TOPICS
Acrobat SDK and JavaScript , Windows
485
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 ,
Dec 14, 2017 Dec 14, 2017

It's possible to write a script that will look at the first page of the file (for example) and based on its size will determine which printer to send it to, yes.
Also, if you have one printer with multiple trays then there's a built-in parameter that can tell it to select the appropriate 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 ,
Dec 14, 2017 Dec 14, 2017

Hi try67! Any help to get such a script or examples to helpmeet out?

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 ,
Dec 14, 2017 Dec 14, 2017
LATEST

Well, you will need to use the getPageBox method to find the page size of one of the pages and then you could use the PrintParams object to set the printer name to be used based on it, and then the Document's print method to actually print the file.

If you're interested I could write this code for you (for a fee). You can contact me privately via try6767 at gmail.com to discuss it.

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