使用 PHP/linux 将文件合并为单个 PDF [英] Merge files into a single PDF using PHP/linux

查看:61
本文介绍了使用 PHP/linux 将文件合并为单个 PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究如何将多个 PDF 合并为一个 PDF.

I'm investigating how one can combine multiple PDF's into a single PDF.

我正在寻找一个尽可能可靠和健壮的库.最好是可以保存书签的图书馆.

I'm looking for a library that is as reliable and robust as possible. Preferable a library that can preserve bookmarks.

Ghostscript 可以连接保存书签的地方,但我遇到了麻烦在一种情况下未能生成任何 output.pdf.

Ghostscript can concat where the bookmarks are preserved, but I experienced trouble where it in one case failed to generate any output.pdf.

gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf document1.pdf document2.pdf document3.pdf
GPL Ghostscript 8.54: Unrecoverable error, exit code 1
GPL Ghostscript 8.54: ERROR: A pdfmark destination page 36 points beyond the last page 1.

我可以将相同的文件与 FPDI + TCPDF 成功合并,但是没有保留书签.

The same documents could I successfully merge with FPDI + TCPDF, however bookmarks wasn't preserved.

我担心选择了无法合并某些 PDF 的解决方案.您使用过哪些好的/坏的图书馆?

I'm worried choosing a solution that cannot merge some PDFs. What good/bad libraries do you have experience with?

推荐答案

我用过 pdftk合并多个 PDF 文件,我非常喜欢它,因为它易于使用.但是,我不确定它是否保留书签,抱歉.可以在主页上一目了然.如果有人知道,请告诉我.

I have used pdftk to merge multiple PDF files, and I liked it a lot as it is simple to use. However, I am not sure if it preserves bookmarks, sorry. Could find out at a glance on the home page. If anyone knows, let me know.

这篇关于使用 PHP/linux 将文件合并为单个 PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆