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:

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

AuthorGets or sets a value indicating the author of the Document .
(Inherited from Document)
CompressionLevelGets or sets a value indicating the compression level of the Document .
(Inherited from Document)
CreatorGets or sets a value indicating the creator of the Document .
(Inherited from Document)
CustomPropertiesGets or sets a value indicating the custom properties of the Document .
(Inherited from Document)
DiskBufferingGets or sets the disk buffering options for the PDF document.
(Inherited from Document)
EmbeddedFilesGets an EmbeddedFileList containing the EmbeddedFile for the document.
(Inherited from Document)
FormGets or sets a form object for the PDF document.
(Inherited from Document)
InitialPageGets or sets a value indicating the initial page of the Document .
InitialPageLayoutGets or sets a value indicating the initial layout of the Document .
(Inherited from Document)
InitialPageModeGets or sets a value indicating the initial page mode of the Document .
(Inherited from Document)
InitialPageZoomGets or sets a value indicating the initial zoom of the Document .
InitialPageZoomPercentageGets or sets initial page zoom percentage.
(Inherited from Document)
JavaScriptsGets a DocumentJavaScriptList containing the JavaScript entries for that document.
(Inherited from Document)
KeywordsGets or sets a value indicating the keywords of the Document .
(Inherited from Document)
LanguageGets or sets a value indicating the language of the Document .
(Inherited from Document)
OptimizationGets or sets the document optimization.
(Inherited from Document)
OutlinesGets an OutlineList object that represents the top level outlines of the Document .
(Inherited from Document)
OutputIntentsGets the output intent list for the Document .
(Inherited from Document)
PackageGets or sets the document package.
(Inherited from Document)
PagesGets a PageList object that represents the pages of the Document .
(Inherited from Document)
PdfFormatGets or sets the PDF format for the PDF document.
(Inherited from Document)
PdfVersionGets or sets the PDF version of the PDF document.
(Inherited from Document)
PdfXVersionGets or sets the PDF/X version for the Document .
(Inherited from Document)
ProducerGets or sets a value indicating the producer of the Document .
(Inherited from Document)
ReaderEventsGets the reader events of the document.
(Inherited from Document)
SectionsGets a SectionList object for the Document .
(Inherited from Document)
SecurityGets or sets an object to control the security and encryption of the Document .
(Inherited from Document)
StampTemplateGets 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)
SubjectGets or sets a value indicating the subject of the Document .
(Inherited from Document)
TagGets or sets a value indicating whether document is tagged.
(Inherited from Document)
TemplateGets 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)
TitleGets or sets a value indicating the title of the Document .
(Inherited from Document)
TrappedGets or sets a value indicating if trapping information is present in the Document .
(Inherited from Document)
ViewerPreferencesGets a ViewerPreferences object that represents the viewer preferences of the Document .
(Inherited from Document)
XmpMetadataGets 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)

See Also

ceTe.DynamicPDF.Merger

In this topic