Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not familiar with Apple's "Zoom to Fit" feature and its exact behavior (though I can imagine its most important property)...</p> <p>One potential disadvantage when relying on the different *Box values (<code>MediaBox</code>, <code>CropBox</code>, <code>TrimBox</code>, <code>BleedBox</code> and (the deprecated) <code>ArtBox</code>) is, that the <strong><em>real</em></strong> white space may still be different (mostly bigger) from their returned values.</p> <p>Ghostscript has a special device called <code>bbox</code> which returns the "bounding box" of all the pages' rendered content. Example:</p> <pre><code>gswin32c.exe ^ -o nul: ^ -sDEVICE=bbox ^ input.pdf </code></pre> <p>returns (for a random 3 page example I tried this command with):</p> <pre><code>%%BoundingBox: 86 122 509 719 %%HiResBoundingBox: 86.993997 122.993996 508.013984 718.001978 %%BoundingBox: 103 199 152 271 %%HiResBoundingBox: 103.408098 199.998064 151.107956 270.897953 %%BoundingBox: 103 195 185 271 %%HiResBoundingBox: 103.208059 195.000041 184.000002 270.897953 </code></pre> <p>You can probably ignore the high-precision <em>HiResBoundingBox</em> values. This leaves you with:</p> <pre><code>%%BoundingBox: 86 122 509 719 %%BoundingBox: 103 199 152 271 %%BoundingBox: 103 195 185 271 </code></pre> <p>These four values represent the coordinates of the lower left and upper right corners or a rectangle which surrounds all rendered pixels. The units are PostScript points (<code>72 points == 1 inch</code>).</p> <p>Compare this to the <code>*Box</code> values as returned by <code>pdfinfo.exe</code>:</p> <pre><code>pdfinfo ^ -f 1 ^ -l 3 ^ -box ^ input.pdf [....] Page 1 size: 421 x 595 pts (A5) Page 2 size: 421 x 595 pts (A5) Page 3 size: 92 x 80 pts Page 1 MediaBox: 0.00 0.00 595.00 842.00 Page 1 CropBox: 87.00 123.00 508.00 718.00 Page 1 BleedBox: 87.00 123.00 508.00 718.00 Page 1 TrimBox: 87.00 123.00 508.00 718.00 Page 1 ArtBox: 87.00 123.00 508.00 718.00 Page 2 MediaBox: 0.00 0.00 595.00 842.00 Page 2 CropBox: 87.00 123.00 508.00 718.00 Page 2 BleedBox: 87.00 123.00 508.00 718.00 Page 2 TrimBox: 87.00 123.00 508.00 718.00 Page 2 ArtBox: 87.00 123.00 508.00 718.00 Page 3 MediaBox: 0.00 0.00 595.00 842.00 Page 3 CropBox: 92.00 194.00 184.00 274.00 Page 3 BleedBox: 92.00 194.00 184.00 274.00 Page 3 TrimBox: 92.00 194.00 184.00 274.00 Page 3 ArtBox: 92.00 194.00 184.00 274.00 [...] </code></pre> <hr> <p><strong>Update:</strong> Here is a screenshot showing the thumbnails of the PDF document's 3 pages which I used to demonstrate the differences above:</p> <p><img src="https://i.stack.imgur.com/E7Vhz.png" alt="3-page PDF with different page sizes and *Boxes"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload