PdfDocument

Represents a PDF document for import.

public class PdfDocument
Public Class PdfDocument

Inheritance: ObjectPdfDocument

Licensing Info

This class is a DynamicPDF Core Suite Essentials feature. 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 pdfA As PdfDocument = New PdfDocument("C:\ImportPDF.pdf")
        ' The owner's password is required to merge encrypted PDFs
        Dim pdfB As PdfDocument = New PdfDocument("C:\EncryptedPDF.pdf", "owner")
     
        ' Merge the two documents
        Dim MyDocument As MergeDocument = MergeDocument.Merge(pdfA, pdfB)
     
        ' Append an additional document
        Dim pdfC As PdfDocument = New PdfDocument("C:\MyDocumentC.pdf")
        MyDocument.Append(pdfC, 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 class should be used when you will be referencing an existing PDF document more than once. Using a PDFDocument is more efficient than specifying a file path because the document will not need to be parsed again on each subsequent reference. This class is safe for multithreaded operations.

Constructors

PdfDocument(Byte[])Initializes a new instance of the PdfDocument class.
PdfDocument(Byte[], String)Initializes a new instance of the PdfDocument class.
PdfDocument(Stream)Initializes a new instance of the PdfDocument class.
PdfDocument(Stream, String)Initializes a new instance of the PdfDocument class.
PdfDocument(String)Initializes a new instance of the PdfDocument class.
PdfDocument(String, String)Initializes a new instance of the PdfDocument class.

Properties

AuthorGets the author property of the PDF document.
CollectionTypeGets a value indicating the collectionType of a Pdf document
CreatorGets the creator property of the PDF document.
CustomPropertiesGets the custom properties of the PDF document.
FormGets the AcroForm for the document.
KeywordsGets the keywords property of the PDF document.
NeedsRenderingGet the Needs Rendering property of the PDF document.
OutlinesGets the outlines of the PDF document.
PagesGets a collection of PDF pages for the document.
ProducerGets the producer property of the PDF document.
SecurityInfoGets the security type of the PDF document.
SignedGets the signed property of the PDF document (only available in version 10.27+).
SubjectGets the subject property of the PDF document.
TaggedGets the Taging property of the PDF document.
TitleGets the title property of the PDF document.
XmpMetadataGets the xml metadata string.

Methods

Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
Get3DImages()Returns an array of ImageInformation3D objects of all the 3D images present in the document.
GetAttachments()Retrieves the attachment files in the PDF document.
GetCreationDate()Gets the creation date of the PDF document.
GetEncryptionInfo(Byte[])Gets the security information of the given PDF document.
GetEncryptionInfo(String)Gets the security information of the given PDF document.
GetFonts()Gets the informaton of all the fonts present in a document.
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetImages()Returns an array of ImageInformation objects of all the images present in the document.
GetModifiedDate()Gets the modified date of the PDF document.
GetPage(Int32)Gets a page by page number.
GetSecurityStore()Gets the Document Security Store (DSS) of the Pdf document.
GetSignedSignatureFields()Gets the list of PdfSignatureField that are present in the document.
GetText()Gets the text in all the pages.
GetText(TextExtractionOrder)Gets the text in all the pages.
GetType()Gets the Type of the current instance.
(Inherited from Object)
GetXfaInfo()Gets the type of XFA in the given PDF document.
SetDocumentInfo(Document)Sets the document info on the supplied Document to match this document.
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF.Merger

In this topic