How to change the DPI with the API

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, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
DeltaPi
User
Posts: 5
Joined: Fri Aug 05, 2005 10:39 am
Contact:

How to change the DPI with the API

Post by DeltaPi »

Hi,

I am trying to change the DPI with the api with Option["DevMode.DPI"] but this give no effect.

the build is 5.5 315 and the dev.env. VS 2012 C#.

Within the documentation there is no description of how to set the DPI.

Can you help with this.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17818
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: How to change the DPI with the API

Post by Tracker Supp-Stefan »

Hello DeltaPi,

You should be able to change the DPI via DevMode:
https://forum.pdf-xchange.com/ ... 552#p49552

Or do you want to e.g. downsample images when generating the PDF file?

Regards,
Stefan
DeltaPi
User
Posts: 5
Joined: Fri Aug 05, 2005 10:39 am
Contact:

Re: How to change the DPI with the API

Post by DeltaPi »

Current i am running a test:
CPXCPrinter.Option[General.Specification]=7
CPXCPrinter.Option[Graphics.Color.Convert.Method]=1
CPXCPrinter.Option[Graphics.Indexed.Convert.Method]=1
CPXCPrinter.Option[Graphics.MonoAndDrawings.Convert.Method]=1
CPXCPrinter.Option[Save.File]=C:\Users\hk\AppData\Local\Temp\DeltaPi\Tempfiles\dpi-test_rvt_12466b1b-c7d4-4fc8-9ff7-679e365e7f39.pdf
CPXCPrinter.Option[Save.ShowSaveDialog]=False
CPXCPrinter.Option[Save.WhenExists]=1
CPXCPrinter.Option[Save.RunApp]=False
CPXCPrinter.ApplyOptions
CPXCPrinter.Option[DevMode.DPI]=72
CPXCPrinter.ApplyOptions

And compare the result pdf with a manual created pdf. But the DPI don't changed.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17818
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: How to change the DPI with the API

Post by Tracker Supp-Stefan »

Hello DeltaPi,

Can you please send us those sample files you are comparing as well as the method you use to compare them?

Regards,
Stefan
DeltaPi
User
Posts: 5
Joined: Fri Aug 05, 2005 10:39 am
Contact:

Re: How to change the DPI with the API

Post by DeltaPi »

Add a zip with 6 files.
3 files generated with the print from revit:
dpi-test.####.pdf

3 files generated with the api from revit:
dpi-test.rvt_A5-####.pdf

There are 3 DPI's used: 72/300/1200.
Attachments
pdf.rar
(84.22 KiB) Downloaded 181 times
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17818
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: How to change the DPI with the API

Post by Tracker Supp-Stefan »

Thanks DeltaPi,

There are no images in those files - only vector objects - so there is no raster content that needs to be scaled down to 72 DPI.

Regards,
Stefan
DeltaPi
User
Posts: 5
Joined: Fri Aug 05, 2005 10:39 am
Contact:

Re: How to change the DPI with the API

Post by DeltaPi »

The question is, how can I change the DPI.

Revit use the "Graphics Resolution" on the "Paper" settings.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17818
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: How to change the DPI with the API

Post by Tracker Supp-Stefan »

Hello DeltaPi,

If you want to downsample raster graphics - you can use these settings for the driver api:
https://help.pdf-xchange.com/DEV/de ... K:graphics

Regards,
Stefan
DeltaPi
User
Posts: 5
Joined: Fri Aug 05, 2005 10:39 am
Contact:

Re: How to change the DPI with the API

Post by DeltaPi »

Our customer want to change the DPI from 300 to 1200.

Can I do this with a downsample?
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17818
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: How to change the DPI with the API

Post by Tracker Supp-Stefan »

Hello DeltaPi,

Our printing drivers will take whatever resolution images are sent to it, and put them in the PDF file it generates. If it is larger than a given value that you specify - it can downsample them, but if the original image is 300 DPI - we can not upscale it.
If the objects are vector ones as in your sample - the DPI has little effect - as those vector objects can be rendered at any DPI needed when printed to e.g. paper.

Regards,
Stefan
Post Reply