# [poppler] Unit of the result from pageSize() and pageSizeF()

Ross Moore ross.moore at mq.edu.au
Thu Nov 24 14:44:52 PST 2011

```Hi all,

On 25/11/2011, at 8:55 AM, Albert Astals Cid wrote:

>> Yes, I've read that, but I doesn't get it. Does it mean 1/72th points/inch
>> or what? They first said, the unit are points and the example tells
>> something from inch.
>
> 1 point = 1/72th on an inch
> Thus an A4 has 595x842 points ~ 8,26x11,69inches ~ 21x29,7cm

Well, that is actually not true.
So if you are getting small errors, using  72 pts = 1 inch,
then try instead:  72.27pt = 1 inch.
This difference can easily be noticeable in large images.

In 1886 the point was defined to be  1/0.013837 in, which is
quite close to 1/72 in  but actually almost exactly
1/72.27 =  0.0138370001... .

Furthermore, in 1959, the inch became exactly 2.54 cm  when
previously it had been a little more than this
( 1/0.3937 cm  =  2.540005... cm ).
But this change is virtually imperceptible in practice.

So far as PDF is concerned, the ISO 32000 Spec. says:

§8.3.2.3   User Space

... The length of a unit along both the x and y axes is set by the
UserUnit entry (PDF 1.6) in the page dictionary (see Table 30).
If that entry is not present or supported, the default value of 1⁄72 inch
is used. This coordinate system is called "default user space".

NOTE 2
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.

viz. "not exactly the same"  and  "no universal definition".

>> The coordinates yes. But what unit have the parameters xres and yres, which
>> are used to calculate the resolution and the size of the image.
>
> It's dpi, thus if you use 72 you'll get an image of 595x842 pixels for an A4

However if you are laying out pieces measured in points on a grid
with spacing in cm, then you may well find small gaps.

>
> Albert
>
>>
>>
>> Regards,
>> Joachim

Hope this helps,

Ross

------------------------------------------------------------------------
Ross Moore                                       ross.moore at mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------

```