Reputation: 8704
Is there some image-magick tool to get the size of a PDF file in millimeters? I've tried with the imagemagick "identify" tool but the informations are only in pixels. How can I specify to output the information in millimeters together with the DPI?
Upvotes: 0
Views: 1746
Reputation: 24419
Take a look at the first dozen lines of identify -verbose
. It should list the following info.
The Print size
can be converted to mm easily, or found via google quickly.
For example...
identify -verbose document.pdf | head -12
Which returns
Image: /full/path/to/document.pdf
Format: PDF (Portable Document Format)
Mime type: application/pdf
Class: DirectClass
Geometry: 792x612+0+0
Resolution: 72x72
Print size: 11x8.5
Units: Undefined
Type: TrueColorAlpha
Endianess: Undefined
Colorspace: sRGB
Depth: 16/8-bit
So about 25.4 mm per inch will result in
11 * 25.4 = 279.4mm
8.5 * 25.4 = 215.9mm
Of course YMMV if the PDF is a non-traditional page-size.
Upvotes: 2
Reputation: 5299
If you know the size in pixel you then need to decide if they are pixels/inch or pixels/mm and you can then do a calculation.
Upvotes: 0