在C ++中合并两个PDF文件 [英] Combining two PDF files in C++

查看:339
本文介绍了在C ++中合并两个PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C ++中,我正在使用 libHaru 生成PDF报告.我正在寻找将现有PDF文件中的两页附加到报告末尾的方法.有没有免费的方法可以做到这一点?

谢谢.

解决方案

尝试PoDoFo

http://podofo.sourceforge.net/

您应该能够使用PDFMemDocument.Load( filename )将两个PDFs作为PDFMemDocuments打开.

然后,获取对要复制的两个页面的引用,并使用InsertPages添加到文档的末尾,或者选择删除源文档中除最后两页以外的所有页面,然后调用PDFDocument. /p>

附加并传递被调用的文档.很难说哪个更快或更稳定.

希望有帮助, 特洛伊

In C++ I'm generating a PDF report with libHaru. I'm looking for someway to append two pages from an existing PDF file to the end of my report. Is there any free way to do that?

Thanks.

解决方案

Try PoDoFo

http://podofo.sourceforge.net/

You should be able to open both of the PDFs as PDFMemDocuments using PDFMemDocument.Load( filename ).

Then, acquire references to the two pages you want to copy and add to the end of the document using InsertPages, or optionally, remove all but the last two pages of the source document, then call PDFDocument.

Append and pass the called document. Hard to say which would be faster or more stable.

Hope that helps, Troy

这篇关于在C ++中合并两个PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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