PDF Repair
Recover corrupted or broken PDFs with a three-stage repair engine — runs locally.
Attempt to repair a corrupted or damaged PDF — re-parse the file structure, recover readable pages, and rebuild a clean output document. The three-stage engine handles PDFs that throw errors in Reader, partially-downloaded files, and documents with broken object references. Success depends on how badly damaged the file is, but the repair runs entirely locally via pdf-lib — so even when a recovery fails, you have not sent a broken file containing potentially sensitive content to anyone.
Three-stage repair engine
Clean re-parse
Reads the PDF structure and, if it loads, writes a clean optimised copy. Invalid objects are skipped automatically.
Recovery retry
Retries the load with encryption errors bypassed, then rebuilds whatever structure could be read.
Page rendering
Last resort: renders each page to an image and rebuilds the PDF. Text selection is lost but the document is viewable.
How PDF Repair Works — Three-Stage Recovery from xref to Rasterization
Common Use Cases
Recover a truncated download
A PDF cut off mid-download often has a corrupt trailer but mostly intact pages — Stage 2 typically recovers the readable portion.
Fix bit-rot on old archives
Backups on aging hard drives or optical media occasionally develop bit-flips that confuse strict parsers; lenient mode usually rebuilds them.
Salvage a partial save
When an application crashed mid-save, Stage 2 can recover content that was already written, often with only the final page or two missing.
Open non-compliant PDFs
Some PDFs from older or specialized generators don't pass strict spec validation. Stage 1 produces a clean, compliant copy that opens in every reader.
Frequently Asked Questions
Advertisement