Setting printer resolution programmatically

PDF-XChange Drivers API (only) V4/V5
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - VERSION 4 & 5 - Please use the PDF-Tools SDK Forum for Library DLL assistance.

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

Post Reply
cmarsura
User
Posts: 91
Joined: Fri Jun 15, 2007 9:57 am
Location: Italy

Setting printer resolution programmatically

Post by cmarsura » Tue May 24, 2011 3:34 pm

Hi, how can I set programmatically the printer resolution ?
In the PDF-XChange Driver API manual I cannot find any reference to this property, but the property appears in the printer dialog.
I tried

Code: Select all

PDFPrinter.Option("Paper.Resolution") = 600
or

Code: Select all

PDFPrinter.Option("Paper.Dpi") = 600
, but I got an error.

Is this an unimplemented property?

Thanks

Carlo Marsura

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14161
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Setting printer resolution programmatically

Post by Tracker Supp-Stefan » Wed May 25, 2011 3:59 pm

Hello cmarsura,

I believe that you will need to set the DPI through the Devmode dmPrintQuality:
http://msdn.microsoft.com/en-us/library ... s.85).aspx

Best,
Stefan

Ivan - Tracker Software
Site Admin
Posts: 3630
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Setting printer resolution programmatically

Post by Ivan - Tracker Software » Wed May 25, 2011 7:10 pm

You can also set dpi using

Code: Select all

PDFPrinter.Option("DevMode.DPI") = 600
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.

cmarsura
User
Posts: 91
Joined: Fri Jun 15, 2007 9:57 am
Location: Italy

Re: Setting printer resolution programmatically

Post by cmarsura » Fri May 27, 2011 2:47 pm

I tried to set the "DevMode.DPI" but to me seems to be supported but ignored.
I discovered also the "DevMode.Orientation" property but also this is ignored. Properties like "Paper.PageScale" or "General.Specification" are correctly supported instead.
I am using the version 4.0.195 of your printer.

See my included vbs with results, where I test the original "PDF-XChange 4.0" (with its defaults) vs. the the temporary printer created.

Can you verify this?

Carlo
Attachments
testpdfxchangeprinter.zip
(79.17 KiB) Downloaded 229 times

Ivan - Tracker Software
Site Admin
Posts: 3630
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Setting printer resolution programmatically

Post by Ivan - Tracker Software » Mon May 30, 2011 3:32 pm

When you are making changes to the DEVMODE via the PDFPrinter object, you have to call

Code: Select all

PDFPrinter.ApplyOptions(0)
The Parameter of this function is reserved for now and must be 0 (zero).

Regarding these lines in your code:

Code: Select all

'This property is supportet but appears to not be honorated
PDFPrinter.Option("DevMode.Orientation") = -1
Orientation can have either of these values : DMORIENTATION_PORTRAIT (value is 1) and DMORIENTATION_LANDSCAPE (2).

That should resolve your issues.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.

cmarsura
User
Posts: 91
Joined: Fri Jun 15, 2007 9:57 am
Location: Italy

Re: Setting printer resolution programmatically

Post by cmarsura » Tue May 31, 2011 12:55 pm

Applied your suggestions - now everything works well as expected.

Thank you very much for the promptly response, your support is good as ever.

PS: if you can, update the pdf manual with these two new properties, so all users can take advantage of this.

Carlo Marsura

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14161
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Setting printer resolution programmatically

Post by Tracker Supp-Stefan » Tue May 31, 2011 12:59 pm

Glad to hear that everything is working now Carlo,

And I will pass this topic to the guys responsible for the manuals, so that this information gets included there.

Cheers,
Stefan

cmarsura
User
Posts: 91
Joined: Fri Jun 15, 2007 9:57 am
Location: Italy

Re: Setting printer resolution programmatically

Post by cmarsura » Mon Mar 19, 2012 10:25 am

Hi Stefan,
DevMode properties has not yet documented in the printer manuals.

Cheers.
Carlo.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14161
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Setting printer resolution programmatically

Post by Tracker Supp-Stefan » Mon Mar 19, 2012 11:12 am

Hello Carlo,

Yes they are not -as they are documented here:
http://msdn.microsoft.com/en-us/library ... s.85).aspx

Best,
Stefan

cmarsura
User
Posts: 91
Joined: Fri Jun 15, 2007 9:57 am
Location: Italy

Re: Setting printer resolution programmatically

Post by cmarsura » Mon Mar 19, 2012 1:39 pm

I am not referring to the DevMode documented in MSDN but instead to the object accessible via PDFPrinter.Option(), as suggested by Ivan in this thread here http://www.tracker-software.com/forum3/ ... 887#p49552.
However, documentation does not clearly states that you can set the DevMode properties through a syntax like:

Code: Select all

PDFPrinter.Option("DevMode.DPI") = 600
.
Best.
Carlo.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14161
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Setting printer resolution programmatically

Post by Tracker Supp-Stefan » Mon Mar 19, 2012 3:18 pm

Hi Carlo,

Sorry - seems I got the situation wrong. I will once again pass this thread for reviewing by the people working with the manuals and we will see to get this corrected.

Best,
Stefan

Post Reply