Merging Overview
Merging existing PDFs and appending existing PDFs to documents currently in memory are common tasks when using DynamicPDF Core Suite. The following pages cover each topic in more detail. Also, a brief summary of the classes used to merge is provided below.
Topic | Class Discussed | Description |
---|---|---|
Merging Documents | MergeDocument | Illustrates merging two existing PDFs and appending a PDF to a document in memory. |
Merge Options | MergeOptions | Discusses the options available to customize the results when merging. |
Adding new Content | MergeDocument, Document, Page | Discusses adding new content and new pages to a document. |
Importing Pages | ImportPage | Illustrates importing a page from an existing document and then adding page elements to it. |
Placing Imported Pages | ImportPageArea, ImportedPageData | Illustrates rotating, scaling, clipping, and placing page elements on a Page or ImportedPage. |
Merge Optimizations | PdfDocument, MergeDocument, ImportedPage, ImportedPageData | Discusses several ways to optimize document creation while merging. |
Merging PDFs and working with existing PDFs use the following classes.
All four classes are children of the Document class. For more details on each class, refer to the following documentation pages.
The PdfDocument and PdfPage are read-only and are not children of the Document class.
MergeDocument
The MergeDocument is inherited from the Document class and merges PDF documents into a combined document. This class also supports appending to a PDF document and adding pages to a PDF document.
ImportedPage
The ImportedPage class inherits from the Page class and retrieves and adds a single page to a document. The page can then be used as-is or have page elements added to the page that appear over the top of the original page.
ImportedPageArea
The ImportedPageArea inherits from the PageElement class and places data from an imported PDF document onto a page. This data can then be scaled, rotated, and clipped. The data can also be used to place multiple imported pages onto a single page.
ImportedPageData
The ImportedPageData inherits from the PageElement class and is used for placing data from an imported PDF document onto a page. This data can be scaled, rotated, and clipped. It can also set multiple imported pages onto a single page. This page element defaults to the center of the page and can be offset.