iTextSharp get PDF DPI

此生再无相见时 提交于 2019-12-22 18:57:10

问题


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


回答1:


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.




回答2:


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.

ISO-32000-1 (section 8.3.2.3) tells us

“the default for the size of the unit in default user space (1/72 inch) is approximately the same as a point (pt), a unit widely used in the printing industry. It is not exactly the same; 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.



来源:https://stackoverflow.com/questions/2043651/itextsharp-get-pdf-dpi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!