Default setting for Duplex in Editor

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Paul - Tracker Supp, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

Post Reply
PRBruinsma
User
Posts: 23
Joined: Wed Feb 07, 2018 2:35 am

Default setting for Duplex in Editor

Post by PRBruinsma » Wed Aug 19, 2020 3:37 pm

At the office the PDF-XChange printer is the default printer in our Windows settings.
When I open a pdf file in Editor most of the time I want to print it to paper.
I managed to set our paper printer as the default printer in Editor using the JavaScript file Daniel provided Peter2 on July 13, 2020 7:13 pm.

The default setting of this paper printer for Duplex is "None". I would like to change it to "Long Edge".
Can this be done with a JavaScript file to?
If so, can you provide me with the script?

Kind regards,
Piet

User avatar
TrackerSupp-Daniel
Site Admin
Posts: 3879
Joined: Wed Jan 03, 2018 6:52 pm

Re: Default setting for Duplex in Editor

Post by TrackerSupp-Daniel » Wed Aug 19, 2020 6:43 pm

Hi, PRBruinsma

Yes, this would be possible using JS. I should note that you will usually want to specify which printer to be used in the JS, as per the example below, since trying to enable duplexing forcibly on a printer which does not support it may cause some issues.
The JS you would want to encorporate into your functions is as follows:

Code: Select all

var pp = this.getPrintParams();
pp.printerName = "HP P2055dn (PS)";
pp.DuplexType = pp.constants.duplexTypes.DuplexFlipLongEdge;
this.print(pp);
The "pp.printername" would need to be changed to match your printers name (as shown in windows).

Kind regards,
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD

Support: <Support@tracker-software.com>
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

PRBruinsma
User
Posts: 23
Joined: Wed Feb 07, 2018 2:35 am

Re: Default setting for Duplex in Editor

Post by PRBruinsma » Wed Aug 19, 2020 10:17 pm

Hi Daniel,

Thanks for your reply.
Where do I save this JavaScript file?
C:\Users\.....\AppData\Roaming\Tracker Software\PDFXEditor\3.0\JavaScripts?

I have no expertise in this matter.
Sorry.

Kind regards,
Piet

User avatar
TrackerSupp-Daniel
Site Admin
Posts: 3879
Joined: Wed Jan 03, 2018 6:52 pm

Re: Default setting for Duplex in Editor

Post by TrackerSupp-Daniel » Tue Aug 25, 2020 8:34 pm

Hi, PRBruinsma

This script is intended to be pasted into the Javascript console (Ctrl_J) for one time use. For continued use you would want to follow the steps in this article to create a file to add a "JavaScript button" which you can place on the toolbars: https://www.tracker-software.com/knowle ... the-Editor

Kind regards,
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD

Support: <Support@tracker-software.com>
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

Post Reply