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
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
- data: Byte[]
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
- data: Byte[]
Byte array of the input PDF data.
- password: String
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: Stream
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: Stream
Stream containing the PDF data.
- password: String
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
- filePath: String
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
- filePath: String
Physical file path of the PDF.
- password: String
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
Bookmarks
Gets the collection of bookmarks present in the PDF document.
public BookmarkList Bookmarks { get; }
Public Property Bookmarks As BookmarkList
Property Value
Creator
Gets the creator property of the PDF document.
public string Creator { get; }
Public Property Creator As String
Property Value
InitialPage
Gets the initial page to be displayed.
public Nullable<int> InitialPage { get; }
Public Property InitialPage As Nullable(Of Integer)
Property Value
Keywords
Gets the keywords property of the PDF document.
public string Keywords { get; }
Public Property Keywords As String
Property Value
PageCount
Gets the page count PDF document.
public int PageCount { get; }
Public Property PageCount As Int32
Property Value
PageMode
Gets the initial page mode of the document.
public Nullable<PageDisplayMode> PageMode { get; }
Public Property PageMode As Nullable(Of PageDisplayMode)
Property Value
Permissions
Gets the Permission information of the document.
public Permission Permissions { get; }
Public Property Permissions As Permission
Property Value
Producer
Gets the producer property of the PDF document.
public string Producer { get; }
Public Property Producer As String
Property Value
Subject
Gets the subject property of the PDF document.
public string Subject { get; }
Public Property Subject As String
Property Value
Title
Gets the title property of the PDF document.
public string Title { get; }
Public Property Title As String
Property Value
VisibleNavigationPane
Gets the initial navigation pane of the document.
public Nullable<NavigationPane> VisibleNavigationPane { get; }
Public Property VisibleNavigationPane As Nullable(Of NavigationPane)
Property Value
ZoomMode
Gets the initial zoom mode of the document.
public Nullable<Zoom> ZoomMode { get; }
Public Property ZoomMode As Nullable(Of Zoom)
Property Value
Methods
Dispose()
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
- obj: Object
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
- pageNumber: Int32
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 .