Print Page | Close Window

Determining the DPI of the Canvas?

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2984
Printed Date: 07 May 24 at 8:18PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Determining the DPI of the Canvas?
Posted By: stevemaughan
Subject: Determining the DPI of the Canvas?
Date Posted: 08 Oct 14 at 1:11PM
Hi - 

I'd like to draw a map as a PDF file. This will require a lot of vector graphics. To do this I need to know the resolution of the canvas (e.g. pixels per inch). Or I need to set the resolution of the canvas. Is this possible? If so, how can I do it?

Thanks,

Steve



Replies:
Posted By: erico
Date Posted: 08 Oct 14 at 3:06PM
You pick the dpi yourself when you RenderPageToDC (or DARenderPageToDC). It is one of the parameters:

int DPLDARenderPageToDC(int InstanceID, int FileHandle, int PageRef,  double DPI, HDC DC);

Maybe I misunderstood. You want to know what value to supply. Look at the response to
http://www.quickpdf.org/forum/previewing-a-pdf-before-saving_topic2985.html#12055" rel="nofollow - Previewing a PDF before Saving?

This shows the appropriate calculations to create a device context with the correct dpi


Posted By: stevemaughan
Date Posted: 08 Oct 14 at 3:20PM
Wonderful!

Many thanks,

Steve


Posted By: mLipok
Date Posted: 09 Oct 14 at 2:43PM
btw.
this is described here:

http://www.debenu.com/kb/map-pdf-coordinates-delphi-graphics-canvas-coordinates/" rel="nofollow - http://www.debenu.com/kb/map-pdf-coordinates-delphi-graphics-canvas-coordinates/



-------------
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600


Posted By: stevemaughan
Date Posted: 09 Oct 14 at 2:47PM
Thanks - looks like a great article!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk