Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Does anyone have any recommendation or procedures for repairing a corrupt PDF? When I open the file I get "There was an error opening this document. the file is damaged and cannot be repaired." There seems to be a myriad of tools out there but none that I could describe as reputable. Are there any opensource linux based solutions for this possibly?

share|improve this question
Opensource PDF tools tend to be pretty crappy, I'm afraid. What are you using? – Satanicpuppy May 3 '11 at 14:38
Also see: superuser.com/questions/166999/… – slhck May 3 '11 at 14:39
didnt like the look of any of the tools as they looked like the myriad of "Registry Cleaners" out there that are useless. Have been trying Adobe Pro and have just started looking if Ghostscript or PDFForge have any repair switches. – Tim Alexander May 3 '11 at 14:48
Ghostscript is okay, but it's certainly not better than Acrobat. It's completely bare bones. – Satanicpuppy May 3 '11 at 18:41
@Satanicpuppy I disagree :: I use ghostscript to rebuild damaged or low-quality pdfs quite often and it performs very well. – Eddie B Feb 5 at 20:16

1 Answer

up vote 15 down vote accepted

Ghostscript will repair your corrupted PDF automatically... if it can open it in the first place (that is, if it is not damaged beyond repair). But afterwards you'll still need to double-check the result...

On Linux, try this command:

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

On Windows, try this one:

 gswin32c.exe ^
  -o repaired.pdf ^
  -sDEVICE=pdfwrite ^
  -dPDFSETTINGS=/prepress ^
   corrupted.pdf
share|improve this answer
Ghostscript does a fantastic job of rendering pdfs ... I regularly use gs to rebuild pdfs to improve font quality. – Eddie B Feb 5 at 20:14

protected by Community Nov 15 '12 at 7:18

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

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