Using GhostScript to get page size
Is it possible to get the page size (from e.g. a PDF document page) using GhostScript? I have seen the "bbox" device, but it returns the bounding box (it differs per page), not the TrimBox (or CropBox) of the PDF pages. (See http://www.prepressure.com/pdf/basics/page_boxes for info about page boxes.) Any other possibility? Meanwhile I found a different method. This one uses Ghostscript only (just as you required). No need for additional third party utilities. This method uses a little helper program, written in PostScript, shipping with the source code of Ghostscript. Look in the toolbin