3

Tools like pdfcrop (from texlive) are great but they seem to be too focused on removing margins/white space. I'm trying to crop a set of letter pages (8.5x11 inches) to a size of 6x9 inches. I want this measurement to start from the top left of the page; thus the 6x9 I want is the top left 6x9 segment of the original paper, not a centered 6x9 or a 6x9 based on any margins. How can I do this via the command line? I'm on Fedora 23, so something like pdftk is unavailable.

4

You can do this with Ghostscript.

  gs \
  -sDEVICE=pdfwrite \
  -o marked.pdf \
  -c "[/CropBox [54 54 1314 810] /PAGES pdfmark" \
  -f original.pdf

The cropbox must be calculated with the resolution of your PDF, reference is the bottom left corner. See also this QA.

  • Thank you SO much; I had found a Ghostscript solution earlier, but I see now that there was an error in the command I used (an extra " before \PAGES). I had to change it to [0 144 432 792] for my purposes, but your answer (and the QA) were tremendously helpful! – Richard Apr 6 '16 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.