[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Expand]Spreadsheet Document API
 [Expand]Word Processing Document API
 [Collapse]PDF Document API
   Getting Started
   Coordinate Systems
   Document Generation
  [Expand]PDF Graphics
  [Collapse]Document Manipulation
    Merging Documents
    Page Manipulation
  [Expand]Additional Content
  [Expand]Interactive Forms
  [Expand]Text Markup Annotations
  [Expand]Document Security
  [Expand]Examples
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Expand]API Reference
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Merging Documents

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

Before merging, create a document with no pages.

To create this document, create a PdfDocumentProcessor object instance and call the overloaded PdfDocumentProcessor.CreateEmptyDocument method (for example, via a file path).

This method saves the merge result on a local disk to decrease memory consumption when merging documents. This means the document's content is not kept in memory during the merging.

Note

The PDF Document API component retains the original document's content while merging documents.

To add a required document to the resulting document, call an overloaded PdfDocumentProcessor.AppendDocument method.

When the merge is completed, close the resulting document by disposing of the PdfDocumentProcessor instance.

Note that you do not need to save this document since it is written during the merging.

Example

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

Is this topic helpful?​​​​​​​