Skip to main content

PdfDocument

Version: 6.0

cete.dynamicpdf.merger.pdfdocument

PdfDocument​

Represents a PDF document for import.

public class PdfDocument
Public Class PdfDocument

Inheritance: Object → PdfDocument

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

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;
using ceTe.DynamicPDF.Merger;

class MyClass
{static void Main(){ // Create two PDF document objects PdfDocument pdfA = new PdfDocument( @"C:\ImportPDF.pdf" ); // The owner's password is required to merge encrypted PDFs PdfDocument pdfB = new PdfDocument( @"C:\EncryptedPDF.pdf", "owner" );
// Merge the two documents MergeDocument document = MergeDocument.Merge( pdfA, pdfB )
// Append an additional document PdfDocument pdfC = new PdfDocument( @"C:\MyDocumentC.pdf" ); document.Append( pdfC, 2, 1);
// Save the PDF document.Draw( @"C:\MyDocument.pdf" );}
}

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.

public PdfDocument(Byte[] data)
Public Sub New (data As Byte())

Parameters​

A byte array containing the PDF document data.

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Exceptions​

The PDF file cannot be parsed because it is likely corrupt or invalid.

The PDF file cannot be read because it is encrypted and the owner password is incorrect or not supplied.

PdfDocument(Byte[], String)​

Initializes a new instance of the PdfDocument class.

public PdfDocument(Byte[] data, string password)
Public Sub New (data As Byte(), password As String)

Parameters​

A byte array containing the PDF document data.

Owner password of the encrypted PDF document.

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Exceptions​

The PDF file cannot be parsed because it is likely corrupt or invalid.

The PDF file cannot be read because it is encrypted and the owner password is incorrect or not supplied.

PdfDocument(Stream)​

Initializes a new instance of the PdfDocument class.

public PdfDocument(Stream stream)
Public Sub New (stream As Stream)

Parameters​

Stream object containing the PDF document data.

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Exceptions​

The PDF file cannot be parsed because it is likely corrupt or invalid.

The PDF file cannot be read because it is encrypted and the owner password is incorrect or not supplied.

PdfDocument(Stream, String)​

Initializes a new instance of the PdfDocument class.

public PdfDocument(Stream stream, string password)
Public Sub New (stream As Stream, password As String)

Parameters​

Stream object containing the PDF document data.

Owner password of the encrypted PDF document.

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Exceptions​

The PDF file cannot be parsed because it is likely corrupt or invalid.

The PDF file cannot be read because it is encrypted and the owner password is incorrect or not supplied.

PdfDocument(String)​

Initializes a new instance of the PdfDocument class.

public PdfDocument(string filePath)
Public Sub New (filePath As String)

Parameters​

Physical file path of the PDF document.

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Exceptions​

The PDF file cannot be parsed because it is likely corrupt or invalid.

The PDF file cannot be read because it is encrypted and the owner password is incorrect or not supplied.

PdfDocument(String, String)​

Initializes a new instance of the PdfDocument class.

public PdfDocument(string filePath, string password)
Public Sub New (filePath As String, password As String)

Parameters​

Physical file path of the PDF document.

Owner password of the encrypted PDF document.

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Exceptions​

The PDF file cannot be parsed because it is likely corrupt or invalid.

The PDF file cannot be read because it is encrypted and the owner password is incorrect or not supplied.

Properties​

Author​

Gets the author property of the PDF document.

public string Author { get; }
Public Property Author As String

Property Value​

String

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Creator​

Gets the creator property of the PDF document.

public string Creator { get; }
Public Property Creator As String

Property Value​

String

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Form​

Gets the AcroForm for the document.

public PdfForm Form { get; }
Public Property Form As PdfForm

Property Value​

PdfForm

Licensing​

This class is a DynamicPDF Merger Professional Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Keywords​

Gets the keywords property of the PDF document.

public string Keywords { get; }
Public Property Keywords As String

Property Value​

String

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

NeedsRendering​

Get the Needs Rendering property of the PDF document.

public bool NeedsRendering { get; }
Public Property NeedsRendering As Boolean

Property Value​

Boolean

Outlines​

Gets the outlines of the PDF document.

public PdfOutlineList Outlines { get; }
Public Property Outlines As PdfOutlineList

Property Value​

PdfOutlineList

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Pages​

Gets a collection of PDF pages for the document.

public PdfPageList Pages { get; }
Public Property Pages As PdfPageList

Property Value​

PdfPageList

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Producer​

Gets the producer property of the PDF document.

public string Producer { get; }
Public Property Producer As String

Property Value​

String

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Subject​

Gets the subject property of the PDF document.

public string Subject { get; }
Public Property Subject As String

Property Value​

String

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Tagged​

Gets the Taging property of the PDF document.

public bool Tagged { get; }
Public Property Tagged As Boolean

Property Value​

Boolean

Title​

Gets the title property of the PDF document.

public string Title { get; }
Public Property Title As String

Property Value​

String

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Methods​

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

GetPage(Int32)​

Gets a page by page number.

public PdfPage GetPage(int pageNumber)
Function GetPage(pageNumber As Integer) As PdfPage

Parameters​

The page number to retrieve.

Returns​

A PdfPage object.

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Remarks​

The first page is 1.

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

SetDocumentInfo(Document)​

Sets the document info on the supplied Document to match this document.

public void SetDocumentInfo(Document document)
Sub SetDocumentInfo(document As Document)

Parameters​

A document to set.

Licensing​

This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Merger for .NET Standard Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

See Also​

ceTe.DynamicPDF.Merger