Is there a straight forward way to append one PDF doc to another using iTextSharp?

后端 未结 4 818
粉色の甜心
粉色の甜心 2021-02-06 04:39

I\'ve scoured the Web looking for examples on how to do this. I\'ve found a few that seem to be a little more involved then they need to be. So my question is, using iTextShar

4条回答
  •  青春惊慌失措
    2021-02-06 05:27

    I don't know how to do it for PDF files, but for postscript, you just concatenate the files. If you have pdf2ps and ps2pdf installed, the below will do the job:

    pdf2ps file1.pdf file1.ps
    pdf2ps file2.pdf file2.ps
    cat file1.ps file2.ps > combined.ps
    ps2pdf combined.ps combined.pdf
    

    I'm not an expert on pdf2ps or ps2pdf. I've only ever used ps2pdf, and when I do so, it leaves text as text (I can still select and copy text from the resulting pdf). When I do the above steps (pdf->ps, combine, ps->pdf) I end up with a resulting pdf that is like an image. No idea why.

提交回复
热议问题