“The file is damaged and could not be repaired”: what it means for a PDF
Acrobat or Reader says there was an error opening the document, the file is damaged and could not be repaired. Sometimes the file is truly broken. More often it is missing one small part, or it was never a PDF at all.
Written · Updated
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
| Cause | What it does to the file | Recoverable? |
|---|---|---|
| A download or copy cut short | The end is missing: the index, the trailer, and possibly the last pages | The pages that arrived, yes |
Lines added before %PDF by an email gateway or a script | Every position in the index is out by the number of bytes added | Yes, all of it |
| A program that appended an edit badly | The newest index points to objects that are not where it says | Usually, 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 throughout | Rarely; get the original again |
| Not a PDF at all | An HTML page, an empty file, or another format with a .pdf name | No; 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
- Opening a file without the software that made itMost files that will not open are a container your machine has no reader for. HEIC, .msg, winmail.dat, Word, Excel, zips and CSVs, opened in the browser tab.
- How to open a HEIC fileA photograph in a container most software cannot open: what the box is, what is inside it, and how to get a JPEG out without uploading it.
- Why a PDF table comes out wrong in ExcelA PDF has no table in it, only words placed on a page. Why converted tables land in one column, split or merge wrongly, and how to get a usable sheet.
- Why only the first page of a TIFF shows, and how to see the restA multi-page TIFF stores each page as its own image, and many viewers stop after the first.
- Open an Excel file without Excel, without uploading itAn .xlsx is a zip of XML a browser can read in the tab. What comes across (sheets, values, formulas, formats), what does not (charts, macros, pivot tables), and how to save it back.
- How to open a .msg file without Outlook, and without uploading itA .msg is a small file system, not text, which is why only Outlook opens one. Reading it in a browser tab, saving the attachments, keeping the headers, and why a converter site sees everything on it.
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.