wkhtmltopdf:是否可以合并PDF文件? [英] wkhtmltopdf: Is it possible to merge PDF files?
问题描述
使用该库 wkhtmltopdf ,可以合并2个pdf文件.我需要生成一个报告,并将该报告与一些附加文档合并.
Using this library wkhtmltopdf, is it possible to merge 2 pdf files. I need to generate a report and merge the report with some attached documents.
完成报告的生成,从HTML转换为PDF.但是我需要将生成的PDF与其他一些PDF合并
Generation of report is done, converting from HTML to PDF. But I need to merge the resulting PDF with some other PDFs
推荐答案
wkhtmltopdf
不支持合并PDF.您可以使用GhostScript
完成此操作.这是一个非常强大的工具,Linux用户经常使用.
wkhtmltopdf
doesn't provide support for merging PDF's. You can accomplish this using GhostScript
. It's a pretty powerful tool and frequently used by Linux users.
您可以使用以下命令:
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf
您可以尝试以下链接以进一步阅读:
You can try these links for further reading:
- GhostScript
- Merge PDF's using Ghostscript (Windows)
如果要在Linux上使用它,请参考
In case you want it for Linux refer
编辑:如@nenotelp所述,还有其他工具可用. @nentelp提到的部分与书签的处理有关,这对于iText
或iTextSharp
来说更好.如果这是您的要求,您当然可以选择其他工具.
As stated by @nenotelp there are other tools available as well. The part that @nentelp mentioned is regarding the handling of bookmarks which is better with iText
or iTextSharp
. If this is your requirement you can certainly opt for other tools.
P.S. -Google Ghostscript.您会发现大量参考文献.
P.S. - Google Ghostscript. You will find tons of references.
这篇关于wkhtmltopdf:是否可以合并PDF文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!