Merging Documents
The PDF Document Processor can merge multiple PDF documents into a single PDF file.
This task can be achieved by creating a target document at the beginning of the merging process, and adding source documents to the target document one-by-one.
Note
The source documents are added to the end of a target document.
The PDF Document Processor keeps original document content while merging documents.
To create a target document with no pages, create an instance of the PdfDocumentProcessor object and call one of the PdfDocumentProcessor.CreateEmptyDocument overloaded methods (e.g., using a file path).
To add a source document to the target document, call one of the PdfDocumentProcessor.AppendDocument overloaded methods.
Example
This example illustrates how to use PDF Document Processor for merging pages of two separate PDF files into a single PDF file.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-merge-documents-into-a-single-pdf-t114298
Imports DevExpress.Pdf
Namespace PdfMergeExample
Friend Class Program
Shared Sub Main(ByVal args() As String)
Using pdfDocumentProcessor As New PdfDocumentProcessor()
pdfDocumentProcessor.CreateEmptyDocument("..\..\docs\Merged.pdf")
pdfDocumentProcessor.AppendDocument("..\..\docs\TextMerge1.pdf")
pdfDocumentProcessor.AppendDocument("..\..\docs\TextMerge2.pdf")
End Using
End Sub
End Class
End Namespace