What can be fixed
qpdf rebuilds broken cross-reference tables and file structure, which fixes many PDFs that fail to open after interrupted downloads or email corruption. It also skips junk added before the start of the file and measures content again when its recorded length is wrong. Files that are truncated badly or are not really PDFs cannot be fully recovered.
How to repair a PDF
- Choose the damaged PDF (up to 100 MB).
- Press Repair PDF. The file is read object by object, the index of objects is rebuilt, and a fresh copy is written.
- Read the report: the pages recovered, what was fixed and anything that couldn't be recovered. Technical details show qpdf's own messages.
- Download the copy ending in -repaired.pdf.
How the check works
A PDF ends with an index (the cross-reference table) that says where each page, font and picture starts. When a download stops early or a program saves the file badly, that index points to the wrong places and readers give up. qpdf ignores the broken index, scans the whole file for its objects and writes a new, consistent file. Repaired files up to 30 MB are then checked again with qpdf's own checker, which decodes every stream, so the report also flags content that is corrupt rather than just misplaced.
Example
In our tests, a 5-page report with a broken index came back with all 5 pages and the message "Repaired". The same report cut off at 40% of its size, like a failed download, came back as "Recovery incomplete: 1 of 5 pages recovered": the first page was intact and the other four were in the missing part of the file.
Tips
- Keep the damaged original: if a fresh download becomes possible later, it is the better fix.
- A PDF that is fine but too big to email doesn't need repairing; use Compress PDF.
- If only some pages matter, repair the file, then keep those pages with Split PDF.
Uses qpdf 12.2.0 (Apache License 2.0), compiled to WebAssembly with zlib and libjpeg-turbo and served from this site, so it runs in your browser. This software is based in part on the work of the Independent JPEG Group. Licence notices.