简体   繁体   中英

c# PDF file concatenation

Does anyone know of a good way to load PDF files from an external resource and contatenate them together to produce a single PDF document.

Is there some component you can receomend?

我会用PDFSharp: http ://pdfsharp.com/PDFsharp/index.php?option = com_content&task = view&id = 52&Itemid = 45

This doesn't use C#, but the way I typically do this is to use ghostscript:

gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf in3.pdf ...

Basically, this prints out several pdfs in sequence, but redirects the output to a output pdf, effectively concatenating them.

Check out this explanation: http://ansuz.sooke.bc.ca/software/pdf-append.php

Disclaimer: I work at Atalasoft. Our DotImage Document Imaging SDK can do this. Here's a whitepaper with all of the code you need .

It's simply:

PdfDocument.Combine("FinalReport.pdf", "CoverSheet.pdf";,
                                   "Disclaimer.pdf", "Report.pdf");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM