Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, take note that the measurement unit for PDF is the same as for PostScript: it's called a <em>point</em> [pt]. </p> <pre><code>72 points == 1 inch == 25.4 millimeters </code></pre> <p>Assuming you have a page size of A4. Then the media dimensions are:</p> <pre><code>595 points width == 210 millimeters 842 points height == 297 millimeters </code></pre> <p>Assuming you want to crop off:</p> <pre><code> left edge: 24 points == 1/3 inch ~= 8.5 millimeters right edge: 36 points == 1/2 inch ~= 12.7 millimeters top edge: 48 points == 2/3 inch ~= 17.0 millimeters bottom edge: 72 points == 1 inch ~= 25.4 millimeters </code></pre> <p>Then your Ghostscript commandline is this (on Windows):</p> <pre><code>gswin32c.exe ^ -o cropped.pdf ^ -sDEVICE=pdfwrite ^ -c "[/CropBox [24 72 559 794]" ^ -c " /PAGES pdfmark" ^ -f uncropped-input.pdf </code></pre> <p>Or on Linux:</p> <pre><code>gs \ -o cropped.pdf \ -sDEVICE=pdfwrite \ -c "[/CropBox [24 72 559 794]" \ -c " /PAGES pdfmark" \ -f uncropped-input.pdf </code></pre> <p>However, this may not work reliably for all types of PDFs <sup><strong><em>[1]</em></strong></sup>. In those cases you should alternatively try these commands:</p> <pre><code>gswin32c.exe ^ -o cropped.pdf ^ -sDEVICE=pdfwrite ^ -dDEVICEWIDTHPOINTS=595 ^ -dDEVICEHEIGHTPOINTS=842 ^ -dFIXEDMEDIA ^ -c "24 72 translate" ^ -c " 0 0 535 722 rectclip" ^ -f uncropped-input.pdf </code></pre> <p>or</p> <pre><code>gs \ -o cropped.pdf \ -sDEVICE=pdfwrite \ -dDEVICEWIDTHPOINTS=595 \ -dDEVICEHEIGHTPOINTS=842 \ -dFIXEDMEDIA \ -c "24 72 translate" \ -c " 0 0 535 722 rectclip" \ -f uncropped-input.pdf </code></pre> <hr> <p><strong><em>[^]</em></strong> : <sub>To be more specific: it will not work for PDFs which come along with their own <code>/CropBox</code> already defined to specific values. A dirty hack around that is to change the string <code>/CropBox</code> for all pages where it is desired to <code>/cROPBoX</code> (or similar case-changing) with a text editor prior to running the above GS command. The case-change effectively "disarms" the cropbox setting (without changing any PDF object offsets invalidating the existing <code>xref</code> table) so it is no longer considered by PDF renderers.</sub></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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