Page 1 of 1
How to change the DPI with the API
Posted: Tue Mar 01, 2016 10:53 am
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.
Re: How to change the DPI with the API
Posted: Tue Mar 01, 2016 11:19 am
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
Re: How to change the DPI with the API
Posted: Tue Mar 01, 2016 12:05 pm
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.
Re: How to change the DPI with the API
Posted: Mon Mar 07, 2016 10:49 am
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
Re: How to change the DPI with the API
Posted: Mon Mar 07, 2016 3:45 pm
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.
Re: How to change the DPI with the API
Posted: Mon Mar 07, 2016 3:55 pm
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
Re: How to change the DPI with the API
Posted: Mon Mar 07, 2016 4:11 pm
by DeltaPi
The question is, how can I change the DPI.
Revit use the "Graphics Resolution" on the "Paper" settings.
Re: How to change the DPI with the API
Posted: Mon Mar 07, 2016 4:20 pm
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
Re: How to change the DPI with the API
Posted: Mon Mar 07, 2016 4:29 pm
by DeltaPi
Our customer want to change the DPI from 300 to 1200.
Can I do this with a downsample?
Re: How to change the DPI with the API
Posted: Mon Mar 07, 2016 4:41 pm
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