Define default printer by page format or filename

Community Beginner ,
Dec 14, 2017

Copy link to clipboard

Copied

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, Macintosh, Windows

Views

98

Likes

Translate

Translate

Report

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

Define default printer by page format or filename

Community Beginner ,
Dec 14, 2017

Copy link to clipboard

Copied

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, Macintosh, Windows

Views

99

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 14, 2017 0
Most Valuable Participant ,
Dec 14, 2017

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 14, 2017 1
Community Beginner ,
Dec 14, 2017

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 14, 2017 0
try67 LATEST
Most Valuable Participant ,
Dec 14, 2017

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 14, 2017 1