Delete content cropped from PDFs in Preview #

Cropping PDFs in Preview merely hides content (rather than erasing it) as explained in the alert dialog:

Cropping a PDF document doesn’t delete the content outside the selection.

The content outside the selection is hidden in Preview, but you might be able to view it in other applications.

Mac OS X 10.6.8 Snow Leopard’s Preview 5.0.3 (504.1) was the last version to support viewing the hidden data, as shown in its very different alert dialog:1

Cropping a document doesn’t destroy its contents.

You can view the uncropped document by choosing View > PDF Display > Media Box

Happily, Skim can do what modern versions of Preview cannot, revealing hidden content outside of the crop box: click PDF in the app menu → PDF Display → toggle Crop Box to Media Box.2

To permanently eliminate cropped content and adjust the PDF dimensions, execute the following Ghostscript command after cropping and saving in Preview:

gs -sDEVICE=pdfwrite -dUseCropBox -o output.pdf input.pdf

then verify in Skim as above.

Ghostscript can be built and installed from source (./configure && make && make install), downloaded as a PKG installer from MacTeX, or installed via brew install ghostscript .

Related

Footnotes

  1. A retrospective look at Mac OS X Snow Leopard | HN

  2. Skim sports a slew of awesome features, including a real dark mode (that applies to content as well as the interface) and the ability to integrate with LaTeX.

/mac | May 16, 2024


Subscribe or visit the archives.