Preset Printer Settings

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
Fanski
User
Posts: 28
Joined: Tue Apr 17, 2012 10:33 am

Preset Printer Settings

Post by Fanski » Tue Sep 10, 2019 4:41 pm

Is it possible to preset the printer like:

Code: Select all

opts["PrinterName"].v = “Printer Name”;
but without printing? I would like to preset the Printer, so that if the user click print, the printer would already be set?
Like it was possible with the PdfXChange Viewer:

Code: Select all

axCoPdfxCview.SetProperty("Print.PrinterName", printerName, 0);
How to change the page orientation? (Portrait and landscape format)
In PdfXChange Viewer ist was:

Code: Select all

axCoPdfxCview.SetProperty("Print.PaperRotate", -1, 0); // 0, -1 or -2

User avatar
Sasha - Tracker Dev Team
User
Posts: 4220
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Preset Printer Settings

Post by Sasha - Tracker Dev Team » Wed Sep 11, 2019 7:20 am

Hello Fanski,

First, get the CabNodeExplorer utility available from here:
viewtopic.php?f=66&t=25943
By using it you can find all of the settings that are being stored in the registry. The settings for print dialog are stored in the Operations.PrintPages node.
To set the needed settings, use:

Code: Select all

pdfCtl.Inst.Settings["General.AppTitle"].v = "My App";
Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Fanski
User
Posts: 28
Joined: Tue Apr 17, 2012 10:33 am

Re: Preset Printer Settings

Post by Fanski » Wed Sep 11, 2019 10:41 am

Hi Alex,
thenks for your answer.
I could solve most of my problems :)
1 Problem ist left:
grafik.png
In The Viewer the code was:

Code: Select all

axCoPdfxCview.SetProperty("Print.PaperRotate", -2, 0);
Couldn’t figure out what setting is needed for this. I tried this one, but it has no effect:

Code: Select all

axPxvControl.Inst.Settings["Operations.PrintPages.Paper.Rotate"].v = -2;
Kind Regards
Peter Stefanski

User avatar
Sasha - Tracker Dev Team
User
Posts: 4220
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Preset Printer Settings

Post by Sasha - Tracker Dev Team » Wed Sep 11, 2019 1:53 pm

Hello Peter Stefanski,

This program takes data from the registry. What you can do is set the End-User Editor's option to the needed one and then check the value of the Operations.PrintPages.Paper.Rotate in the CabNodeExplorer

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Fanski
User
Posts: 28
Joined: Tue Apr 17, 2012 10:33 am

Re: Preset Printer Settings

Post by Fanski » Thu Sep 12, 2019 7:45 am

Hello Alex,

It‘s a little strange.

Setting the options works for the most of them, but for ‘Operations.PrintPages.Paper.Rotate’ it does not work. If I change it in the GUI, I can read the value, and it is set to ‘2’ but setting it programmatically does not work.

Code: Select all

axPxvControl.Inst.Settings["Operations.PrintPages.PrinterName"].v = printerName; // work
axPxvControl.Inst.Settings["Operations.PrintPages.ScaleType"].v = (int)printScaleType; // work

axPxvControl.Inst.Settings["Operations.PrintPages.Paper.Rotate"].v = 2; // Does not work
Set it in the options for the print job works.

Code: Select all

PDFXEdit.ICabNode opts = op.Params.Root["Options"];
opts["Paper.Rotate"].v = 2; // work
Could you have a look here?

Kind Regards
Peter Stefanski

User avatar
Sasha - Tracker Dev Team
User
Posts: 4220
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Preset Printer Settings

Post by Sasha - Tracker Dev Team » Thu Sep 12, 2019 7:59 am

Hello Peter,

Forwarded this to the appropriate developer for investigation.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply