How can I fix/repair a corrupted PDF file? RRS feed

  • Question

  • 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?
    Saturday, August 2, 2014 6:08 PM


  • I had a corrupted PDF file, print.pdf , that Ghostscript couldn't open, but the usual graphical Linux PDF viewers (Okular, Evince) opened fine. (In my case, the file had garbage at the start instead of a PDF header, when opened in a hex editor.)
    These PDF viewers use Poppler as a back-end PDF renderer. So you can repair the PDF using Poppler's command-line tools. In Ubuntu these are in the poppler-utils package. I used:
    pdftocairo -pdf print.pdf print_repaired.pdf
    which generated a PDF file with correct headers, which tools like Ghostscript now accepted. May use demo soft Recovery Toolbox for PDF .

    • Marked as answer by Grakhem Sunday, August 3, 2014 8:36 AM
    • Edited by Carey FrischMVP, Moderator Wednesday, August 13, 2014 5:50 PM Removed hyperlink to commercial product
    Sunday, August 3, 2014 8:12 AM