June 20, 2012

Fixing corrupt PDFs

This is a note to my future self to remind me that when I need to fix a corrupt pdf file to use ghostscript. The relevant command was:

gs \
  -o repaired.pdf \
  -sDEVICE=pdfwrite \
  -dPDFSETTINGS=/prepress \
   corrupted.pdf