MergeDocument
Represents a document that can merge and append other documents.
public class MergeDocument : Document
Public Class MergeDocument
Inherits Document
Inheritance: ObjectDocumentMergeDocument
Licensing Info
Basic usage of this class is a DynamicPDF Core Suite Essentials feature. However, some properties or methods require full licensing and are noted accordingly. One of the following is required for non-evaluation usage:
- Any active DynamicPDF Subscription (Essentials, Professional, Professional Plus or Ultimate).
- A DynamicPDF Core Suite for .NET v12.X Essentials license.
- It can also be used for free with a public link back to www.dynamicpdf.com and with the DynamicPDF Essentials message displaying on the bottom of each page.
Examples
The following example will first merge two entire PDF documents together, then will Append a selected page of a third PDF to the end.Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.Merger
Module MyModule
Sub Main()
' Create two PDF document objects
Dim MyPdfA As PdfDocument = New PdfDocument("C:\ImportPDFA.pdf")
Dim MyPdfB As PdfDocument = New PdfDocument("C:\ImportPDFB.pdf")
' Merge the two documents
Dim MyDocument As MergeDocument = MergeDocument.Merge(MyPdfA, MyPdfB)
' Append an additional document
Dim MyPdfC As PdfDocument = New PdfDocument("C:\MyDocumentC.pdf")
MyDocument.Append(MyPdfC, 2, 1)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF.Merger;
Public Class Example
{
public static void CreatePDF(string outputPath, string inputPathPdfA, string inputPathPdfB, string password, string inputPathPdfC, int startPage)
{
// Create two PDF document objects
PdfDocument pdfA = new PdfDocument(inputPathPdfA);
// The owner's password is required to merge encrypted PDFs
PdfDocument pdfB = new PdfDocument(inputPathPdfB, password);
// Merge the two documents
MergeDocument document = MergeDocument.Merge(pdfA, pdfB);
// Append an additional document
PdfDocument pdfC = new PdfDocument(inputPathPdfC);
document.Append(pdfC, startPage, 1);
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This is the primary class used to merge or append entire PDF documents or certain pages from existing documents. The merge document can be output to any object derived from the Stream class that supports writing and can easily be integrated with ASP.NET to stream the document to Internet Information Server's HTTP output stream.
Constructors
MergeDocument() | Initializes a new instance of the MergeDocument class. |
MergeDocument(Byte[], [Optional] Int32, [Optional] Int32, [Optional] MergeOptions) | Initializes a new instance of the MergeDocument class. |
MergeDocument(PdfDocument) | Initializes a new instance of the MergeDocument class. |
MergeDocument(PdfDocument, Int32, Int32) | Initializes a new instance of the MergeDocument class. |
MergeDocument(PdfDocument, Int32, Int32, MergeOptions) | Initializes a new instance of the MergeDocument class. |
MergeDocument(PdfDocument, MergeOptions) | Initializes a new instance of the MergeDocument class. |
MergeDocument(String) | Initializes a new instance of the MergeDocument class. |
MergeDocument(String, Int32, Int32) | Initializes a new instance of the MergeDocument class. |
MergeDocument(String, Int32, Int32, MergeOptions) | Initializes a new instance of the MergeDocument class. |
MergeDocument(String, MergeOptions) | Initializes a new instance of the MergeDocument class. |
Properties
Author | Gets or sets a value indicating the author of the Document . (Inherited from Document) |
CompressionLevel | Gets or sets a value indicating the compression level of the Document . (Inherited from Document) |
Creator | Gets or sets a value indicating the creator of the Document . (Inherited from Document) |
CustomProperties | Gets or sets a value indicating the custom properties of the Document . (Inherited from Document) |
DiskBuffering | Gets or sets the disk buffering options for the PDF document. (Inherited from Document) |
EmbeddedFiles | Gets an EmbeddedFileList containing the EmbeddedFile for the document. (Inherited from Document) |
Form | Gets or sets a form object for the PDF document. (Inherited from Document) |
InitialPage | Gets or sets a value indicating the initial page of the Document . |
InitialPageLayout | Gets or sets a value indicating the initial layout of the Document . (Inherited from Document) |
InitialPageMode | Gets or sets a value indicating the initial page mode of the Document . (Inherited from Document) |
InitialPageZoom | Gets or sets a value indicating the initial zoom of the Document . |
InitialPageZoomPercentage | Gets or sets initial page zoom percentage. (Inherited from Document) |
JavaScripts | Gets a DocumentJavaScriptList containing the JavaScript entries for that document. (Inherited from Document) |
Keywords | Gets or sets a value indicating the keywords of the Document . (Inherited from Document) |
Language | Gets or sets a value indicating the language of the Document . (Inherited from Document) |
Optimization | Gets or sets the document optimization. (Inherited from Document) |
Outlines | Gets an OutlineList object that represents the top level outlines of the Document . (Inherited from Document) |
OutputIntents | Gets the output intent list for the Document . (Inherited from Document) |
Package | Gets or sets the document package. (Inherited from Document) |
Pages | Gets a PageList object that represents the pages of the Document . (Inherited from Document) |
PdfFormat | Gets or sets the PDF format for the PDF document. (Inherited from Document) |
PdfVersion | Gets or sets the PDF version of the PDF document. (Inherited from Document) |
PdfXVersion | Gets or sets the PDF/X version for the Document . (Inherited from Document) |
Producer | Gets or sets a value indicating the producer of the Document . (Inherited from Document) |
ReaderEvents | Gets the reader events of the document. (Inherited from Document) |
Sections | Gets a SectionList object for the Document . (Inherited from Document) |
Security | Gets or sets an object to control the security and encryption of the Document . (Inherited from Document) |
StampTemplate | Gets or sets a Template object for the Document . All page elements within this Template will appear in the foreground of the other contents of the PDF. (Inherited from Document) |
Subject | Gets or sets a value indicating the subject of the Document . (Inherited from Document) |
Tag | Gets or sets a value indicating whether document is tagged. (Inherited from Document) |
Template | Gets or sets a Template object for the Document . All page elements within this Template will appear in the background of the other contents of the PDF. (Inherited from Document) |
Title | Gets or sets a value indicating the title of the Document . (Inherited from Document) |
Trapped | Gets or sets a value indicating if trapping information is present in the Document . (Inherited from Document) |
ViewerPreferences | Gets a ViewerPreferences object that represents the viewer preferences of the Document . (Inherited from Document) |
XmpMetadata | Gets or sets the Xmp metadata for the PDF document. |
Methods
Append(Byte[], [Optional] Int32, [Optional] Int32, [Optional] MergeOptions) | Appends a PDF document to the current document. |
Append(PdfDocument) | Appends a PDF document to the current document. |
Append(PdfDocument, Int32, Int32) | Appends a PDF document to the current document. |
Append(PdfDocument, Int32, Int32, MergeOptions) | Appends a PDF document to the current document. |
Append(PdfDocument, MergeOptions) | Appends a PDF document to the current document. |
Append(String) | Appends a PDF document to the current document. |
Append(String, Int32, Int32) | Appends a PDF document to the current document. |
Append(String, Int32, Int32, MergeOptions) | Appends a PDF document to the current document. |
Append(String, MergeOptions) | Appends a PDF document to the current document. |
Certify(String, Certificate, Boolean, CertifyingPermission) | Certifies with signing and Time stamping the document digitally. (Inherited from Document) |
Certify(String, Certificate, CertifyingPermission) | Certifies with signing the document digitally. (Inherited from Document) |
Certify(String, Certificate, TimestampServer, CertifyingPermission) | Certifies with signing and Time stamping the document digitally. (Inherited from Document) |
Certify(String, SigningProvider, CertifyingPermission) | Certifies with signing and Time stamping the document digitally. (Inherited from Document) |
Draw() | Outputs the generated Document to a byte array. (Inherited from Document) |
Draw(Stream) | Outputs the generated Document to the given Stream object. (Inherited from Document) |
Draw(String) | Outputs the generated Document to a file. (Inherited from Document) |
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
Merge(Byte[], Byte[], [Optional] MergeOptions, [Optional] MergeOptions) | Merges two PDF documents together. |
Merge(PdfDocument, MergeOptions, PdfDocument, MergeOptions) | Merges two PDF documents together. |
Merge(PdfDocument, PdfDocument) | Merges two PDF documents together. |
Merge(String, MergeOptions, String, MergeOptions) | Merges two PDF documents together. |
Merge(String, String) | Merges two PDF documents together. |
Sign(String, Certificate) | Sign this document digitally. (Inherited from Document) |
Sign(String, Certificate, Boolean) | Digitally sign this document with Time stamping. (Inherited from Document) |
Sign(String, Certificate, TimestampServer) | Digitally sign this document with Time stamping. (Inherited from Document) |
Sign(String, SigningProvider) | Digitally sign this document with SigningProvider. (Inherited from Document) |
Timestamp(String, SigningProvider) | Marks the document to add a timestamp to the existing signature filed. (Inherited from Document) |
Timestamp(String, TimestampServer) | Marks the document to add a timestamp to the existing signature filed. (Inherited from Document) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |