PDF Repair: What Comes Back and What Never Will
The usual damaged PDF is not empty: it is a file whose cross-reference table no longer matches the objects behind it. Repair rebuilds that map and writes a fresh document from what it can still read.
Why this comes up
Files arrive truncated from email gateways, interrupted downloads and failed saves, and the pages often survive even when the viewer refuses the file. The difference between a recoverable file and a lost one is whether the page data was written at all.
Check before you run it
- Rule out a password before treating it as damage. A protected file can look broken because the viewer cannot render it without the password. Unlock it with the password you know, then repair the unlocked copy if it still fails.
- Compare the page count and the last page with the original. Repair works from the objects it can find, so the rebuilt file can be shorter. Check the final page's content, not just that the document opens.
- Keep the damaged original until the copy is checked. Repair writes a new file and leaves the upload alone, but the original is the only evidence of what was lost. Do not delete it until the repaired copy has been read end to end.
When to reach for it
- A download stopped before the file was complete. The beginning of the file usually holds every page; the tail with the index is what went missing.
- One viewer opens the file and another refuses it. A mismatched cross-reference table is read leniently by some viewers. Rebuilding it produces a file that all of them accept.
One question we get
What kinds of damage can it fix?
Truncated uploads and broken internal structures — pikepdf (the library behind QPDF) rebuilds the file's cross-reference table from the objects it can still find, then writes a complete PDF again. Pages whose data was never written cannot be invented; everything that is still in the file comes back.
Where it fits
The tools people usually open next to Repair:
- Flatten — Makes fillable PDFs read-only. Print & scan in one step
- Compress — Reduce the size of your PDF.
- Edit PDF — Fill & sign PDF. Add text, links, images and shapes. Annotate.
Every tool works on a copy, so the original file is never touched. Uploads are stored under an unguessable id and deleted automatically two hours after you last open them; nothing is listed, shared or indexed. More on the security page.