Skip to main content

Merge PDF Documents

The PDF Document API component allows you to merge multiple PDF documents.

Use API from the table below to complete the task.


You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use these examples in production code.

API Description
PdfDocumentProcessor.CreateEmptyDocument Creates an empty document. You can specify a file path or a stream to pass the document. The document’s content is not kept in memory during the merge.
PdfDocumentProcessor.AppendDocument Appends the content of one document to another. All additional content (interactive forms, bookmarks,hyperlinks, file attachments, etc.) is copied to the resulting file. The original document’s content is retained.

When the merge is completed, you don’t need to save this document since it is written during the process. Dispose of the PdfDocumentProcessor instance to close the document.

This example illustrates how to use the PDF Document API component to merge pages of two separate PDF documents into a single PDF document.

View Example

using DevExpress.Pdf;

using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor()) {