Repair PDF — what makes a PDF "broken" and what can actually be fixed in-browser
"PDF won't open" is one of the most common error messages on the internet. The PDF may show as corrupt in Acrobat, fail to render in browsers, or open with garbled content. Most of these failures aren't fundamental — they're recoverable through a fresh parse and re-save with rebuilt structural metadata. The repair tool does exactly that: parse what's recoverable, rebuild the cross-reference table, drop orphaned objects, recompress streams. Here is what kinds of corruption are fixable, what isn't, and the five common failure modes that account for most "won't open" reports.
How PDF repair works
Every PDF has a cross-reference (xref) table — the index that tells the reader where each object lives in the file. When the xref is stale, missing, or out of sync with the actual objects, readers can't find pages and the file appears broken. The repair tool does a two-pass parse: first attempts strict parsing; if that fails, retries with full recovery mode (throwOnInvalidObject: false, ignoreEncryption: true). Once parseable, it re-saves with a freshly-rebuilt xref, dropping orphaned objects and recompressing content streams.
Output is usually smaller than input. PDFs accumulate cruft over their editing lifetime — orphaned objects from delete operations, stale xref entries, redundant copies of resources. The repair cleans these up as a side effect.
Five failure modes the repair tool fixes
From real-world error reports:
- Stale xref tables. The most common failure. After heavy editing, the xref points to byte offsets that don't match where objects actually live. Reader can't find pages; file appears truncated. Repair rebuilds the xref from scratch by scanning the actual objects.
- Missing trailer. PDF requires a trailer at the end pointing to the catalog. Some incomplete uploads or truncated transfers drop the trailer. If the catalog object is still present elsewhere, repair can locate it and write a fresh trailer.
- Broken page-tree references. /Pages dictionary points to a page object that doesn't exist (orphaned by a partial delete operation). Repair removes the broken reference; the surviving pages still render correctly. Lost: the un-referenced page (which was effectively gone already).
- Invalid /Info entries. Some PDF generators produce /Info dictionaries with non-standard fields that strict parsers reject. Repair normalizes /Info or drops invalid entries, keeping the document parseable.
- Wrong %PDF header. PDFs are supposed to start with %PDF-1.x. Some generators produce files starting with whitespace or comments before the header; strict parsers reject. Repair rewrites the header at offset 0.
What repair CAN'T fix
Three categories of corruption beyond the tool's scope:
- Missing catalog object. The catalog is the top-level reference that everything else hangs off of. If it's completely missing, there's nothing to rebuild from. Repair fails cleanly with a clear error rather than producing a broken output. Workaround: try Adobe Acrobat Pro's "Recover Text from Damaged PDF" or pdftk's repair mode.
- Binary corruption inside content streams. If a page's drawing instructions themselves are corrupted (compressed data with garbage bytes, malformed operator sequences), repair can't reconstruct them. Operator-level parsing is beyond the tool's scope. Workaround: extract whatever pages parse correctly; accept loss of the corrupted ones.
- Real password-protected PDFs. If the PDF requires a user-password (open-password) to read, the repair tool can't decrypt it. Unlock first with our Unlock tool (for owner-passwords) or provide the user-password in Adobe Acrobat. Once unlocked, repair can process the file.
Three workflows where repair earns its place
Specific cases:
- Received a "corrupt" attachment. Email or messaging attachment that the recipient can't open. Run repair before declaring it unrecoverable; most of these are simple xref corruption from email encoding glitches.
- Heavily-edited working file. After many edit-save cycles, PDFs accumulate orphaned objects and become bloated. Periodic repair ("compact and rebuild") shrinks the file and often resolves subtle rendering issues that started after specific edits.
- Recovered from disk-corruption. A PDF recovered from a damaged disk or interrupted download. Strict parsers may fail; repair's recovery mode often succeeds where strict parse couldn't.
What you get in the output
Three deliverables alongside the repaired PDF:
- The repaired PDF. Freshly-saved with rebuilt xref. Opens in any reader. Usually smaller than the input.
- Before-after size comparison. Input bytes vs output bytes. Reports the reclaimed space from dropped orphans and re-compressed streams.
- Repair report listing each step. "Rebuilt xref table," "Dropped 12 orphaned objects," "Recompressed content streams," etc. Useful for understanding what was actually wrong with the input and for audit trail when the repair affects a high-stakes document.
Limits and pricing
Free. 100% client-side. The tool handles PDFs up to 100 MB. Parsing runs in your browser via pdf-lib; nothing is uploaded. Output is the repaired PDF + the before/after size + the step-by-step repair report.
Common pairings: Repair → Compress for further size reduction after structural cleanup. Repair → Remove Metadata to drop legacy /Info dictionary noise. Repair → PDF Inspector to verify the repaired file's structural integrity.