I’m programatically printing a JPEG image, which I load with GDI+, to a virtual PDF printer. I select the paper size to be DMPAPER_USER and then I must specify the width and height in millimeters. The JPEG’s resolution is in pixels, however. So I need to come up with a formula that gives mm from pixels for a given DPI. My goal is ideally to select the paper size such that when viewed in Adobe Reader with 100% zoom the image would look exactly as big on the screen as the original JPEG (i.e. it wouldn’t look scaled).
So what is the best way to select a paper size in mm given a resolution in pixels? Also, I’m not sure what DPI I need to select. Will a DPI of 96 make the PDF page look exactly as big as the JPEG when viewed from Adobe Reader?
The screens are normally (but not always) 96 DPI.
If you can set the DPI to print at, just set it to match the screen DPI (this will make it the same as the PC that created it but different on a machine that uses a different display DPI)
If it doesn’t, just convert the image size to inches with simple division and convert to millimeters: