将 Laravel 用于 Web 应用程序,我在其中使用https://github.com/clegginabox/pdf-merger合并 pdf 文件,并在尝试将两个 pdf 文件合并到一起超过 1.4 版时遇到以下错误:
Exception in pdf_parser.php line 133:
This document (C:\path-to-doc\file.pdf) probably uses a compression technique
which is not supported by the free parser shipped with FPDI.
(See https://www.setasign.com/fpdi-pdf-parser for more details)
in pdf_parser.php line 133
Run Code Online (Sandbox Code Playgroud)
我按照以下答案中的建议使用 ghostscript 将任何 1.4 以上的 pdf 转换为 1.4,以便合并工作。
FPDF 错误:此文档 (testcopy.pdf) 可能使用了 FPDI 附带的免费解析器不支持的压缩技术
我已经成功安装了 ghostscript 并将其添加到我的路径中。为了测试,我有一个名为 1.5 版的示例 pdf 文件,test.pdf我从 Windows 终端运行以下命令:
gswin64 -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=new-file.pdf test-file.pdf
我得到了我的 …