PDFToolbox

Repair PDF

Try a verified rewrite for PDFs with recoverable structural problems. Repair is not guaranteed when essential document data is missing or severely damaged.

Upload a PDF to repair

Upload a PDF that will not open correctly, has broken structure, or needs a clean rewrite. Uploaded and generated files become eligible for scheduled cleanup after 60 minutes.

No file selected

Drag and drop a file here, or click to browse.

Verified PDF Rewrite

Repair recoverable PDF structure and create a fresh copy

A PDF can contain usable pages and content while still having structural problems that make it difficult for some software to read. Repair PDF attempts to create a new copy from the recoverable document structure instead of modifying the visible content of individual pages.

The repair process can try several rewrite methods. A candidate is not returned simply because a repair program created a file: the resulting PDF must pass verification before the download is made available.

01

Upload the PDF

Choose one PDF up to the site's upload limit. Encrypted PDFs and PDFs containing digital-signature fields are not processed by this repair tool.

02

Inspect the source

The repair engine checks for a PDF header, encryption, signature fields, available pages, and basic document markers before attempting a rewrite.

03

Try a fresh rewrite

The worker can try qpdf rewrites and, when needed, later repair methods such as PyMuPDF clean-save or Ghostscript PDF output.

04

Verify the result

The output must exist, reopen as a PDF, contain loadable pages, remain unencrypted and unsigned, and preserve the source page count when that count is known.


Problems the repair process may be able to recover

PDF damage varies widely, so recovery depends on what information is still present in the file. Repair PDF is most useful when the document still contains readable page data but its surrounding PDF structure needs to be rewritten.

Production acceptance testing confirmed recovery of a PDF with extra leading bytes before its PDF header and another PDF with a deliberately broken startxref value. Those results show that these specific structural problems can be recoverable; they do not mean every cross-reference or corruption problem can be repaired.

Examples of recoverable situations

  • • Extra bytes or junk before the real %PDF- header.
  • • Some malformed cross-reference or startxref conditions.
  • • A readable PDF that benefits from being rewritten into a fresh copy.
  • • A qpdf rewrite that completes with recoverable warnings and then passes independent output verification.

What Repair PDF will not do

  • • It cannot recreate page content or document bytes that are no longer present in the source file.
  • • It does not process encrypted PDFs, including permissions-only encryption.
  • • It does not rewrite PDFs containing digital-signature fields because rewriting can invalidate signatures.
  • • It does not guarantee that every malformed PDF can be recovered or that every repaired file will render identically to its source.
  • • It is not a dedicated compression tool. A rewrite can change file size in either direction.

Verification before download

A successful repair job is checked again before it is returned. The repaired file must be non-empty, reopen successfully as a PDF, contain at least one page, and allow every page to be loaded. The output must also be unencrypted and free of digital-signature fields.

When the source PDF is readable enough to determine its page count, the repaired copy must contain exactly the same number of pages. If an attempted repair creates a candidate that fails verification, that candidate is discarded rather than offered as a successful download.


What our production acceptance test confirmed

Before publishing these capability descriptions, the production workflow was exercised through the same upload, queue, worker, job-status, and download path used by the live tool. A normal two-page PDF, a PDF with leading junk, and a PDF with a broken startxref value all produced verified downloadable outputs.

The two-page test retained its page count and page rotations, and rendered page images matched before and after the rewrite in that observed sample. Separate production tests confirmed that a non-PDF file, an open-password encrypted PDF, a permissions-only encrypted PDF, and a PDF containing a signature field were rejected without leaving a repaired output available for download.


After repairing a PDF

Review the repaired copy before relying on it, especially when the source file was damaged. If you need a smaller file afterward, use Compress PDF. To work with selected pages, use Split PDF. For scanned pages that need searchable text, use PDF OCR.

FAQ

What does Repair PDF actually do?

The tool creates a fresh PDF rewrite rather than editing the visible page content. It first tries qpdf-based rewrites and can fall back to other repair methods, including PyMuPDF and Ghostscript, when an earlier attempt cannot produce a verified result. Before a repaired file is offered for download, the output must reopen as a PDF and pass additional checks.

What kinds of PDF problems can this tool help with?

Repair PDF can help with some recoverable structural problems. For example, it can remove leading bytes that appear before the PDF header, and production testing recovered a PDF with a deliberately broken startxref value. Not every damaged PDF is recoverable, especially when essential page or document data is missing.

Does Repair PDF work with encrypted or signed PDFs?

No. Encrypted PDFs are rejected, including files that open without a user password but still contain PDF encryption. PDFs containing digital-signature fields are also rejected because rewriting a signed PDF can invalidate its signatures. If you are authorized to remove encryption, unlock the PDF first and then try Repair PDF.

Will the repaired PDF look exactly the same?

The tool does not intentionally edit page content, but a structural rewrite can change the PDF's internal representation and exact preservation cannot be guaranteed for every damaged file. When the source page count can be read, the repaired output must keep the same page count. In production acceptance testing, a two-page sample also preserved its page rotations and rendered pages identically. Always review the repaired copy before relying on it.

How long are uploaded and generated files kept?

Uploaded and generated files become eligible for scheduled cleanup after 60 minutes. Cleanup is scheduled rather than guaranteed at an exact deletion minute.

Related Tools