How to open a corrupted or broken PDF file
A PDF that refuses to open feels final — but "won't open in one viewer" is not the same as "destroyed." PDFs break in a small number of predictable ways, and many damaged files can be opened or at least partially recovered. This article explains the usual causes and a sensible recovery order.
How a PDF is put together
Understanding the failure starts with the structure. A PDF is roughly:
- A
%PDF-header at the very start. - A body of objects (pages, text, images, fonts).
stream/endstreamblocks whose length is declared by aLengthvalue.- A cross-reference (xref) table at the end, mapping byte offsets to each object.
- A
trailerthat points to the xref table.
A reader opens the file by reading the trailer, jumping via the xref to objects, and rendering them. Break any of those links and the file may not open — even if most of the content is fine.
Common causes of corruption
- Broken xref table. The offsets are wrong (truncated download, partial write, bad merge). The content exists; the map to it is wrong.
- Missing or damaged
%PDFheader. Some tools refuse to start without a valid header. - Incorrect stream lengths. If a
Lengthvalue does not match the actual bytes, a reader may choke on the stream. - Truncated file. The download or copy stopped early, so the trailer and xref are absent.
- Interrupted save. A crash or ejected drive left a half-written file.
None of these necessarily means total loss.
Step 1: Try a tolerant reader
Different engines are strict or lenient in different places. A file one viewer rejects may open in another that rebuilds the xref on the fly or ignores a missing header. A read-only, offline reader that prioritises opening over strict validation can often display a document that a stricter tool refuses — without writing a "repaired" copy that might mangle it.
Step 2: Re-download or re-copy the source
A surprising share of "corrupt" PDFs are simply incomplete transfers. If you have the original source:
- Re-download from the sender or website.
- Copy from the original medium again, verifying it completed.
- Check the file size against what you expect; a tiny file where a large one is expected means truncation.
Step 3: Repair the structure
Repair tools typically rebuild the xref table by scanning for objects, or reattach a missing header. This works well for map errors and minor damage. Caveats:
- Repair rewrites the file, so keep your original.
- If the content streams themselves are truncated, repair can recover the part that survived but not the missing tail.
Step 4: Recover what survived
When a file will not open whole, you can still often extract value:
- Open individual pages if the damage is localised.
- Use a recovery routine that reads streams sequentially and keeps what parses.
- For scanned PDFs, the images may survive even if the text layer is broken (see OCR on Windows).
What cannot be recovered
Be realistic. If the encrypted content is there but you lack the password, no structural repair helps. If the truncated tail held the only copy of later pages, those pages are gone. Corruption is recoverable when the bytes exist somewhere; it is not magic when they do not.
A quick triage table
| Symptom | Likely cause | First move |
|---|---|---|
| "File is corrupt" instantly | Bad xref / header | Try tolerant reader, then repair |
| Opens then stops mid-page | Truncated stream | Re-copy source |
| Huge file, tiny result | Truncated download | Re-download |
| Slow or partial render | Damaged objects | Recover page-by-page |
Prevention: stop corruption before it starts
Recovery is good; not needing it is better. A few habits sharply cut how often PDFs break. Always eject drives and let writes finish before unplugging. Avoid interrupting a save or print-to-PDF job. Download large files in one session and verify the size rather than resuming piecemeal. Keep at least one spare copy of anything important, because a second source is the ultimate fallback when the first file will not open. None of this is exotic, but together these habits eliminate most of the truncated-download and half-written-file cases that fill support inboxes.
Conclusion
A PDF that will not open is often a PDF with a broken map, not a destroyed document. Start by trying a tolerant reader, re-fetch the source to rule out truncation, then repair the xref or header if needed — always keeping the original. Recover page-by-page when damage is local. And remember the limit: repair restores what the bytes still contain, not what was lost. A careful offline reader lets you inspect a suspect file without risking further writes to it.
FlyPDF does this locally. Read-only by design: OCR, search, annotations and text export all run on your machine, and the source file is never rewritten.
Try FlyPDF free for 30 days