Table of Contents
What Is PDF Corruption?
A PDF is a structured binary format: header, body (objects), cross-reference table (xref), trailer. Corruption means one of these is broken:
- Truncation: File cut off mid-stream (incomplete download, disk full). Missing trailer/xref.
- Bad xref: Offsets point to wrong locations. Viewer can't find objects.
- Invalid streams: Compressed data doesn't decompress (checksum mismatch, wrong filter).
- Missing objects: Referenced object doesn't exist (font, image, page).
- Header damage: Doesn't start with
%PDF-.
Symptoms: "File damaged," "Cannot open," blank pages, missing content, viewer crashes.
Repair Levels: From Gentle to Nuclear
{`// Repair Strategy Escalation
| Level | Method | Privacy | Success Rate | Data Loss Risk |
|-------|---------------------------|------------|--------------|----------------|
| 1 | Open in different viewer | Local | 30% | None |
| 2 | Linearize (qpdf/pikepdf) | Local | 60% | None |
| 3 | Save As (Acrobat/Editor) | Local | 70% | Low |
| 4 | Compress (Low) | Local* | 50% | Low |
| 5 | Server repair | Upload | 80% | Medium |
| 6 | Rasterize → Rebuild | Local | 95% | High (text) |`}
*Our Compress PDF Low level is client-side.
Client-Side Repair (Our Tools)
Compress PDF — Low Level
Our gentlest repair. Rebuilds cross-reference table, linearizes (Fast Web View), strips metadata, recompresses streams. Often fixes:
- Minor xref errors
- Incremental save debris
- Non-linearized files that load slowly
How to: Open Compress PDF → drag file → choose Low → download. Free, private, no upload.
PDF to JPG → JPG to PDF (Nuclear)
Rasterizes every page to pixels (300 DPI recommended), then rebuilds a clean PDF from those images. Bypasses ALL PDF structure issues. Always works if pages render at all.
Trade-offs: loses text layer (no search, no select), larger file, quality depends on DPI. But you get a working PDF.
Desktop Repair Tools
Adobe Acrobat Pro
File → Save As Other → Optimized PDF. Rebuilds structure, linearizes, can fix many corruptions. Expensive ($239/yr).
PDF-XChange Editor (Windows, Freemium)
File → Save As. Rebuilds xref. Free tier works for repair. Watermarks on some outputs.
Other Viewers (Save As)
Sometimes just opening in a different viewer and doing "Save As" rewrites the file cleanly. Try: SumatraPDF, PDF-XChange, Preview (macOS), Chrome Print → Save as PDF.
CLI Repair (Advanced)
For developers/power users. Local, scriptable, powerful.
qpdf
{`# Linearize (rebuilds xref, enables fast web view)
qpdf --linearize damaged.pdf repaired.pdf
Force repair (attempts to recover from truncation)
qpdf –force-version=1.7 –linearize damaged.pdf repaired.pdf
Check structure without repairing
qpdf –check damaged.pdf`}
pikepdf (Python)
{`import pikepdf
Open and save (rebuilds structure)
pdf = pikepdf.open(“damaged.pdf”)
pdf.save(“repaired.pdf”)
With linearization
pdf.save(“repaired.pdf”, linearize=True)
Inspect objects
for obj in pdf.objects:
print(obj)`}
Ghostscript
{`# Rebuild via PostScript interpretation (heavy but thorough)
gs -o repaired.pdf -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress damaged.pdf`}
Server-Based Repair (Privacy Note)
Services: iLovePDF Repair, PDF2Go Repair, Sejda Repair, PDF24 Repair.
- Upload → they run repair engines → download
- Often higher success rate (commercial engines, more heuristics)
- Your corrupted file uploads to their servers
- For sensitive docs: use local tools only
Last Resort: Rasterize & Rebuild
When structure is too broken for any repair:
- PDF to JPG at 300 DPI (or PNG for lossless)
- If that fails: open in any viewer that renders it → screenshot each page → JPG to PDF
- Result: visually identical PDF, no text layer, clean structure
Then: Compress PDF (Moderate) to reduce size. Protect PDF if needed.
Prevention
- Verify downloads: Check file size matches source. Redownload if mismatch.
- Don't edit PDFs in text editors: Never open .pdf in Notepad/VS Code and save.
- Use "Save As" not "Save" in viewers: "Save" often does incremental update (appends). "Save As" rewrites clean.
- Backup originals: Before any repair attempt, copy the damaged file.
- Linearize for web: Use Compress PDF Low on PDFs you host — prevents partial-load corruption.
FAQ
How do I fix a corrupted PDF for free?
Try our Compress PDF (Low level) — client-side, rebuilds structure. Or qpdf (CLI, free). Or PDF-XChange Editor (Windows, free tier).
Can a corrupted PDF be repaired?
Often yes — minor structure issues (xref, linearization) are fixable. Severe truncation (missing end of file) = data loss, may need rasterize-rebuild.
How do I repair a PDF without uploading?
Use our Compress PDF (Low) — client-side. Or qpdf/pikepdf (CLI, local). Or PDF-XChange Editor (local).
What does "linearize a PDF" mean?
Reorganize file so page 1 loads first, then page 2, etc. Enables streaming in browser. Also rebuilds cross-reference table — fixes many corruptions.
Can I fix a PDF that says "file damaged"?
Yes — try Compress PDF Low, or qpdf --linearize, or PDF-XChange Save As. If those fail: rasterize (PDF to JPG → JPG to PDF).
How do I fix a truncated PDF?
Truncated = missing bytes at end. qpdf --force-version with --linearize sometimes recovers. Otherwise: rasterize-rebuild. Or redownload.
Is there a free PDF repair tool online?
Server-based: iLovePDF, PDF2Go, Sejda (free tiers, upload required). Client-side: our Compress PDF Low (free, private). CLI: qpdf, pikepdf (free, local).
Got a damaged PDF? Start with Compress PDF (Low) — free, private, often fixes it. If not, try PDF to JPG → JPG to PDF (nuclear option).