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.
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.
Copy link to clipboard
Copied
Hi try67! Any help to get such a script or examples to helpmeet out?
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.