How to display PDF at its true scale using Poppler?

I am confused about how to display a PDF document at its true scale, i.e. scale = 100%.

NB: I am using python-poppler-qt4 .

Poppler-qt4 provides a method to get the true PDF size in points :

document = Poppler.Document.load('mypdf.pdf')
page = document.page(0)
size = page.pageSize() # returns a QSize object

Then, to make the page in QImage , you need to provide the resolution of the graphics device in dots per inch (DPI):

image = page.renderToImage(72, 72)

Now, since the natural size of the document is provided in dots (for example, 72 per inch), and the image renderer requires dots per inch, can I just assume that the natural size of the document is when its resolution is 72 DPI? Or points and points are two different measures? If I am wrong, what is the solution?

+3
source share
1 answer

Points in a PDF file are physical units; you can measure them with a ruler. Points (pixels) in the image are virtual units, and the connection between them is carried out using the resolution coefficient. When you move content from a vector space to a raster space, you define the relationship between points and pixels (the resolution used for the conversion), then your application can decide what 100% means.

DPI 100% - . Windows 96DPI, PDF 96 . Adobe Reader 100% , 110DPI.

+4

All Articles