跳到正文

修复 PDF

重建损坏的文件,让它重新打得开。

在你的设备上处理

这款工具完全在你的浏览器中运行。文件从不上传,你可以在浏览器的网络标签中亲自验证这一点。 亲自验证:打开浏览器的网络标签观察。你会看到一个查询你是否还有剩余任务的小请求,只包含工具名称和一段哈希,绝不会包含文件。

这款工具的作用

This rebuilds a damaged PDF from whatever is still readable inside it. The cross-reference table - the index that tells a reader where every object lives - is reconstructed by scanning the file, and the result is written out as a clean document. Before you are offered anything, the repaired file is opened again to check it really works, and the report tells you how many pages it had before and how many it has now.

Use it when a reader refuses the file: a download that stopped part way, a file recovered from a failing drive or a memory card, one that came out of a crashed export, or one that opens in a browser but not in Acrobat.

工作原理

  1. Drop the damaged PDF onto this page. This is the one tool that accepts a file whose header looks wrong, because that is exactly the file it exists for.
  2. Leave Rebuild the cross-reference table on. It is the fix for the large majority of PDFs that will not open.
  3. Leave Recover pages on so that, if the ordinary repair fails, the document can be rebuilt from its pages alone.
  4. Turn on Drop unreadable objects only if the first attempt fails. It sacrifices whatever those objects held in exchange for getting a file at all.
  5. Press Repair, then read the report: it says how many pages were readable before and how many the repaired file contains.

Most files that will not open are not badly damaged. A PDF ends with a table of byte offsets pointing at every object in it, and if that table is wrong - because bytes were added, a transfer truncated, or an editor wrote it incorrectly - a strict reader gives up even though the content is all present. The repair scans the whole file for objects, rebuilds the table from what it finds, and writes a fresh document around it.

There is a second, stronger attempt behind the first. If the ordinary repair cannot complete, the document is rebuilt from its page tree into an empty file, which recovers documents whose catalogue is gone but whose pages survived - the usual shape of an interrupted download. That path copies page content and leaves document-level structures behind, so a file recovered this way may lose its outline, its interactive form and its attachments while keeping every page.

The result is verified before it is offered to you. A repair that produces a file nothing can open has not repaired anything, so the output is read back and its pages counted. The counts before and after are both reported, and a repair that recovered 4 pages of 40 is a very different outcome from one that recovered all 40.

Nothing can be recovered that is not in the file. If a transfer stopped at 60 per cent, the missing 40 per cent is gone and no tool will invent it. Keep the damaged original until you have checked the result, because a second attempt with different options sometimes does better.

The repair runs on your device using qpdf compiled to WebAssembly. That matters more here than elsewhere: a file you cannot open is a file you cannot check, and uploading an unknown document to a stranger's server to find out what is in it is a poor trade.

这款工具做不到的事

  • Data that is genuinely missing cannot be recovered. A truncated download comes back as the pages that arrived, not as the whole document.
  • An encrypted file cannot be repaired without its password, because its objects cannot be read. Remove the protection with Unlock PDF first.

常见问题

打不开的 PDF 到底哪里坏了?
多半是交叉引用表,也就是文件末尾记录每个对象位置(字节偏移)的索引。它和对象的实际位置对不上时,即使内容完好,严格的阅读器也会拒绝这份文档。扫描整个文件、重建这张表,就能修好其中大部分情况。
我的页面能恢复多少?
只要还读得出来就会恢复,数量会显示在结果里。它会报告修复前能读到的页数(文件打不开时通常是零),以及修复后文档包含的页数。如果这些数字和你预期的不符,说明文件是有一部分缺失,而不只是损坏。
修复失败了。还能试什么?
打开「丢弃无法读取的对象」再运行一次:无法解析的对象会被丢掉,而不是让整个任务停下,这会损失它们所含的内容,但往往能得到一份可用的文档。如果还是失败,把文件大小和原始来源比一比——比应有大小小很多的文件是在传输中被截断了,只能重新下载。
我必须上传损坏的文件吗?
不必,而且这一点在这里很有意义。打不开的文件就是无法查看的文件,为了弄清里面有什么而把它发到陌生的服务器,是你不必冒的风险。qpdf 以 WebAssembly 的形式在你的浏览器里运行,什么都不会发送。
修复会改动页面本身吗?
不会。页面内容会原样复制,重建的是它周围的结构。如果用到了更强的恢复方式,书签、交互表单、附件这些文档层面的功能可能保不住,但页面会原封不动地保留下来。

相关工具