To merge PDF pages in C#, we can use the PdfSharp library. Here is an example of how to do it:
main.cs774 chars28 lines
In this example, we first define an array of PDF paths to merge. We then create a new PdfDocument
object to store the merged pages. We loop through each PDF document and open it using the PdfReader
class. We then loop through each page in the input document and add it to the output document using the AddPage()
method. Finally, we close the input document and save the output document to a file named "merged.pdf".
gistlibby LogSnag