Skip to main content

PdfDocument

Version: 2.0

cete.dynamicpdf.viewer.pdfdocument

PdfDocument​

  • Namespace: ceTe.DynamicPDF.Viewer
  • Assemblies: ceTe.DynamicPDF.Viewer.40.x64.dll, ceTe.DynamicPDF.Viewer.40.x86.dll

Represents a Pdf document.

public class PdfDocument : IDisposable
Public Class PdfDocument
Implements IDisposable

Inheritance: Object → PdfDocument

Implements: IDisposable

Licensing​

This class is a DynamicPDF Viewer feature. The following license is required for non-evaluation usage:

  • DynamicPDF Viewer for .NET

Examples​

This example demonstrates how to load a PDF file in PdfViewer control using PdfDocument .

Imports System
Imports System.Windows.Forms
Imports ceTe.DynamicPDF.Viewer

Public Class Form1
Inherits System.Windows.Forms.Form

Private MyPdfViewer As PdfViewer

Sub New()
InitializeComponent()
End Sub

Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
End Sub

Shared Sub Main()
Application.Run(New Form1())
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
' Load and Open the document in Viewer.
Dim MyDocument As New PdfDocument("C:\MyDocument.pdf")
MyPdfViewer.Open(MyDocument)
End Sub

End Class
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;

namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private ceTe.DynamicPDF.Viewer.PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
this.Load += new EventHandler(Form1_Load);
}

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void Form1_Load(object sender, EventArgs e)
{
// Load and Open the document in Viewer.
PdfDocument document = new PdfDocument(@"C:\MyDocument.pdf");
pdfViewer.Open(document);
}
}
}

Constructors​

PdfDocument(Byte[])​

Initializes a new instance of the PdfDocument class.

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

Parameters​

Byte array of the input PDF data.

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​

Byte array of the input PDF data.

Password to open the PDF file.

PdfDocument(Stream)​

Initializes a new instance of the PdfDocument class.

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

Parameters​

Stream containing the PDF data.

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 containing the PDF data.

Password to open the PDF file.

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.

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.

Password to open the PDF file.

Properties​

Author​

Gets the author property of the PDF document.

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

Property Value​

String

Bookmarks​

Gets the collection of bookmarks present in the PDF document.

public BookmarkList Bookmarks { get; }
Public Property Bookmarks As BookmarkList

Property Value​

BookmarkList

Creator​

Gets the creator property of the PDF document.

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

Property Value​

String

InitialPage​

Gets the initial page to be displayed.

public Nullable&ltint> InitialPage { get; }
Public Property InitialPage As Nullable(Of Integer)

Property Value​

Nullable&ltint>

Keywords​

Gets the keywords property of the PDF document.

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

Property Value​

String

PageCount​

Gets the page count PDF document.

public int PageCount { get; }
Public Property PageCount As Int32

Property Value​

Int32

PageMode​

Gets the initial page mode of the document.

public Nullable&ltPageDisplayMode> PageMode { get; }
Public Property PageMode As Nullable(Of PageDisplayMode)

Property Value​

Nullable&ltPageDisplayMode>

Permissions​

Gets the Permission information of the document.

public Permission Permissions { get; }
Public Property Permissions As Permission

Property Value​

Permission

Producer​

Gets the producer property of the PDF document.

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

Property Value​

String

Subject​

Gets the subject property of the PDF document.

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

Property Value​

String

Title​

Gets the title property of the PDF document.

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

Property Value​

String

VisibleNavigationPane​

Gets the initial navigation pane of the document.

public Nullable&ltNavigationPane> VisibleNavigationPane { get; }
Public Property VisibleNavigationPane As Nullable(Of NavigationPane)

Property Value​

Nullable&ltNavigationPane>

ZoomMode​

Gets the initial zoom mode of the document.

public Nullable&ltZoom> ZoomMode { get; }
Public Property ZoomMode As Nullable(Of Zoom)

Property Value​

Nullable&ltZoom>

Methods​

Dispose()​

Releases all resources used by the document.

public void Dispose()
Sub Dispose()

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 the PdfPage which contains page details like width and height.

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

Parameters​

Page number of the PdfPage required.

Returns​

PdfPage related to the respective page number.

Remarks​

Page number starting from one.

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.

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.Viewer