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:
- 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 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
Author | Gets the author property of the PDF document. |
CollectionType | Gets a value indicating the collectionType of a Pdf document |
Creator | Gets the creator property of the PDF document. |
CustomProperties | Gets the custom properties of the PDF document. |
Form | Gets the AcroForm for the document. |
Keywords | Gets the keywords property of the PDF document. |
NeedsRendering | Get the Needs Rendering property of the PDF document. |
Outlines | Gets the outlines of the PDF document. |
Pages | Gets a collection of PDF pages for the document. |
Producer | Gets the producer property of the PDF document. |
SecurityInfo | Gets the security type of the PDF document. |
Signed | Gets the signed property of the PDF document (only available in version 10.27+). |
Subject | Gets the subject property of the PDF document. |
Tagged | Gets the Taging property of the PDF document. |
Title | Gets the title property of the PDF document. |
XmpMetadata | Gets 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) |