Getting pagesize from PDF file

Started by Leo-NL, March 22, 2018, 08:22:55 AM

Previous topic - Next topic

Leo-NL

I am searching for the right tag to get the page size of a number of PDF files.
When I look at the available metadata I see a lot of information, but no page size.
This information should be somewhere,  because when hovering the mouse cursor in Reader on the left-bottom corner the size is shown, as is when opening the print window.

Leo

Phil Harvey

Hi Leo,

Each page may be a different size, so you must dig deeper to see this information.  Try using the -v option and look for the CropBox size for each page.  These numbers should give you the point size of the page (units of 1/72 inch).

For example:

> exiftool -v docs/mwg_guidance.pdf | grep CropBox
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]
  | | | | | 0)  CropBox = [0,0,612,792]


Here the pages are all 8.5" x 11".

But note that embedded objects may also have crop boxes, so it is not always as simple as my example.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).