How to query pdf page size from the command line

pdf

For scripting I need to get the page dimensions of a PDF file (in mm).

pdfinfo just prints it in 'pts', e.g.:

Page size:      624 x 312 pts

What should I use?

Or what unit is 'pts' anyway – in case I want to convert them …

Best Answer

The 'pts' unit used by pdfinfo denotes a PostScript point. A PostScript point is defined in terms of an inch and a resolution of 72 dots per inch:

In the late 1980s to the 1990s, the traditional point was supplanted by the desktop publishing point (also called the PostScript point), which was defined as 72 points to the inch (1 point = 1⁄72 inches = 25.4⁄72 mm = 0.352¯7 mm [ ≙ 0.3528 mm] ).

The manual to gv contains a list of common paper formats specified in PostScript points.

Related Question