Settings

A PDF ends with an index, the cross-reference table, that gives the byte position of every object in the file, and a trailer that says where the index is. Acrobat reads the end of the file first and follows it. If the file was cut short, had something added at the top, or was never a PDF (an error page saved with a .pdf name is common), the index is missing or points to the wrong places, and Acrobat’s attempt to rebuild it can fail. Check what the file really is first. If it is a PDF whose pages are still in it, the index can be rebuilt by reading the objects from the top, which is what MEND does in the browser tab. What was cut off the end cannot be brought back by anything.

Check what the file is

  • Its size. 0 bytes, or a few kilobytes for what should be a long document, means the content never arrived. Download it again; nothing can repair data that is not there.
  • Its first bytes. Open a copy in Notepad or TextEdit. A PDF begins %PDF-1. followed by a version digit (or %PDF-2.0). If it begins <!DOCTYPE html> or <html, you saved a web page, usually a sign-in or "link expired" page from the site the file came from. Sign in and download it again.
  • Its last bytes. A complete PDF ends with startxref, a number, and %%EOF. If the end is a jumble of binary with no %%EOF, the download or copy stopped part of the way through.
  • Other readers. Open it in a browser (Chrome, Edge, Firefox and Safari all have PDF readers built in). They are more forgiving than Acrobat about a broken index, and if one shows the pages, print it to a new PDF and the problem is gone.

The usual causes

CauseWhat it does to the fileRecoverable?
A download or copy cut shortThe end is missing: the index, the trailer, and possibly the last pagesThe pages that arrived, yes
Lines added before %PDF by an email gateway or a scriptEvery position in the index is out by the number of bytes addedYes, all of it
A program that appended an edit badlyThe newest index points to objects that are not where it saysUsually, as of the last good save
A transfer in text mode (old FTP, some scripts)Line endings changed inside binary streams, so pictures and compressed text are corrupted throughoutRarely; get the original again
Not a PDF at allAn HTML page, an empty file, or another format with a .pdf nameNo; download it properly

Before any of this, rule out the reader. If every PDF fails and not just this one, the fault is in the program: update Acrobat or Reader, and on Windows try Help → Repair Installation.

Rebuilding the index

The index is a convenience. Every object in a PDF is also marked in place, 12 0 obj at the start and endobj at the end, so a program can find them all by reading the file from the top, the way you could with a text editor, then find the document’s root and its pages by what they are and write the whole file out again with a new index. That is what a "rebuild" means in repair tools, and it recovers everything in the first three rows of the table above.

MEND does it in the tab. Drop the file on it and it first says what it finds in the file’s structure: bytes before the PDF begins, an index that is missing or points to the wrong place, no end-of-file mark, and how many pages a forgiving reader can draw as it stands. Then it rebuilds from the objects, making a new page list from the pages it can find whole if the old one is broken, and reports what it did and how many pages, if any, could not be recovered. The file is read on your own device and not sent anywhere.

If the objects themselves cannot be read, its last resort is to let a forgiving reader draw what it can of each page and keep those as pictures. That keeps how the pages look and loses the text, and the page says so; OPTIC can read the words back from the pictures afterwards.

We held it to five damaged copies of a three-page PDF, made from one good file: an index pointing to the wrong place, two gateway header lines added before %PDF, a stream with the wrong stated length, the file cut off where its index began, and a page’s contents blanked out of the middle. The first four came back as three pages with their text in order; the fifth came back as two, with the third counted as lost. A file with no PDF in it is turned away in words rather than "repaired" into nothing.

Opening and diagnosing is free. Saving the repaired copy is part of OBSCURA Pro, or US$1 to save from one tool for a day.

What no repair can do

A page whose drawing instructions were cut off the end of the file is gone. So is a picture corrupted by a text-mode transfer, and so is anything in a file that is encrypted when the password is unknown. A repair tool that promises otherwise is describing a hope. Open the result, look through every page, and keep the damaged original until you have.

Questions people ask about “The file is damaged and could not be repaired”: what it means for a PDF

What does “the file is damaged and could not be repaired” mean?

Acrobat could not find or rebuild the PDF's index, the table at the end of the file giving the position of every object. Usually the file was cut short, had bytes added at the top, or is not a PDF at all.

How do I know if my file is really a PDF?

Open a copy in a text editor. A PDF starts with %PDF- and a version number. If it starts with a DOCTYPE or html tag, it is a web page saved with a .pdf name, often a sign-in page; download the file again.

Can a corrupted PDF be repaired?

Often. If the pages are still in the file and only the index is missing or wrong, the index can be rebuilt by reading the objects from the top. Pages cut off the end of the file cannot be recovered.

How do I repair a PDF for free?

First try opening it in a web browser, which is more forgiving than Acrobat, and printing it to a new PDF. MEND diagnoses and rebuilds the file in the browser; diagnosing is free and saving the repaired copy is part of OBSCURA Pro.

Why does the PDF open in Chrome but not in Acrobat?

Browser PDF readers rebuild a broken index quietly and show what they can. Acrobat is stricter. Print the PDF from the browser to a new PDF to get a clean copy.

Why is my downloaded PDF damaged?

The download was interrupted, the site sent an error page instead of the file, or something rewrote the file on the way. Check the size and the first and last bytes, then download it again.

Will repairing a PDF keep the text?

Rebuilding the index keeps everything that was still in the file, text included. Drawing pages as pictures, the last resort, keeps their look but not their text.

Related

More on this

All 22 guides under “A file that will not open, or comes out wrong”.

A letter, now and then

An occasional letter when there is something worth reading: the new guides and what changed in the tools. Never more than once a month and nothing else, and you can leave at any time on the unsubscribe page.