tags:

views:

531

answers:

2

How can I get the DPI of the PDF that I am reading from my hard drive into iTextSharp?

+3  A: 

PDF's do not necessarily use DPI in their definitions. PDF's allow the document creator to define their own user coordinate space which may or may not map to anything similar to Dots Per Inch.

Nick
+1  A: 

Check this How to calculate the correct image size in out pdf using itextsharp ?

PDF UserUnit shall give the size of default user space units, in multiples of 1 ⁄ 72 inch.

The default for the size of the unit in default user space (1 ⁄ 72 inch) is approximately the same as a point, a unit widely used in the printing industry. It is not exactly the same, however; there is no universal definition of a point.

Conceptually, user space is an infinite plane. Only a small portion of this plane corresponds to the imageable area of the output device: a rectangular region defined by the CropBox entry in the page dictionary. The region of default user space that is viewed or printed can be different for each page.

Coordinates in user space (as in any other coordinate space) may be specified as either integers or real numbers, and the unit size in default user space does not constrain positions to any arbitrary grid. The resolution of coordinates in user space is not related in any way to the resolution of pixels in device space.

MK