【只争朝夕】

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

https://github.com/qpdf

 

需要引用头文件:

#include "qpdf\QPDF.hh"
#include "qpdf/QPDFWriter.hh"
#include "qpdf/QUtil.hh"

 

    QPDF outpdf;
    outpdf.emptyPDF();

    QPDF inpdfa;
    inpdfa.processFile("D:\\aaaa.tmp");
    std::vector<QPDFObjectHandle> apages=inpdfa.getAllPages();
    for (std::vector<QPDFObjectHandle>::iterator iter = apages.begin();
        iter != apages.end(); ++iter)
        outpdf.addPage(*iter, false);

    QPDF inpdfb;
    inpdfb.processFile("D:\\bbbb.tmp");
    std::vector<QPDFObjectHandle> bpages = inpdfb.getAllPages();
    for (std::vector<QPDFObjectHandle>::iterator iter = bpages.begin();
        iter != bpages.end(); ++iter)
        outpdf.addPage(*iter, false);

    QPDFWriter outpdfw(outpdf, "D:\\cccc.pdf");
    outpdfw.write();

 

posted on 2020-12-17 16:07  【只争朝夕】  阅读(1268)  评论(0编辑  收藏  举报