Tim*_*der 100 repair pdf ghostscript
有没有人有任何修复损坏的 PDF 的建议或程序?当我打开文件时,我收到“打开此文档时出错。文件已损坏,无法修复。” 那里似乎有无数的工具,但没有一个我可以形容为有信誉的。是否有任何基于开源 linux 的解决方案?
Kur*_*fle 119
Ghostscript 将自动修复您损坏的 PDF...如果它可以首先打开它(也就是说,如果它没有损坏无法修复)。但是之后你仍然需要仔细检查结果......
在 Linux 上,试试这个命令:
gs \
-o repaired.pdf \
-sDEVICE=pdfwrite \
-dPDFSETTINGS=/prepress \
corrupted.pdf
Run Code Online (Sandbox Code Playgroud)
在 Windows 上,试试这个:
gswin32c.exe ^
-o repaired.pdf ^
-sDEVICE=pdfwrite ^
-dPDFSETTINGS=/prepress ^
corrupted.pdf
Run Code Online (Sandbox Code Playgroud)
Mec*_*ail 48
我有一个损坏的 PDF 文件,print.pdfGhostscript 无法打开,但通常的图形 Linux PDF 查看器(Okular、Evince)打开得很好。(在我的例子中,当在十六进制编辑器中打开时,文件在开始时有垃圾而不是 PDF 标题。)
这些 PDF 查看器使用 Poppler 作为后端 PDF 渲染器。因此,您可以使用 Poppler 的命令行工具修复 PDF。在 Ubuntu 中,这些都在poppler-utils包中。我用了:
pdftocairo -pdf print.pdf print_repaired.pdf
Run Code Online (Sandbox Code Playgroud)
它生成了一个带有正确标题的 PDF 文件,现在可以接受 Ghostscript 等工具。
jmi*_*rez 32
mutool( project page , manpage ) 将修复损坏的 PDF而不打印它们。
sudo apt-get install mupdf-toolsmutool clean input.pdf output.pdfRun Code Online (Sandbox Code Playgroud)mutool clean [options] input.pdf [output.pdf] [pages] The clean command pretty prints and rewrites the syntax of a PDF file. It can be used to repair broken files, expand compressed streams, filter out a range of pages, etc. If no output file is specified, it will write the cleaned PDF to "out.pdf" in the current directory.
或者,有一些工具和框架可以将 PDF 分解/反编译为它们的组件,而无需渲染它们。这些对于提取文本、脚本和图像可能很有用。有关此类工具的列表,请参阅此答案:https : //reverseengineering.stackexchange.com/q/1526/8210。例如,您可以尝试当前最佳答案Origami,它具有基于 GTK 的查看器。
Ori*_*iol 12
我有一个损坏的 pdf 文件,因为用于下载它的 php 文件在末尾回显了一些错误(在 HTML 中)和 NUL 字符。
解决方案是用 Notepad++ 打开 pdf 并删除该行后的所有文本
%%EOF
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
138920 次 |
| 最近记录: |