Skip to main content

PdfViewer

Version: 2.0

cete.dynamicpdf.viewer.pdfviewer

PdfViewer​

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

Represents the PdfViewer control.

public class PdfViewer : Control, IBindableComponent, IComponent, IDisposable, IDropTarget, ISynchronizeInvoke, IWin32Window
Public Class PdfViewer
Inherits Control
Implements IBindableComponent, IComponent, IDisposable, IDropTarget, ISynchronizeInvoke, IWin32Window

Inheritance: Object → MarshalByRefObject → Component → Control → PdfViewer

Implements: IBindableComponent, IComponent, IDisposable, IDropTarget, ISynchronizeInvoke, IWin32Window

Licensing​

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

  • DynamicPDF Viewer for .NET

Examples​

This example shows, how to load a PDF document in PdfViewer .

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​

PdfViewer()​

Initializes a new instance of the PdfViewer class.

public PdfViewer()
Public Sub New ()

Properties​

AccessibilityObject​

Gets the AccessibleObject assigned to the control. (Inherited from Control)

public AccessibleObject AccessibilityObject { get; }
Public Property AccessibilityObject As AccessibleObject

Property Value​

AccessibleObject

AccessibleDefaultActionDescription​

Gets or sets the default action description of the control for use by accessibility client applications. (Inherited from Control)

public string AccessibleDefaultActionDescription { get; set; }
Public Property AccessibleDefaultActionDescription As String

Property Value​

String

AccessibleDescription​

Gets or sets the description of the control used by accessibility client applications. (Inherited from Control)

public string AccessibleDescription { get; set; }
Public Property AccessibleDescription As String

Property Value​

String

AccessibleName​

Gets or sets the name of the control used by accessibility client applications. (Inherited from Control)

public string AccessibleName { get; set; }
Public Property AccessibleName As String

Property Value​

String

AccessibleRole​

Gets or sets the accessible role of the control (Inherited from Control)

public AccessibleRole AccessibleRole { get; set; }
Public Property AccessibleRole As AccessibleRole

Property Value​

AccessibleRole

Exceptions​

The value assigned is not one of the AccessibleRole values.

AllowDrop​

Gets or sets a value indicating whether the control can accept data that the user drags onto it. (Inherited from Control)

public bool AllowDrop { get; set; }
Public Property AllowDrop As Boolean

Property Value​

Boolean

Anchor​

Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent. (Inherited from Control)

public AnchorStyles Anchor { get; set; }
Public Property Anchor As AnchorStyles

Property Value​

AnchorStyles

AutoScrollOffset​

Gets or sets where this control is scrolled to in ScrollControlIntoView(System.Windows.Forms.Control) . (Inherited from Control)

public Point AutoScrollOffset { get; set; }
Public Property AutoScrollOffset As Point

Property Value​

Point

BackColor​

Gets or sets the Back Color of the document.

public Color BackColor { get; set; }
Public Property BackColor As Color

Property Value​

Color

BindingContext​

Gets or sets the BindingContext for the control. (Inherited from Control)

public BindingContext BindingContext { get; set; }
Public Property BindingContext As BindingContext

Property Value​

BindingContext

Bottom​

Gets the distance, in pixels, between the bottom edge of the control and the top edge of its container's client area. (Inherited from Control)

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

Property Value​

Int32

Bounds​

Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control. (Inherited from Control)

public Rectangle Bounds { get; set; }
Public Property Bounds As Rectangle

Property Value​

Rectangle

CanFocus​

Gets a value indicating whether the control can receive focus. (Inherited from Control)

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

Property Value​

Boolean

CanSelect​

Gets a value indicating whether the control can be selected. (Inherited from Control)

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

Property Value​

Boolean

Capture​

Gets or sets a value indicating whether the control has captured the mouse. (Inherited from Control)

public bool Capture { get; set; }
Public Property Capture As Boolean

Property Value​

Boolean

CausesValidation​

Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation when it receives focus. (Inherited from Control)

public bool CausesValidation { get; set; }
Public Property CausesValidation As Boolean

Property Value​

Boolean

ClientRectangle​

Gets the rectangle that represents the client area of the control. (Inherited from Control)

public Rectangle ClientRectangle { get; }
Public Property ClientRectangle As Rectangle

Property Value​

Rectangle

ClientSize​

Gets or sets the height and width of the client area of the control. (Inherited from Control)

public Size ClientSize { get; set; }
Public Property ClientSize As Size

Property Value​

Size

CompanyName​

Gets the name of the company or creator of the application containing the control. (Inherited from Control)

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

Property Value​

String

Container​

Gets the IContainer that contains the Component . (Inherited from Component)

public IContainer Container { get; }
Public Property Container As IContainer

Property Value​

IContainer

ContainsFocus​

Gets a value indicating whether the control, or one of its child controls, currently has the input focus. (Inherited from Control)

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

Property Value​

Boolean

Controls​

Gets the collection of controls contained within the control. (Inherited from Control)

public ControlCollection Controls { get; }
Public Property Controls As ControlCollection

Property Value​

ControlCollection

Created​

Gets a value indicating whether the control has been created. (Inherited from Control)

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

Property Value​

Boolean

CursorMode​

Gets or sets the cursor mode for the document.

public CursorMode CursorMode { get; set; }
Public Property CursorMode As CursorMode

Property Value​

CursorMode

DataBindings​

Gets the data bindings for the control. (Inherited from Control)

public ControlBindingsCollection DataBindings { get; }
Public Property DataBindings As ControlBindingsCollection

Property Value​

ControlBindingsCollection

DeviceDpi​

Gets the DPI value for the display device where the control is currently being displayed. (Inherited from Control)

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

Property Value​

Int32

DisplayRectangle​

Gets the rectangle that represents the display area of the control. (Inherited from Control)

public Rectangle DisplayRectangle { get; }
Public Property DisplayRectangle As Rectangle

Property Value​

Rectangle

DisplayUnit​

Gets or sets the display unit.

public Units DisplayUnit { get; set; }
Public Property DisplayUnit As Units

Property Value​

Units

Remarks​

All the size information displayed by the control will be based on the units set on this property.For eg: Status Bar.

Disposing​

Gets a value indicating whether the base Control class is in the process of disposing. (Inherited from Control)

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

Property Value​

Boolean

Dock​

Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent. (Inherited from Control)

public DockStyle Dock { get; set; }
Public Property Dock As DockStyle

Property Value​

DockStyle

Exceptions​

The value assigned is not one of the DockStyle values.

Enabled​

Gets or sets a value indicating whether the control can respond to user interaction. (Inherited from Control)

public bool Enabled { get; set; }
Public Property Enabled As Boolean

Property Value​

Boolean

FilePath​

Gets the file path of the document on display.

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

Property Value​

String

Remarks​

The value will be null when the document on display is opened by passing PdfDocument to the Open method.

Focused​

Gets a value indicating whether the control has input focus. (Inherited from Control)

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

Property Value​

Boolean

Handle​

Gets the window handle that the control is bound to. (Inherited from Control)

public IntPtr Handle { get; }
Public Property Handle As IntPtr

Property Value​

IntPtr

HasChildren​

Gets a value indicating whether the control contains one or more child controls. (Inherited from Control)

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

Property Value​

Boolean

HasNextView​

Gets a boolean value to show if next view history contains any view or not.

public bool HasNextView { get; }
Public ReadOnly Property HasNextView As Boolean

Property Value​

Boolean

HasPreviousView​

Gets a boolean value to show if previous view history contains any view or not.

public bool HasPreviousView { get; }
Public ReadOnly Property HasPreviousView As Boolean

Property Value​

Boolean

Height​

Gets or sets the height of the control. (Inherited from Control)

public int Height { get; set; }
Public Property Height As Int32

Property Value​

Int32

ImeMode​

Gets or sets the Input Method Editor (IME) mode of the control. (Inherited from Control)

public ImeMode ImeMode { get; set; }
Public Property ImeMode As ImeMode

Property Value​

ImeMode

Exceptions​

The assigned value is not one of the ImeMode enumeration values.

InitialOrientation​

Gets or sets the value of page orientation when displaying a document.

public Nullable&ltOrientation> InitialOrientation { get; set; }
Public Property InitialOrientation As Nullable(Of Orientation)

Property Value​

Nullable&ltOrientation>

InitialPage​

Gets or sets the value of initial page when displaying a document.

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

Property Value​

Nullable&ltint>

Remarks​

The value should be a positive number and it will be 0 by default in case if it exceeds the total number of pages or not set.

InitialPageMode​

Gets or sets the value of page mode when displaying a document.

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

Property Value​

Nullable&ltPageDisplayMode>

InitialVisibleNavigationPane​

Gets or sets the value of navigation pane to be visible when displaying a document.

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

Property Value​

Nullable&ltNavigationPane>

InitialZoomMode​

Gets or sets the value of page zoom mode when displaying a document.

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

Property Value​

Nullable&ltZoom>

Remarks​

If zoom percent mode is selected then the value of InitialZoomPercent has to be specified. Otherwise it will be .01f by default.

InitialZoomPercent​

Gets or sets the value of page zoom percent when displaying a document.

public Nullable&ltfloat> InitialZoomPercent { get; set; }
Public Property InitialZoomPercent As Nullable(Of Single)

Property Value​

Nullable&ltfloat>

Remarks​

This value ranges from .01f to 64.0f.

InvokeRequired​

Gets a value indicating whether the caller must call an invoke method when making method calls to the control because the caller is on a different thread than the one the control was created on. (Inherited from Control)

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

Property Value​

Boolean

IsAccessible​

Gets or sets a value indicating whether the control is visible to accessibility applications. (Inherited from Control)

public bool IsAccessible { get; set; }
Public Property IsAccessible As Boolean

Property Value​

Boolean

IsDisposed​

Gets a value indicating whether the control has been disposed of. (Inherited from Control)

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

Property Value​

Boolean

IsHandleCreated​

Gets a value indicating whether the control has a handle associated with it. (Inherited from Control)

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

Property Value​

Boolean

IsMirrored​

Gets a value indicating whether the control is mirrored. (Inherited from Control)

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

Property Value​

Boolean

LayoutEngine​

Gets a cached instance of the control's layout engine. (Inherited from Control)

public LayoutEngine LayoutEngine { get; }
Public Property LayoutEngine As LayoutEngine

Property Value​

LayoutEngine

Left​

Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area. (Inherited from Control)

public int Left { get; set; }
Public Property Left As Int32

Property Value​

Int32

Location​

Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container. (Inherited from Control)

public Point Location { get; set; }
Public Property Location As Point

Property Value​

Point

Margin​

Gets or sets the space between controls. (Inherited from Control)

public Padding Margin { get; set; }
Public Property Margin As Padding

Property Value​

Padding

MaximumSize​

Gets or sets the size that is the upper limit that GetPreferredSize(System.Drawing.Size) can specify. (Inherited from Control)

public Size MaximumSize { get; set; }
Public Property MaximumSize As Size

Property Value​

Size

MinimumSize​

Gets or sets the size that is the lower limit that GetPreferredSize(System.Drawing.Size) can specify. (Inherited from Control)

public Size MinimumSize { get; set; }
Public Property MinimumSize As Size

Property Value​

Size

Name​

Gets or sets the name of the control. (Inherited from Control)

public string Name { get; set; }
Public Property Name As String

Property Value​

String

Gets or sets the PdfNavigationPanel width.

public int NavigationPanelWidth { get; set; }
Public Property NavigationPanelWidth As Int32

Property Value​

Int32

Padding​

Gets or sets padding within the control. (Inherited from Control)

public Padding Padding { get; set; }
Public Property Padding As Padding

Property Value​

Padding

PageColor​

Gets or sets the Page Color of the document.

public Color PageColor { get; set; }
Public Property PageColor As Color

Property Value​

Color

PageMode​

Gets or sets the Page Display mode of the document.

public PageDisplayMode PageMode { get; set; }
Public Property PageMode As PageDisplayMode

Property Value​

PageDisplayMode

PageOrientation​

Gets or sets the Orientation of the page.

public Orientation PageOrientation { get; set; }
Public Property PageOrientation As Orientation

Property Value​

Orientation

Parent​

Gets or sets the parent container of the control. (Inherited from Control)

public Control Parent { get; set; }
Public Property Parent As Control

Property Value​

Control

PreferredSize​

Gets the size of a rectangular area into which the control can fit. (Inherited from Control)

public Size PreferredSize { get; }
Public Property PreferredSize As Size

Property Value​

Size

ProductName​

Gets the product name of the assembly containing the control. (Inherited from Control)

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

Property Value​

String

ProductVersion​

Gets the version of the assembly containing the control. (Inherited from Control)

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

Property Value​

String

RecreatingHandle​

Gets a value indicating whether the control is currently re-creating its handle. (Inherited from Control)

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

Property Value​

Boolean

Region​

Gets or sets the window region associated with the control. (Inherited from Control)

public Region Region { get; set; }
Public Property Region As Region

Property Value​

Region

Gets the distance, in pixels, between the right edge of the control and the left edge of its container's client area. (Inherited from Control)

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

Property Value​

Int32

ShowBookmarkIcon​

Gets or sets the value to show/hide the bookmarks icon in navigation panel.

public bool ShowBookmarkIcon { get; set; }
Public Property ShowBookmarkIcon As Boolean

Property Value​

Boolean

Remarks​

True value will show the bookmark icon in the navigation panel.

ShowNavigationPanel​

Gets or sets the boolean to show/hide the navigation panel.

public bool ShowNavigationPanel { get; set; }
Public Property ShowNavigationPanel As Boolean

Property Value​

Boolean

Remarks​

True value will show the navigation panel.

ShowStatusBar​

Hides or unhides the status bar.

public bool ShowStatusBar { get; set; }
Public Property ShowStatusBar As Boolean

Property Value​

Boolean

ShowThumbnailIcon​

Gets or sets the value to show/hide thumbnails icon in navigation panel.

public bool ShowThumbnailIcon { get; set; }
Public Property ShowThumbnailIcon As Boolean

Property Value​

Boolean

Remarks​

True value will show the thumbnail icon in the navigation panel.

ShowToolbar​

Obsolete. Gets or sets the boolean to show/hide the PdfToolStrip.

public bool ShowToolbar { get; set; }
Public Property ShowToolbar As Boolean

Property Value​

Boolean

Remarks​

NOTE: This property is obsolete. Use ShowToolStrip property instead.

ShowToolStrip​

Gets or sets the boolean to show/hide the PdfToolStrip.

public bool ShowToolStrip { get; set; }
Public Property ShowToolStrip As Boolean

Property Value​

Boolean

Remarks​

True value will show the default PdfToolStrip.

Site​

Gets or sets the site of the control. (Inherited from Control)

public ISite Site { get; set; }
Public Property Site As ISite

Property Value​

ISite

Size​

Gets or sets the height and width of the control. (Inherited from Control)

public Size Size { get; set; }
Public Property Size As Size

Property Value​

Size

TabIndex​

Gets or sets the tab order of the control within its container. (Inherited from Control)

public int TabIndex { get; set; }
Public Property TabIndex As Int32

Property Value​

Int32

TabStop​

Gets or sets a value indicating whether the user can give the focus to this control using the TAB key. (Inherited from Control)

public bool TabStop { get; set; }
Public Property TabStop As Boolean

Property Value​

Boolean

Tag​

Gets or sets the object that contains data about the control. (Inherited from Control)

public Object Tag { get; set; }
Public Property Tag As Object

Property Value​

Object

ToolStrip​

Gets or sets the PdfToolStrip of the viewer control.

public ToolStrip ToolStrip { get; set; }
Public Property ToolStrip As ToolStrip

Property Value​

ToolStrip

Top​

Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area. (Inherited from Control)

public int Top { get; set; }
Public Property Top As Int32

Property Value​

Int32

TopLevelControl​

Gets the parent control that is not parented by another Windows Forms control. Typically, this is the outermost Form that the control is contained in. (Inherited from Control)

public Control TopLevelControl { get; }
Public Property TopLevelControl As Control

Property Value​

Control

UseWaitCursor​

Gets or sets a value indicating whether to use the wait cursor for the current control and all child controls. (Inherited from Control)

public bool UseWaitCursor { get; set; }
Public Property UseWaitCursor As Boolean

Property Value​

Boolean

Visible​

Gets or sets a value indicating whether the control and all its child controls are displayed. (Inherited from Control)

public bool Visible { get; set; }
Public Property Visible As Boolean

Property Value​

Boolean

VisibleNavigationPane​

Gets or sets the value of navigation pane to be visible for displayed document.

public NavigationPane VisibleNavigationPane { get; set; }
Public Property VisibleNavigationPane As NavigationPane

Property Value​

NavigationPane

Width​

Gets or sets the width of the control. (Inherited from Control)

public int Width { get; set; }
Public Property Width As Int32

Property Value​

Int32

ZoomMode​

Gets or sets the Zoom Mode of the document.

public Zoom ZoomMode { get; set; }
Public Property ZoomMode As Zoom

Property Value​

Zoom

ZoomPercent​

Gets or sets the value of page zoom percent for displayed document.

public float ZoomPercent { get; set; }
Public Property ZoomPercent As Single

Property Value​

Single

Remarks​

This value ranges from .01f to 64.0f.

Methods​

AddLicense(String)​

Adds a license key.

public static bool AddLicense(string licenseKey)
Shared Function AddLicense(licenseKey As String) As Boolean

Parameters​

The license key to add.

Returns​

A boolean value indicating if the license key is valid.

Remarks​

This method accepts a license key, not a serial number.

BeginInvoke(Delegate)​

Executes the specified delegate asynchronously on the thread that the control's underlying handle was created on. (Inherited from Control)

public IAsyncResult BeginInvoke(Delegate method)
Function BeginInvoke(method As Delegate) As IAsyncResult

Parameters​

A delegate to a method that takes no parameters.

Returns​

An IAsyncResult that represents the result of the BeginInvoke(System.Delegate) operation.

Exceptions​

No appropriate window handle can be found.

BeginInvoke(Delegate, Object[])​

Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on. (Inherited from Control)

public IAsyncResult BeginInvoke(Delegate method, Object[] args)
Function BeginInvoke(method As Delegate, args As Object[]) As IAsyncResult

Parameters​

A delegate to a method that takes parameters of the same number and type that are contained in the parameter.

An array of objects to pass as arguments to the given method. This can be if no arguments are needed.

Returns​

An IAsyncResult that represents the result of the BeginInvoke(System.Delegate) operation.

Exceptions​

No appropriate window handle can be found.

BringToFront()​

Brings the control to the front of the z-order. (Inherited from Control)

public void BringToFront()
Sub BringToFront()

ClearSearchHighlights()​

Clear all the highlights in the document.

public void ClearSearchHighlights()
Sub ClearSearchHighlights()

Examples​

The following example will show how to clear all the highlights from the document.

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 ClearHighlights()
' Open document in viewer.
MyPdfViewer.Open("C:\MyDocument.pdf")

' Clear all the highlights.
MyPdfViewer.ClearSearchHighlights()
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();
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
}

private void ClearHighlights()
{
// Open document in viewer.
pdfViewer.Open(@"C:\MyDocument.pdf");

// Clear all the highlights.
pdfViewer.ClearSearchHighlights();
}
}
}

ClearViewHistory()​

Clears all the View present in the history.

public void ClearViewHistory()
Sub ClearViewHistory()

Examples​

The following example will show how to clear all the views present in the history.

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 ClearViewerViewHistory() ' Clear all the views. MyPdfViewer.ClearViewHistory()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();
}

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

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

private void ClearViewerViewHistory()
{
// Clear all the views.
pdfViewer.ClearViewHistory();
}
}
}

Close()​

Closes the opened PDF.

public void Close()
Sub Close()

Examples​

This example shows, how to load a PDF document in PdfViewer and close it.

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()
Dim MyCloseButton As New Button()
MyCloseButton.Text = "CloseButton"
Me.Controls.Add(MyCloseButton)
AddHandler MyCloseButton.Click, New EventHandler(AddressOf MyCloseButton_Click)

Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler Me.Load, New EventHandler(AddressOf Form1_Load)
End Sub

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

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
' Open the document in Viewer.
MyPdfViewer.Open("C:\MyDocument.pdf")
End Sub

Private Sub MyCloseButton_Click(ByVal sender As Object, ByVal e As EventArgs)
MyPdfViewer.Close()
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
Button CloseButton = new Button();
CloseButton.Text = "CloseButton";
this.Controls.Add(CloseButton);
CloseButton.Click+= new EventHandler(CloseButton_Click);
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
this.Load +=new EventHandler(Form1_Load);
}

private void Form1_Load(object sender, EventArgs e)
{
pdfViewer.Open(@"C:\MyDocument.pdf");
}

private void CloseButton_Click(object sender, EventArgs e)
{
pdfViewer.Close();
}
}
}

Contains(Control)​

Retrieves a value indicating whether the specified control is a child of the control. (Inherited from Control)

public bool Contains(Control ctl)
Function Contains(ctl As Control) As Boolean

Parameters​

The Control to evaluate.

Returns​

if the specified control is a child of the control; otherwise, .

CreateControl()​

Forces the creation of the visible control, including the creation of the handle and any visible child controls. (Inherited from Control)

public void CreateControl()
Sub CreateControl()

CreateGraphics()​

Creates the Graphics for the control. (Inherited from Control)

public Graphics CreateGraphics()
Function CreateGraphics() As Graphics

Returns​

The Graphics for the control.

CreateObjRef(Type)​

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject)

public ObjRef CreateObjRef(Type requestedType)
Function CreateObjRef(requestedType As Type) As ObjRef

Parameters​

  • requestedType: Type

The Type of the object that the new ObjRef will reference.

Returns​

Information required to generate a proxy.

Exceptions​

This instance is not a valid remoting object.

The immediate caller does not have infrastructure permission.

Dispose()​

Releases all resources used by the Component . (Inherited from Component)

public void Dispose()
Sub Dispose()

DoDragDrop(Object, DragDropEffects)​

Begins a drag-and-drop operation. (Inherited from Control)

public DragDropEffects DoDragDrop(Object data, DragDropEffects allowedEffects)
Function DoDragDrop(data As Object, allowedEffects As DragDropEffects) As DragDropEffects

Parameters​

The data to drag.

One of the DragDropEffects values.

Returns​

A value from the DragDropEffects enumeration that represents the final effect that was performed during the drag-and-drop operation.

DrawToBitmap(Bitmap, Rectangle)​

Supports rendering to the specified bitmap. (Inherited from Control)

public void DrawToBitmap(Bitmap bitmap, Rectangle targetBounds)
Sub DrawToBitmap(bitmap As Bitmap, targetBounds As Rectangle)

Parameters​

The bitmap to be drawn to.

The bounds within which the control is rendered.

EndInvoke(IAsyncResult)​

Retrieves the return value of the asynchronous operation represented by the IAsyncResult passed. (Inherited from Control)

public Object EndInvoke(IAsyncResult asyncResult)
Function EndInvoke(asyncResult As IAsyncResult) As Object

Parameters​

The IAsyncResult that represents a specific invoke asynchronous operation, returned when calling BeginInvoke(System.Delegate) .

Returns​

The Object generated by the asynchronous operation.

Exceptions​

The parameter value is .

The object was not created by a preceding call of the BeginInvoke(System.Delegate) method from the same control.

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.

FindForm()​

Retrieves the form that the control is on. (Inherited from Control)

public Form FindForm()
Function FindForm() As Form

Returns​

The Form that the control is on.

Focus()​

Sets input focus to the control. (Inherited from Control)

public bool Focus()
Function Focus() As Boolean

Returns​

if the input focus request was successful; otherwise, .

GetChildAtPoint(Point)​

Retrieves the child control that is located at the specified coordinates. (Inherited from Control)

public Control GetChildAtPoint(Point pt)
Function GetChildAtPoint(pt As Point) As Control

Parameters​

A Point that contains the coordinates where you want to look for a control. Coordinates are expressed relative to the upper-left corner of the control's client area.

Returns​

A Control that represents the control that is located at the specified point.

GetChildAtPoint(Point, GetChildAtPointSkip)​

Retrieves the child control that is located at the specified coordinates, specifying whether to ignore child controls of a certain type. (Inherited from Control)

public Control GetChildAtPoint(Point pt, GetChildAtPointSkip skipValue)
Function GetChildAtPoint(pt As Point, skipValue As GetChildAtPointSkip) As Control

Parameters​

A Point that contains the coordinates where you want to look for a control. Coordinates are expressed relative to the upper-left corner of the control's client area.

One of the values of GetChildAtPointSkip , determining whether to ignore child controls of a certain type.

Returns​

The child Control at the specified coordinates.

GetContainerControl()​

Returns the next ContainerControl up the control's chain of parent controls. (Inherited from Control)

public IContainerControl GetContainerControl()
Function GetContainerControl() As IContainerControl

Returns​

An IContainerControl , that represents the parent of the Control .

GetCurrentView()​

Retrieves the current View of the document displayed.

public View GetCurrentView()
Function GetCurrentView() As View

Returns​

This method returns the current View of the document on display.

Examples​

The following example will show how to get current view and its associated data.

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)
AddHandler Me.Load, New EventHandler(AddressOf Form1_Load)
End Sub

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

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
' Open document in Viewer.
MyPdfViewer.Open("C:\MyDocument.pdf")

' Get current view on display.
Dim MyCurrentView As ceTe.DynamicPDF.Viewer.View = MyPdfViewer.GetCurrentView()

' Get the details of view.
Dim pageNo As Integer = MyCurrentView.StartPageNumber
Dim zoomValue As Single = MyCurrentView.ZoomPercent
Dim MyDisplayMode As PageDisplayMode = MyCurrentView.PageDisplayMode
Dim MySoomMode As Zoom = MyCurrentView.ZoomMode
Dim MyPageOrientation As ceTe.DynamicPDF.Viewer.Orientation = MyCurrentView.PageOrientation
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();
}

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

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

private void Form1_Load(object sender, EventArgs e)
{
// Open document in viewer.
pdfViewer.Open(@"C:\MyDocument.pdf");

// Get current view on display.
ceTe.DynamicPDF.Viewer.View currentView = pdfViewer.GetCurrentView();

// Get the details of view.
int pageNo = currentView.StartPageNumber;
float zoomValue = currentView.ZoomPercent;
PageDisplayMode displayMode = currentView.PageDisplayMode;
Zoom zoomMode = currentView.ZoomMode;
ceTe.DynamicPDF.Viewer.Orientation pageOrientation = currentView.PageOrientation;
}
}
}

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 .

GetInitialView()​

Retrieves the initial View of the document displayed.

public View GetInitialView()
Function GetInitialView() As View

Returns​

This method returns the initial View of the document on display.

Examples​

The following example will show how to get the initial view and its associated details.

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)
AddHandler Me.Load, New EventHandler(AddressOf Form1_Load)
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
' Open the document in Viewer.
MyPdfViewer.Open("C:\MyDocument.pdf")

'Get initial view of the document.
Dim MyInitialView As ceTe.DynamicPDF.Viewer.View = MyPdfViewer.GetInitialView()

' Get the details of view.
Dim pageNo As Integer = MyInitialView.StartPageNumber
Dim zoomValue As Single = MyInitialView.ZoomPercent
Dim MyDisplayMode As PageDisplayMode = MyInitialView.PageDisplayMode
Dim MyZoomMode As Zoom = MyInitialView.ZoomMode
Dim MyPageOrientation As ceTe.DynamicPDF.Viewer.Orientation = MyInitialView.PageOrientation
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();
}

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

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

private void Form1_Load(object sender, EventArgs e)
{
// Open document in PdfViewwer.
pdfViewer.Open(@"C:\MyDocument.pdf");

//Get initial view of the document.
ceTe.DynamicPDF.Viewer.View initialView = pdfViewer.GetInitialView();

// Get the details of view.
int pageNo = initialView.StartPageNumber;
float zoomValue = initialView.ZoomPercent;
PageDisplayMode displayMode = initialView.PageDisplayMode;
Zoom zoomMode = initialView.ZoomMode;
ceTe.DynamicPDF.Viewer.Orientation pageOrientation = initialView.PageOrientation;
}
}
}

GetLifetimeService()​

Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject)

public Object GetLifetimeService()
Function GetLifetimeService() As Object

Returns​

An object of type ILease used to control the lifetime policy for this instance.

Exceptions​

The immediate caller does not have infrastructure permission.

GetNextControl(Control, Boolean)​

Retrieves the next control forward or back in the tab order of child controls. (Inherited from Control)

public Control GetNextControl(Control ctl, bool forward)
Function GetNextControl(ctl As Control, forward As Boolean) As Control

Parameters​

The Control to start the search with.

to search forward in the tab order; to search backward.

Returns​

The next Control in the tab order.

GetPageVisibleArea(View)​

Retrieves an array of pages present in View specified with respective visible area.

public PageVisibleArea[] GetPageVisibleArea(View view)
Function GetPageVisibleArea(view As View) As PageVisibleArea[]

Parameters​

The View whose visible area is required.

Returns​

Examples​

For example refer PageVisibleArea class.

GetPreferredSize(Size)​

Retrieves the size of a rectangular area into which a control can be fitted. (Inherited from Control)

public Size GetPreferredSize(Size proposedSize)
Function GetPreferredSize(proposedSize As Size) As Size

Parameters​

  • proposedSize: Size

The custom-sized area for a control.

Returns​

An ordered pair of type Size representing the width and height of a rectangle.

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.

GoTo(Int32)​

Moves to the page specified as parameter.

public void GoTo(int pageNumber)
Sub GoTo(pageNumber As Integer)

Parameters​

The page number to move to.

Examples​

The following example will show how to move to a page by specifying its number.

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 NavigateToPagenumber() ' Open document in viewer. MyPdfViewer.Open("C:\MyDocument.pdf")
' Move to a page. ' PageNumber ranges from '1' to 'count' of the pages in the document. MyPdfViewer.GoTo(1)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();
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
}

private void NavigateToPagenumber()
{
// Open document in viewer.
pdfViewer.Open(@"C:\MyDocument.pdf");

// Move to a page. // PageNumber ranges from '1' to 'count' of the pages in the document.
pdfViewer.GoTo(1);
}
}
}

Remarks​

The page number should be a non zero based index.

GoToFirstPage()​

Moves to the first page of the document.

public void GoToFirstPage()
Sub GoToFirstPage()

Examples​

The following example will show how to move to first page of the document.

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 NavigateToPage() ' Open document in Viewer. MyPdfViewer.Open("C:\MyDocument.pdf")
' Move to first page. MyPdfViewer.GoToFirstPage()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();
}

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

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

private void NavigateToPage()
{
// Open document in Viewer.
pdfViewer.Open(@"C:\MyDocument.pdf");

// Move to first page.
pdfViewer.GoToFirstPage();
}
}
}

GoToLastPage()​

Moves to the last page of the document.

public void GoToLastPage()
Sub GoToLastPage()

Examples​

The following example will show how to move to last page of the document.

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 NavigateToPage() ' Open document in viewer. MyPdfViewer.Open("C:\MyDocument.pdf")
' Move to last page. MyPdfViewer.GoToLastPage()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();
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
}

private void NavigateToPage()
{
// Open document in viewer.
pdfViewer.Open(@"C:\MyDocument.pdf");

// Move to last page.
pdfViewer.GoToLastPage();
}
}
}

GoToNextPage()​

Moves to next page.

public bool GoToNextPage()
Function GoToNextPage() As Boolean

Returns​

True if successfully moved to next page else false.

Examples​

The following example will show how to move to next page.

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 NavigateToPage() ' Move to next page. Dim bResult As Boolean = MyPdfViewer.GoToNextPage()
If bResult Then MessageBox.Show("Successfully moved to next page") Else MessageBox.Show("There's no next page to move") End IfEnd 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();
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
}

private void NavigateToPage()
{
// Move to next page.
bool bResult = pdfViewer.GoToNextPage();

if(bResult)
MessageBox.Show("Successfully moved to next page");
else
MessageBox.Show("There's no next page to move");
}
}
}

GoToPreviousPage()​

Moves to the previous page.

public bool GoToPreviousPage()
Function GoToPreviousPage() As Boolean

Returns​

True if successfully moved to previous page else false.

Examples​

The following example will show how to move to previous page.

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 NavigateToPage() ' Move to previous page. Dim bResult As Boolean = MyPdfViewer.GoToPreviousPage()
If bResult Then MessageBox.Show("Successfully moved to previous page") Else MessageBox.Show("There's no previous page to move") End IfEnd 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();
}

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

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

private void NavigateToPage()
{
// Move to previous page.
bool bResult = pdfViewer.GoToPreviousPage();

if(bResult)
MessageBox.Show("Successfully moved to previous page");
else
MessageBox.Show("There's no previous page to move");
}
}
}

Hide()​

Conceals the control from the user. (Inherited from Control)

public void Hide()
Sub Hide()

Highlight(String, MatchOptions)​

Highlights the specified string throughout the document.

public void Highlight(string searchTerm, MatchOptions option)
Sub Highlight(searchTerm As String, option As MatchOptions)

Parameters​

The string to be highlighted.

The match option to be used to search and highlight the string.

Examples​

The following example will show how to highlight a string throughout the document with a match option.

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 Highlight()
' Highlights a string throughout the document.
MyPdfViewer.Highlight("string", MatchOptions.WholeWordOnly)
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();
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
}

private void Highlight()
{
// Highlights a string throughout the document.
pdfViewer.Highlight("string" , MatchOptions.WholeWordOnly);
}
}
}

InitializeLifetimeService()​

Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject)

public Object InitializeLifetimeService()
Function InitializeLifetimeService() As Object

Returns​

An object of type ILease used to control the lifetime policy for this instance. This is the current lifetime service object for this instance if one exists; otherwise, a new lifetime service object initialized to the value of the LeaseManagerPollTime property.

Exceptions​

The immediate caller does not have infrastructure permission.

Invalidate()​

Invalidates the entire surface of the control and causes the control to be redrawn. (Inherited from Control)

public void Invalidate()
Sub Invalidate()

Invalidate(Boolean)​

Invalidates a specific region of the control and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control)

public void Invalidate(bool invalidateChildren)
Sub Invalidate(invalidateChildren As Boolean)

Parameters​

to invalidate the control's child controls; otherwise, .

Invalidate(Rectangle)​

Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. (Inherited from Control)

public void Invalidate(Rectangle rc)
Sub Invalidate(rc As Rectangle)

Parameters​

A Rectangle that represents the region to invalidate.

Invalidate(Rectangle, Boolean)​

Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control)

public void Invalidate(Rectangle rc, bool invalidateChildren)
Sub Invalidate(rc As Rectangle, invalidateChildren As Boolean)

Parameters​

A Rectangle that represents the region to invalidate.

to invalidate the control's child controls; otherwise, .

Invalidate(Region)​

Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. (Inherited from Control)

public void Invalidate(Region region)
Sub Invalidate(region As Region)

Parameters​

The Region to invalidate.

Invalidate(Region, Boolean)​

Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control)

public void Invalidate(Region region, bool invalidateChildren)
Sub Invalidate(region As Region, invalidateChildren As Boolean)

Parameters​

The Region to invalidate.

to invalidate the control's child controls; otherwise, .

Invoke(Delegate)​

Executes the specified delegate on the thread that owns the control's underlying window handle. (Inherited from Control)

public Object Invoke(Delegate method)
Function Invoke(method As Delegate) As Object

Parameters​

A delegate that contains a method to be called in the control's thread context.

Returns​

The return value from the delegate being invoked, or if the delegate has no return value.

Invoke(Delegate, Object[])​

Executes the specified delegate, on the thread that owns the control's underlying window handle, with the specified list of arguments. (Inherited from Control)

public Object Invoke(Delegate method, Object[] args)
Function Invoke(method As Delegate, args As Object[]) As Object

Parameters​

A delegate to a method that takes parameters of the same number and type that are contained in the parameter.

An array of objects to pass as arguments to the specified method. This parameter can be if the method takes no arguments.

Returns​

An Object that contains the return value from the delegate being invoked, or if the delegate has no return value.

LogicalToDeviceUnits(Int32)​

Converts a Logical DPI value to its equivalent DeviceUnit DPI value. (Inherited from Control)

public int LogicalToDeviceUnits(int value)
Function LogicalToDeviceUnits(value As Integer) As Integer

Parameters​

The Logical value to convert.

Returns​

The resulting DeviceUnit value.

LogicalToDeviceUnits(Size)​

Transforms a size from logical to device units by scaling it for the current DPI and rounding down to the nearest integer value for width and height. (Inherited from Control)

public Size LogicalToDeviceUnits(Size value)
Function LogicalToDeviceUnits(value As Size) As Size

Parameters​

The size to be scaled.

Returns​

The scaled size.

Navigate to the destination stored in the Action object of the link.

public void Navigate(Action action)
Sub Navigate(action As Action)

Parameters​

The Action object containing the information about the link.

Examples​

The following example will show how to get a Action object and navigate to it.

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)
AddHandler MyPdfViewer.LinkClicked, AddressOf MyPdfViewer_LinkClicked
End Sub

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

Private Sub MyPdfViewer_LinkClicked(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.LinkClickedEventArgs)
' Get the action associated with the link.
Dim Myction As ceTe.DynamicPDF.Viewer.Action = e.Action

' Navigate to the action.
Me.MyPdfViewer.Navigate(Myction)
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.LinkClicked += new ceTe.DynamicPDF.Viewer.LinkClickEventHandler(this.pdfViewer_LinkClicked);
}

private void pdfViewer_LinkClicked(object sender, ceTe.DynamicPDF.Viewer.LinkClickedEventArgs e)
{
// Get the action associated with the link.
ceTe.DynamicPDF.Viewer.Action action = e.Action;

// Navigate to the action.
this.pdfViewer.Navigate(action);
}
}
}

Remarks​

In case of remote goto user needs to open the file first and then navigate to the action.

Navigate to the Bookmark specified.

public void Navigate(Bookmark bookmark)
Sub Navigate(bookmark As Bookmark)

Parameters​

The Bookmark to move to.

Examples​

The following example will show how to get a Bookmark and navigate to it.

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 NavigationToBookmark() ' Get a PDF document object and open in viewer. Dim document As New PdfDocument("C:\MyDocument.pdf") MyPdfViewer.Open(document)
' Get a bookmark from PDF document object. Dim bookmarkList As BookmarkList = document.Bookmarks
' Get a bookmark from the list. ' Index ranges from 0 to n(count-1) of the bookmarks Dim bookmark As Bookmark = bookmarkList(0)
' Navigate to a bookmark passed as parameter. MyPdfViewer.Navigate(bookmark)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();
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
}

private void NavigationToBookmark()
{
// Get a PDF document object and open in viewer.
PdfDocument document = new PdfDocument(@"C:\MyDocument.pdf");
pdfViewer.Open(document);

// Get a bookmark from PDF document object.
BookmarkList bookmarkList = document.Bookmarks;

// Get a bookmark from the list.
// Index ranges from 0 to n(count-1) of the bookmarks
Bookmark bookmark = bookmarkList[0];

// Navigate to a bookmark passed as parameter.
pdfViewer.Navigate(bookmark);
}
}
}

Navigates to the View specified.

public void Navigate(View View)
Sub Navigate(View As View)

Parameters​

The View to move to.

Examples​

The following example will show how to navigate to a view given as parameter.

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 NavigationToView() ' Get initial view. Dim initView As ceTe.DynamicPDF.Viewer.View = MyPdfViewer.GetInitialView()
' Navigate to view passed as parameter. MyPdfViewer.Navigate(initView)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();
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
}

private void NavigationToView()
{
// Get initial view.
ceTe.DynamicPDF.Viewer.View initView = pdfViewer.GetInitialView();

// Navigate to view passed as parameter.
pdfViewer.Navigate(initView);
}
}
}

Navigates to the View specified.

public void Navigate(View View, int offsetX, int offsetY)
Sub Navigate(View As View, offsetX As Integer, offsetY As Integer)

Parameters​

The View to move to.

The view position will be moved left or right based on this value.

The view position will be moved up or down based on this value.

Navigates to the View in next history.

public bool NavigateToNextView()
Function NavigateToNextView() As Boolean

Returns​

True if successfully moved to next view else false.

Examples​

The following example will show how to Navigate to the next view.

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 NavigationToView() ' Navigate to next view. Dim bResult As Boolean = MyPdfViewer.NavigateToNextView()
If bResult Then MessageBox.Show("Successfully moved to next view") Else MessageBox.Show("There's no next view to navigate") End IfEnd 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();
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
}

private void NavigationToView()
{
// Navigate to next view.
bool bResult = pdfViewer.NavigateToNextView();

if(bResult)
MessageBox.Show("Successfully moved to next view");
else
MessageBox.Show("There's no next view to navigate");
}
}
}

Navigates to the View in previous history.

public bool NavigateToPreviousView()
Function NavigateToPreviousView() As Boolean

Returns​

True if successfully moved to previous view else false.

Examples​

The following example will show how to Navigate to the previous view.

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 NavigationToView() ' Navigate to previous view. Dim bResult As Boolean = MyPdfViewer.NavigateToPreviousView()
If bResult Then MessageBox.Show("Successfully moved to previous view") Else MessageBox.Show("There's no previous view to navigate") End IfEnd 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();
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
}

private void NavigationToView()
{
// Navigate to previous view.
bool bResult = pdfViewer.NavigateToPreviousView();

if(bResult)
MessageBox.Show("Successfully moved to previous view");
else
MessageBox.Show("There's no previous view to navigate");
}
}
}

Open(PdfDocument)​

Opens a new PDF using PdfDocument .

public void Open(PdfDocument document)
Sub Open(document As PdfDocument)

Parameters​

Examples​

This example shows, how to load a PDF document in PdfViewer 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);
}
}
}

Open(String)​

Opens a PDF document.

public void Open(string filePath)
Sub Open(filePath As String)

Parameters​

Examples​

This example shows, how to load a PDF document in PdfViewer .

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
' open the document using the file path.
MyPdfViewer.Open("C:\MyDocument.pdf")
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)
{
// open the document using the file path.
pdfViewer.Open(@"C:\MyDocument.pdf");
}
}
}

PerformLayout()​

Forces the control to apply layout logic to all its child controls. (Inherited from Control)

public void PerformLayout()
Sub PerformLayout()

PerformLayout(Control, String)​

Forces the control to apply layout logic to all its child controls. (Inherited from Control)

public void PerformLayout(Control affectedControl, string affectedProperty)
Sub PerformLayout(affectedControl As Control, affectedProperty As String)

Parameters​

A Control that represents the most recently changed control.

The name of the most recently changed property on the control.

PointToClient(Point)​

Computes the location of the specified screen point into client coordinates. (Inherited from Control)

public Point PointToClient(Point p)
Function PointToClient(p As Point) As Point

Parameters​

The screen coordinate Point to convert.

Returns​

A Point that represents the converted Point , , in client coordinates.

PointToScreen(Point)​

Computes the location of the specified client point into screen coordinates. (Inherited from Control)

public Point PointToScreen(Point p)
Function PointToScreen(p As Point) As Point

Parameters​

The client coordinate Point to convert.

Returns​

A Point that represents the converted Point , , in screen coordinates.

PreProcessControlMessage(Message&)​

Preprocesses keyboard or input messages within the message loop before they are dispatched. (Inherited from Control)

public PreProcessControlState PreProcessControlMessage(Message& msg)
Function PreProcessControlMessage(msg As Message&) As PreProcessControlState

Parameters​

A Message that represents the message to process.

Returns​

One of the PreProcessControlState values, depending on whether PreProcessMessage(System.Windows.Forms.Message@) is or and whether IsInputKey(System.Windows.Forms.Keys) or IsInputChar(System.Char) are or .

PreProcessMessage(Message&)​

Preprocesses keyboard or input messages within the message loop before they are dispatched. (Inherited from Control)

public bool PreProcessMessage(Message& msg)
Function PreProcessMessage(msg As Message&) As Boolean

Parameters​

A Message , passed by reference, that represents the message to process. The possible values are WM_KEYDOWN, WM_SYSKEYDOWN, WM_CHAR, and WM_SYSCHAR.

Returns​

if the message was processed by the control; otherwise, .

Print()​

Prints the document.

public void Print()
Sub Print()

RectangleToClient(Rectangle)​

Computes the size and location of the specified screen rectangle in client coordinates. (Inherited from Control)

public Rectangle RectangleToClient(Rectangle r)
Function RectangleToClient(r As Rectangle) As Rectangle

Parameters​

The screen coordinate Rectangle to convert.

Returns​

A Rectangle that represents the converted Rectangle , , in client coordinates.

RectangleToScreen(Rectangle)​

Computes the size and location of the specified client rectangle in screen coordinates. (Inherited from Control)

public Rectangle RectangleToScreen(Rectangle r)
Function RectangleToScreen(r As Rectangle) As Rectangle

Parameters​

The client coordinate Rectangle to convert.

Returns​

A Rectangle that represents the converted Rectangle , , in screen coordinates.

Refresh()​

Forces the control to invalidate its client area and immediately redraw itself and any child controls. (Inherited from Control)

public void Refresh()
Sub Refresh()

ResetText()​

Resets the Text property to its default value ( Empty ). (Inherited from Control)

public void ResetText()
Sub ResetText()

ResumeLayout()​

Resumes usual layout logic. (Inherited from Control)

public void ResumeLayout()
Sub ResumeLayout()

ResumeLayout(Boolean)​

Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests. (Inherited from Control)

public void ResumeLayout(bool performLayout)
Sub ResumeLayout(performLayout As Boolean)

Parameters​

to execute pending layout requests; otherwise, .

Scale(SizeF)​

Scales the control and all child controls by the specified scaling factor. (Inherited from Control)

public void Scale(SizeF factor)
Sub Scale(factor As SizeF)

Parameters​

A SizeF containing the horizontal and vertical scaling factors.

ScaleBitmapLogicalToDevice(Bitmap&)​

Scales a logical bitmap value to it's equivalent device unit value when a DPI change occurs. (Inherited from Control)

public void ScaleBitmapLogicalToDevice(Bitmap& logicalBitmap)
Sub ScaleBitmapLogicalToDevice(logicalBitmap As Bitmap&)

Parameters​

The bitmap to scale.

SearchBackward(String, MatchOptions)​

Searches the string specified in backward direction.

public void SearchBackward(string searchTerm, MatchOptions option)
Sub SearchBackward(searchTerm As String, option As MatchOptions)

Parameters​

The string to be searched.

The match option to use for searching.

Examples​

The following example will show how to search a string in backward direction with match option.

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 Search()
' Searches string in backward direction.
MyPdfViewer.SearchBackward("string", MatchOptions.WholeWordOnly)
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();
}

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

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

private void Search()
{
// Searches string in backward direction.
pdfViewer.SearchBackward("string" , MatchOptions.WholeWordOnly);
}
}
}

Remarks​

Search starts with firing SearchProgressing event. During search, Searched event will be fired if any match is found. SearchProgressing event is fired each time with Status 'Progressing' when the search finishes the current page and moves to next page. When search completed Searched event will be fired with Status 'Completed'. If user cancels the existing search through user interface or through code by invoking a new search, then Searched event will be fired with Status 'Canceled'. Change in the search term, options, search direction or invoking a new search when current search is progressing, will result in resetting of the current search.

SearchForward(String, MatchOptions)​

Searches the string specified in forward direction.

public void SearchForward(string searchTerm, MatchOptions option)
Sub SearchForward(searchTerm As String, option As MatchOptions)

Parameters​

The string to be searched.

The match option to use for searching.

Examples​

The following example will show how to search a sring in forward direction with match option.

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 Search() ' Searches string in forward direction. MyPdfViewer.SearchForward("string", MatchOptions.WholeWordOnly)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();
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
}

private void Search()
{
// Searches string in forward direction.
pdfViewer.SearchForward("string" , MatchOptions.WholeWordOnly);
}
}
}

Remarks​

Search starts with firing SearchProgressing event. During search, Searched event will be fired if any match is found. SearchProgressing event is fired each time with Status 'Progressing' when the search finishes the current page and moves to next page. When search completed Searched event will be fired with Status 'Completed'. If user cancels the existing search through user interface or through code by invoking a new search, then Searched event will be fired with Status 'Canceled'. Change in the search term, options, search direction or invoking a new search when current search is progressing, will result in resetting of the current search.

Select()​

Activates the control. (Inherited from Control)

public void Select()
Sub Select()

SelectNextControl(Control, Boolean, Boolean, Boolean, Boolean)​

Activates the next control. (Inherited from Control)

public bool SelectNextControl(Control ctl, bool forward, bool tabStopOnly, bool nested, bool wrap)
Function SelectNextControl(ctl As Control, forward As Boolean, tabStopOnly As Boolean, nested As Boolean, wrap As Boolean) As Boolean

Parameters​

The Control at which to start the search.

to move forward in the tab order; to move backward in the tab order.

to ignore the controls with the TabStop property set to ; otherwise, .

to include nested (children of child controls) child controls; otherwise, .

to continue searching from the first control in the tab order after the last control has been reached; otherwise, .

Returns​

if a control was activated; otherwise, .

SendToBack()​

Sends the control to the back of the z-order. (Inherited from Control)

public void SendToBack()
Sub SendToBack()

SetBounds(Int32, Int32, Int32, Int32)​

Sets the bounds of the control to the specified location and size. (Inherited from Control)

public void SetBounds(int x, int y, int width, int height)
Sub SetBounds(x As Integer, y As Integer, width As Integer, height As Integer)

Parameters​

The new Left property value of the control.

The new Top property value of the control.

The new Width property value of the control.

The new Height property value of the control.

SetBounds(Int32, Int32, Int32, Int32, BoundsSpecified)​

Sets the specified bounds of the control to the specified location and size. (Inherited from Control)

public void SetBounds(int x, int y, int width, int height, BoundsSpecified specified)
Sub SetBounds(x As Integer, y As Integer, width As Integer, height As Integer, specified As BoundsSpecified)

Parameters​

The new Left property value of the control.

The new Top property value of the control.

The new Width property value of the control.

The new Height property value of the control.

A bitwise combination of the BoundsSpecified values. For any parameter not specified, the current value will be used.

Show()​

Displays the control to the user. (Inherited from Control)

public void Show()
Sub Show()

ShowAboutBox()​

Shows an about box that contains version info.

public void ShowAboutBox()
Sub ShowAboutBox()

SuspendLayout()​

Temporarily suspends the layout logic for the control. (Inherited from Control)

public void SuspendLayout()
Sub SuspendLayout()

ToString()​

Returns a String containing the name of the Component , if any. This method should not be overridden. (Inherited from Component)

public string ToString()
Function ToString() As String

Returns​

A String containing the name of the Component , if any, or if the Component is unnamed.

Update()​

Causes the control to redraw the invalidated regions within its client area. (Inherited from Control)

public void Update()
Sub Update()

Events​

ClientSizeChanged​

Occurs when the value of the ClientSize property changes. (Inherited from Control)

public event EventHandler PdfViewer.ClientSizeChanged;
Public Event PdfViewer.ClientSizeChanged As EventHandler

Event Handler​

EventHandler

ContextMenuShowing​

Occurs when the control's context menu is being displayed.

public event ContextMenuShowingEventHandler PdfViewer.ContextMenuShowing;
Public Event PdfViewer.ContextMenuShowing As ContextMenuShowingEventHandler

Event Handler​

ContextMenuShowingEventHandler

Examples​

This example demonstrates, how to hide/show the context menu , override the context menu of the control with a new one and setting the type context using ContextMenuShowingEventArgs class.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.ContextMenuShowing, AddressOf MyPdfViewer_ContextMenuShowing
End Sub

Private Sub MyPdfViewer_ContextMenuShowing(ByVal sender As Object, ByVal e As ContextMenuShowingEventArgs)
' Suppress the control's existing context menu with a new context menu.
e.AssignedContextMenu = New ContextMenuStrip()

' Create new ToolStripMenuItem and add it to AssignedContextMenu.
Dim MyToolStripMenuitem1 As New ToolStripMenuItem()
MyToolStripMenuitem1.Text = "Rotate"
e.AssignedContextMenu.Items.Add(MyToolStripMenuitem1)

' Create new ToolStripMenuItem and add it to AssignedContextMenu.
Dim MyToolStripMenuitem2 As New ToolStripMenuItem()
MyToolStripMenuitem2.Text = "View"
e.AssignedContextMenu.Items.Add(MyToolStripMenuitem2)

' Set the value to hide/show the context menu.
e.Cancel = True
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.ContextMenuShowing += new ceTe.DynamicPDF.Viewer.ContextMenuShowingEventHandler(this.pdfViewer_ContextMenuShowing);
}

private void pdfViewer_ContextMenuShowing(object sender, ceTe.DynamicPDF.Viewer.ContextMenuShowingEventArgs e)
{
// Suppress the control's existing context menu with a new context menu.
e.AssignedContextMenu = new ContextMenuStrip();

// Create new ToolStripMenuItem and add it to AssignedContextMenu.
ToolStripMenuItem toolStripMenuitem1 = new ToolStripMenuItem();
toolStripMenuitem1.Text = "Rotate";
e.AssignedContextMenu.Items.Add(toolStripMenuitem1);

// Create new ToolStripMenuItem and add it to AssignedContextMenu.
ToolStripMenuItem toolStripMenuitem2 = new ToolStripMenuItem();
toolStripMenuitem2.Text = "View";
e.AssignedContextMenu.Items.Add(toolStripMenuitem2);

// Set the value to hide/show the context menu.
e.Cancel = true;
}
}
}

Remarks​

If context menu displaying is disabled using this event, then both left and right mouse clicks will fire PdfViewerMouseClick event.

ControlAdded​

Occurs when a new control is added to the ControlCollection . (Inherited from Control)

public event ControlEventHandler PdfViewer.ControlAdded;
Public Event PdfViewer.ControlAdded As ControlEventHandler

Event Handler​

ControlEventHandler

ControlRemoved​

Occurs when a control is removed from the ControlCollection . (Inherited from Control)

public event ControlEventHandler PdfViewer.ControlRemoved;
Public Event PdfViewer.ControlRemoved As ControlEventHandler

Event Handler​

ControlEventHandler

CursorModeChanged​

Occurs when the cursor mode is changed.

public event CursorModeChangedEventHandler PdfViewer.CursorModeChanged;
Public Event PdfViewer.CursorModeChanged As CursorModeChangedEventHandler

Event Handler​

CursorModeChangedEventHandler

Examples​

This example demonstrates, how to get the current cursor mode using CursorModeChangedEventArgs class.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.CursorModeChanged, AddressOf MyPdfViewer_CursorModeChanged
End Sub

Private Sub MyPdfViewer_CursorModeChanged(ByVal sender As Object, ByVal e As CursorModeChangedEventArgs)
' Get the current cursor mode.
Dim MyCursorMode As CursorMode = e.CursorMode
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.CursorModeChanged += new ceTe.DynamicPDF.Viewer.CursorModeChangedEventHandler(this.pdfViewer_CursorModeChanged);
}

private void pdfViewer_CursorModeChanged(object sender, ceTe.DynamicPDF.Viewer.CursorModeChangedEventArgs e)
{
// Get the current cursor mode.
CursorMode cursorMode = e.CursorMode;
}
}
}

DialogShowing​

Occurs before the File open dialog and Print dialog is displayed.

public event DialogShowingEventHandler PdfViewer.DialogShowing;
Public Event PdfViewer.DialogShowing As DialogShowingEventHandler

Event Handler​

DialogShowingEventHandler

Examples​

This example shows, how to cancel a file open dialog display using DialogShowing event

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

Public Class Form1Inherits System.Windows.Forms.FormPrivate pdfViewer As PdfViewer
Public Sub New() InitializeComponent()End Sub
[STAThread]Private Shared Sub Main() Application.Run(New Form1())End Sub
Private Sub InitializeComponent() Me.pdfViewer = New PdfViewer() Me.Controls.Add(pdfViewer) AddHandler pdfViewer.DialogShowing, AddressOf Me.pdfViewer_DialogShowingEnd Sub
Private Sub pdfViewer_DialogShowing(sender As Object, e As ceTe.DynamicPDF.Viewer.DialogShowingEventArgs) ' Preventing File Open dialog from displaying using DialogShowing event. If e.DisplayingDialogType = DialogType.FileOpenDialog Then e.Cancel = True End IfEnd Sub
End Class
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;

namespace DynamicPDFViewerDemo
{public class Form1 : System.Windows.Forms.Form{ private PdfViewer pdfViewer;
public Form1() { InitializeComponent(); }
static void Main() { Application.Run(new Form1()); }
private void InitializeComponent() { this.pdfViewer = new PdfViewer(); this.Controls.Add(pdfViewer); pdfViewer.DialogShowing += new ceTe.DynamicPDF.Viewer.DialogShowingEventHandler(this.pdfViewer_DialogShowing); }
private void pdfViewer_DialogShowing(object sender, ceTe.DynamicPDF.Viewer.DialogShowingEventArgs e) { // Preventing File Open dialog from displaying using DialogShowing event. if (e.DisplayingDialogType == DialogType.FileOpenDialog) { e.Cancel = true; } }}
}

Disposed​

Occurs when the component is disposed by a call to the Dispose method. (Inherited from Component)

public event EventHandler PdfViewer.Disposed;
Public Event PdfViewer.Disposed As EventHandler

Event Handler​

EventHandler

DockChanged​

Occurs when the value of the Dock property changes. (Inherited from Control)

public event EventHandler PdfViewer.DockChanged;
Public Event PdfViewer.DockChanged As EventHandler

Event Handler​

EventHandler

DocumentDisplayed​

Occurs after the PDF document is displayed.

public event DocumentDisplayedEventHandler PdfViewer.DocumentDisplayed;
Public Event PdfViewer.DocumentDisplayed As DocumentDisplayedEventHandler

Event Handler​

DocumentDisplayedEventHandler

Examples​

This example shows, how to get displayed PDF document details using DocumentDisplayed event.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.DocumentDisplayed, AddressOf MyPdfViewer_DocumentDisplayed
End Sub

Private Sub MyPdfViewer_DocumentDisplayed(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.DocumentDisplayedEventArgs)
' Get the displayed PDF document details.
Dim Author As String = e.Document.Author
Dim MyBookmarks As BookmarkList = e.Document.Bookmarks
Dim Creator As String = e.Document.Creator
Dim Keywords As String = e.Document.Keywords
Dim PageCount As Integer = e.Document.PageCount
Dim Producer As String = e.Document.Producer
Dim Subject As String = e.Document.Subject
Dim Title As String = e.Document.Title
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.DocumentDisplayed += new ceTe.DynamicPDF.Viewer.DocumentDisplayedEventHandler(this.pdfViewer_DocumentDisplayed);
}

private void pdfViewer_DocumentDisplayed(object sender, ceTe.DynamicPDF.Viewer.DocumentDisplayedEventArgs e)
{
// Get the displayed PDF document details.
string Author = e.Document.Author;
BookmarkList Bookmarks = e.Document.Bookmarks;
string Creator = e.Document.Creator;
string Keywords = e.Document.Keywords;
int PageCount = e.Document.PageCount;
string Producer = e.Document.Producer;
string Subject = e.Document.Subject;
string Title = e.Document.Title;
}
}
}

DocumentDisplaying​

Occurs before the PDF document is displayed.

public event DocumentDisplayingEventHandler PdfViewer.DocumentDisplaying;
Public Event PdfViewer.DocumentDisplaying As DocumentDisplayingEventHandler

Event Handler​

DocumentDisplayingEventHandler

Examples​

This example shows, how to cancel a PDF file opening using DocumentDisplaying event

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.DocumentDisplaying, AddressOf MyPdfViewer_DocumentDisplaying
End Sub

Private Sub MyPdfViewer_DocumentDisplaying(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.DocumentDisplayingEventArgs)
' Setting the navigation panel's visible tab while displaying the document.
e.InitialVisibleNavigationPane = ceTe.DynamicPDF.Viewer.NavigationPane.Bookmark
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.DocumentDisplaying += new ceTe.DynamicPDF.Viewer.DocumentDisplayingEventHandler(this.pdfViewer_DocumentDisplaying);
}

private void pdfViewer_DocumentDisplaying(object sender, ceTe.DynamicPDF.Viewer.DocumentDisplayingEventArgs e)
{
// Setting the navigation panel's visible tab while displaying the document.
e.InitialVisibleNavigationPane = ceTe.DynamicPDF.Viewer.NavigationPane.Bookmark;
}
}
}

DocumentPrinted​

Occurs after the printing of the last page of the PDF document.

public event DocumentPrintedEventHandler PdfViewer.DocumentPrinted;
Public Event PdfViewer.DocumentPrinted As DocumentPrintedEventHandler

Event Handler​

DocumentPrintedEventHandler

DocumentPrinting​

Occurs before the start of the PDF document printing.

public event DocumentPrintingEventHandler PdfViewer.DocumentPrinting;
Public Event PdfViewer.DocumentPrinting As DocumentPrintingEventHandler

Event Handler​

DocumentPrintingEventHandler

DpiChangedAfterParent​

Occurs when the DPI setting for a control is changed programmatically after the DPI of its parent control or form has changed. (Inherited from Control)

public event EventHandler PdfViewer.DpiChangedAfterParent;
Public Event PdfViewer.DpiChangedAfterParent As EventHandler

Event Handler​

EventHandler

DpiChangedBeforeParent​

Occurs when the DPI setting for a control is changed programmatically before a DPI change event for its parent control or form has occurred. (Inherited from Control)

public event EventHandler PdfViewer.DpiChangedBeforeParent;
Public Event PdfViewer.DpiChangedBeforeParent As EventHandler

Event Handler​

EventHandler

DragDrop​

Occurs when a drag-and-drop operation is completed. (Inherited from Control)

public event DragEventHandler PdfViewer.DragDrop;
Public Event PdfViewer.DragDrop As DragEventHandler

Event Handler​

DragEventHandler

DragEnter​

Occurs when an object is dragged into the control's bounds. (Inherited from Control)

public event DragEventHandler PdfViewer.DragEnter;
Public Event PdfViewer.DragEnter As DragEventHandler

Event Handler​

DragEventHandler

DragLeave​

Occurs when an object is dragged out of the control's bounds. (Inherited from Control)

public event EventHandler PdfViewer.DragLeave;
Public Event PdfViewer.DragLeave As EventHandler

Event Handler​

EventHandler

DragOver​

Occurs when an object is dragged over the control's bounds. (Inherited from Control)

public event DragEventHandler PdfViewer.DragOver;
Public Event PdfViewer.DragOver As DragEventHandler

Event Handler​

DragEventHandler

EnabledChanged​

Occurs when the Enabled property value has changed. (Inherited from Control)

public event EventHandler PdfViewer.EnabledChanged;
Public Event PdfViewer.EnabledChanged As EventHandler

Event Handler​

EventHandler

Enter​

Occurs when the control is entered. (Inherited from Control)

public event EventHandler PdfViewer.Enter;
Public Event PdfViewer.Enter As EventHandler

Event Handler​

EventHandler

ExceptionOccurred​

Occurs before the PDF file is opened.

public event ExceptionOccurredEventHandler PdfViewer.ExceptionOccurred;
Public Event PdfViewer.ExceptionOccurred As ExceptionOccurredEventHandler

Event Handler​

ExceptionOccurredEventHandler

Examples​

This example shows, how to cancel a PDF file open using the FileOpening event.

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

Namespace DynamicPDFViewerDemoPublic Class Form1 Inherits Form Private pdfViewer As PdfViewer
Public Sub New() InitializeComponent() End Sub
Public Shared Sub Main() Application.Run(New Form1()) End Sub
Private Sub InitializeComponent() Me.pdfViewer = New PdfViewer() Me.Controls.Add(pdfViewer) AddHandler Me.pdfViewer.ExceptionOccurred, New ExceptionOccurredEventHandler(AddressOf pdfViewer_ExceptionOccurred) End Sub
Private Sub pdfViewer_ExceptionOccurred(sender As Object, e As ExceptionOccurredEventArgs) MessageBox.Show(e.Exception.Message) End SubEnd Class
End Namespace
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;

namespace DynamicPDFViewerDemo
{public class Form1 : Form{ private PdfViewer pdfViewer;
public Form1() { InitializeComponent(); }
[STAThread] static void Main() { Application.Run(new Form1()); }
private void InitializeComponent() { this.pdfViewer = new PdfViewer(); this.Controls.Add(pdfViewer); this.pdfViewer.ExceptionOccurred += pdfViewer_ExceptionOccurred; }
void pdfViewer_ExceptionOccurred(object sender, ExceptionOccurredEventArgs e) { MessageBox.Show(e.Exception.Message); }
}
}

FileOpenDialogShowing​

Occurs when the file open dialog is being displayed.

public event FileOpenDialogShowingEventHandler PdfViewer.FileOpenDialogShowing;
Public Event PdfViewer.FileOpenDialogShowing As FileOpenDialogShowingEventHandler

Event Handler​

FileOpenDialogShowingEventHandler

Examples​

This example shows, how to set initial directory of displaying file dialog using FileOpenDialogShowing event.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.FileOpenDialogShowing, AddressOf MyPdfViewer_FileOpenDialogShowing
End Sub

Private Sub MyPdfViewer_FileOpenDialogShowing(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.FileOpenDialogShowingEventArgs)
' Set the initial directory for the file dialog window.
e.InitialDirectory = "MyFolderPath"
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.FileOpenDialogShowing += new ceTe.DynamicPDF.Viewer.FileOpenDialogShowingEventHandler(this.pdfViewer_FileOpenDialogShowing);
}

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

private void pdfViewer_FileOpenDialogShowing(object sender, ceTe.DynamicPDF.Viewer.FileOpenDialogShowingEventArgs e)
{
// Set the initial directory for the file dialog window.
e.InitialDirectory = "MyFolderPath";
}
}
}

FileOpened​

Occurs after the PDF file is opened.

public event FileOpenedEventHandler PdfViewer.FileOpened;
Public Event PdfViewer.FileOpened As FileOpenedEventHandler

Event Handler​

FileOpenedEventHandler

Examples​

This example shows, how to get displayed PDF document details using FileOpened event.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.FileOpened, AddressOf MyPdfViewer_FileOpened
End Sub

Private Sub MyPdfViewer_FileOpened(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.FileOpenedEventArgs)
' Get the displayed PDF document details.
Dim Author As String = e.PdfDocument.Author
Dim MyBookmarks As BookmarkList = e.PdfDocument.Bookmarks
Dim Creator As String = e.PdfDocument.Creator
Dim Keywords As String = e.PdfDocument.Keywords
Dim PageCount As Integer = e.PdfDocument.PageCount
Dim Producer As String = e.PdfDocument.Producer
Dim Subject As String = e.PdfDocument.Subject
Dim Title As String = e.PdfDocument.Title
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.FileOpened += new ceTe.DynamicPDF.Viewer.FileOpenedEventHandler(this.pdfViewer_FileOpened);
}

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

private void pdfViewer_FileOpened(object sender, ceTe.DynamicPDF.Viewer.FileOpenedEventArgs e)
{
// Getting displayed PDF document details.
string Author = e.PdfDocument.Author;
BookmarkList Bookmarks = e.PdfDocument.Bookmarks;
string Creator = e.PdfDocument.Creator;
string Keywords = e.PdfDocument.Keywords;
int PageCount = e.PdfDocument.PageCount;
string Producer = e.PdfDocument.Producer;
string Subject = e.PdfDocument.Subject;
string Title = e.PdfDocument.Title;
}
}
}

FileOpenFailed​

Occurs when the PDF file open failed.

public event FileOpenFailedEventHandler PdfViewer.FileOpenFailed;
Public Event PdfViewer.FileOpenFailed As FileOpenFailedEventHandler

Event Handler​

FileOpenFailedEventHandler

Examples​

This example shows ,how to access exception details using FileOpenFailed event, in the case of PDF document open failure.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.FileOpenFailed, AddressOf MyPdfViewer_FileOpenFailed
End Sub

Private Sub MyPdfViewer_FileOpenFailed(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.FileOpenFailedEventArgs)
' Get the exception.
Dim failReason As String = e.Exception.Message
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.FileOpenFailed += new ceTe.DynamicPDF.Viewer.FileOpenFailedEventHandler(this.pdfViewer_FileOpenFailed);
}

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

private void pdfViewer_FileOpenFailed(object sender, ceTe.DynamicPDF.Viewer.FileOpenFailedEventArgs e)
{
// Get the exception.
string failReason = e.Exception.Message;
}
}
}

FileOpening​

Occurs before the PDF file is opened.

public event FileOpeningEventHandler PdfViewer.FileOpening;
Public Event PdfViewer.FileOpening As FileOpeningEventHandler

Event Handler​

FileOpeningEventHandler

Examples​

This example shows, how to cancel a PDF file open using the FileOpening event.

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)
AddHandler MyPdfViewer.FileOpening, AddressOf MyPdfViewer_FileOpening
End Sub

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

Private Sub MyPdfViewer_FileOpening(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.FileOpeningEventArgs)
' Cancel the file open.
e.Cancel = True
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.FileOpening += new ceTe.DynamicPDF.Viewer.FileOpeningEventHandler(this.pdfViewer_FileOpening);
}

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

private void pdfViewer_FileOpening(object sender, ceTe.DynamicPDF.Viewer.FileOpeningEventArgs e)
{
// Cancel the file open.
e.Cancel = true;
}
}
}

FontChanged​

Occurs when the Font property value changes. (Inherited from Control)

public event EventHandler PdfViewer.FontChanged;
Public Event PdfViewer.FontChanged As EventHandler

Event Handler​

EventHandler

ForeColorChanged​

Occurs when the ForeColor property value changes. (Inherited from Control)

public event EventHandler PdfViewer.ForeColorChanged;
Public Event PdfViewer.ForeColorChanged As EventHandler

Event Handler​

EventHandler

GiveFeedback​

Occurs during a drag operation. (Inherited from Control)

public event GiveFeedbackEventHandler PdfViewer.GiveFeedback;
Public Event PdfViewer.GiveFeedback As GiveFeedbackEventHandler

Event Handler​

GiveFeedbackEventHandler

GotFocus​

Occurs when the control receives focus. (Inherited from Control)

public event EventHandler PdfViewer.GotFocus;
Public Event PdfViewer.GotFocus As EventHandler

Event Handler​

EventHandler

HandleCreated​

Occurs when a handle is created for the control. (Inherited from Control)

public event EventHandler PdfViewer.HandleCreated;
Public Event PdfViewer.HandleCreated As EventHandler

Event Handler​

EventHandler

HandleDestroyed​

Occurs when the control's handle is in the process of being destroyed. (Inherited from Control)

public event EventHandler PdfViewer.HandleDestroyed;
Public Event PdfViewer.HandleDestroyed As EventHandler

Event Handler​

EventHandler

HelpRequested​

Occurs when the user requests help for a control. (Inherited from Control)

public event HelpEventHandler PdfViewer.HelpRequested;
Public Event PdfViewer.HelpRequested As HelpEventHandler

Event Handler​

HelpEventHandler

ImeModeChanged​

Occurs when the ImeMode property has changed. (Inherited from Control)

public event EventHandler PdfViewer.ImeModeChanged;
Public Event PdfViewer.ImeModeChanged As EventHandler

Event Handler​

EventHandler

Invalidated​

Occurs when a control's display requires redrawing. (Inherited from Control)

public event InvalidateEventHandler PdfViewer.Invalidated;
Public Event PdfViewer.Invalidated As InvalidateEventHandler

Event Handler​

InvalidateEventHandler

Layout​

Occurs when a control should reposition its child controls. (Inherited from Control)

public event LayoutEventHandler PdfViewer.Layout;
Public Event PdfViewer.Layout As LayoutEventHandler

Event Handler​

LayoutEventHandler

Leave​

Occurs when the input focus leaves the control. (Inherited from Control)

public event EventHandler PdfViewer.Leave;
Public Event PdfViewer.Leave As EventHandler

Event Handler​

EventHandler

LinkClicked​

Occurs when user clicks on a link.

public event LinkClickEventHandler PdfViewer.LinkClicked;
Public Event PdfViewer.LinkClicked As LinkClickEventHandler

Event Handler​

LinkClickEventHandler

Examples​

This example demonstrates, how to get the link Action and how to cancel the action associated with the link using LinkClickedEventArgs class.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.LinkClicked, AddressOf MyPdfViewer_LinkClicked
End Sub

Private Sub MyPdfViewer_LinkClicked(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.LinkClickedEventArgs)
' Get the action associated with the link.
Dim MyAction As ceTe.DynamicPDF.Viewer.Action = e.Action

' Get the action type.
Dim MyActionType As ceTe.DynamicPDF.Viewer.ActionType = MyAction.ActionType

' Cancel the action associated with the link
e.Cancel = True
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.LinkClicked += new ceTe.DynamicPDF.Viewer.LinkClickEventHandler(this.pdfViewer_LinkClicked);
}

private void pdfViewer_LinkClicked(object sender, ceTe.DynamicPDF.Viewer.LinkClickedEventArgs e)
{
// Get the action associated with the link.
ceTe.DynamicPDF.Viewer.Action action = e.Action;

// Get the action type.
ceTe.DynamicPDF.Viewer.ActionType actionType = action.ActionType;

// Cancel the action associated with the link
e.Cancel = true;
}
}
}

LocationChanged​

Occurs when the Location property value has changed. (Inherited from Control)

public event EventHandler PdfViewer.LocationChanged;
Public Event PdfViewer.LocationChanged As EventHandler

Event Handler​

EventHandler

LostFocus​

Occurs when the control loses focus. (Inherited from Control)

public event EventHandler PdfViewer.LostFocus;
Public Event PdfViewer.LostFocus As EventHandler

Event Handler​

EventHandler

MarginChanged​

Occurs when the control's margin changes. (Inherited from Control)

public event EventHandler PdfViewer.MarginChanged;
Public Event PdfViewer.MarginChanged As EventHandler

Event Handler​

EventHandler

Move​

Occurs when the control is moved. (Inherited from Control)

public event EventHandler PdfViewer.Move;
Public Event PdfViewer.Move As EventHandler

Event Handler​

EventHandler

PaddingChanged​

Occurs when the control's padding changes. (Inherited from Control)

public event EventHandler PdfViewer.PaddingChanged;
Public Event PdfViewer.PaddingChanged As EventHandler

Event Handler​

EventHandler

PagePrinting​

Occurs before the start of printing a PDF page.

public event PagePrintingEventHandler PdfViewer.PagePrinting;
Public Event PdfViewer.PagePrinting As PagePrintingEventHandler

Event Handler​

PagePrintingEventHandler

Paint​

Occurs when the control is redrawn. (Inherited from Control)

public event PaintEventHandler PdfViewer.Paint;
Public Event PdfViewer.Paint As PaintEventHandler

Event Handler​

PaintEventHandler

ParentChanged​

Occurs when the Parent property value changes. (Inherited from Control)

public event EventHandler PdfViewer.ParentChanged;
Public Event PdfViewer.ParentChanged As EventHandler

Event Handler​

EventHandler

PasswordRequired​

Occurs when the PDF file needed a password to open.

public event PasswordRequiredEventHandler PdfViewer.PasswordRequired;
Public Event PdfViewer.PasswordRequired As PasswordRequiredEventHandler

Event Handler​

PasswordRequiredEventHandler

Examples​

This example shows,how to set password of a PDF file using PasswordRequired event

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.PasswordRequired, AddressOf pdfViewer_PasswordRequired
End Sub

Private Sub pdfViewer_PasswordRequired(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.PasswordRequiredEventArgs)
' Setting PDF password to open the file.
e.Password = "mypassword"
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.PasswordRequired += new ceTe.DynamicPDF.Viewer.PasswordRequiredEventHandler(this.pdfViewer_PasswordRequired);
}

private void pdfViewer_PasswordRequired(object sender, ceTe.DynamicPDF.Viewer.PasswordRequiredEventArgs e)
{
// Setting PDF password to open the file.
e.Password = "mypassword";
}
}
}

PdfViewerMouseClick​

Occurs when user clicks on a PdfViewer control.

public event PdfViewerMouseEventHandler PdfViewer.PdfViewerMouseClick;
Public Event PdfViewer.PdfViewerMouseClick As PdfViewerMouseEventHandler

Event Handler​

PdfViewerMouseEventHandler

Examples​

This example demonstrates, how to get the click event with information about the page co-ordinates using PdfViewerMouseEventArgs class.

Imports System
Imports System.Windows.Forms
Imports ceTe.DynamicPDF.Viewer
Imports System.Drawing
Public Class Form1
Inherits System.Windows.Forms.Form

Private MyPdfViewer As PdfViewer

Sub New()
InitializeComponent()
End Sub

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.PdfViewerMouseClick, AddressOf MyPdfViewer_MouseClicked
End Sub

Private Sub MyPdfViewer_MouseClicked(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.PdfViewerMouseEventArgs)
' Get the co-ordinates on the control.
Dim ControlCoordinate As Point = e.Location

' Get the page number.
Dim PageNumber As Integer = e.PageNumber

' Get the co-ordinates on the page (in PDF points).
Dim PageCoordinateX As Integer = e.PageX
Dim PageCoordinateY As Integer = e.PageY
End Sub

End Class
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;
using System.Drawing;
namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.PdfViewerMouseClick += new ceTe.DynamicPDF.Viewer.PdfViewerMouseEventHandler(this.pdfViewer_MouseClicked);
}

private void pdfViewer_MouseClicked(object sender, ceTe.DynamicPDF.Viewer.PdfViewerMouseEventArgs e)
{
// Get the co-ordinates on the control.
Point controlCoordinate = e.Location;

// Get the page number.
int pageNumber = e.PageNumber;

// Get the co-ordinates on the page (in PDF points).
int pageCoordinateX = e.PageX;
int pageCoordinateY = e.PageY;
}
}
}

Remarks​

By default this event fires only for left mouse click. For handling right mouse click ContextMenuShowing event can be used. If context menu displaying is disabled using ContextMenuShowing event, then both left and right mouse clicks will fire this event.

PdfViewerMouseMove​

Occurs when user moves the mouse pointer on a PdfViewer control.

public event PdfViewerMouseEventHandler PdfViewer.PdfViewerMouseMove;
Public Event PdfViewer.PdfViewerMouseMove As PdfViewerMouseEventHandler

Event Handler​

PdfViewerMouseEventHandler

Examples​

This example demonstrates, how to get the mouse move event with information about the page co-ordinates using PdfViewerMouseEventArgs class.

Imports System
Imports System.Windows.Forms
Imports ceTe.DynamicPDF.Viewer
Imports System.Drawing
Public Class Form1
Inherits System.Windows.Forms.Form

Private MyPdfViewer As PdfViewer

Sub New()
InitializeComponent()
End Sub

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.PdfViewerMouseMove, AddressOf MyPdfViewer_MouseMoved
End Sub

Private Sub MyPdfViewer_MouseMoved(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.PdfViewerMouseEventArgs)
' Get the co-ordinates on the control.
Dim ControlCoordinate As Point = e.Location

' Get the page number.
Dim PageNumber As Integer = e.PageNumber

' Get the co-ordinates on the page (in PDF points).
Dim PageCoordinateX As Integer = e.PageX
Dim PageCoordinateY As Integer = e.PageY
End Sub

End Class
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;
using System.Drawing;
namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.PdfViewerMouseMove += new ceTe.DynamicPDF.Viewer.PdfViewerMouseEventHandler(this.pdfViewer_MouseMoved);
}

private void pdfViewer_MouseMoved(object sender, ceTe.DynamicPDF.Viewer.PdfViewerMouseEventArgs e)
{
// Get the co-ordinates on the control.
Point controlCoordinate = e.Location;

// Get the page number.
int pageNumber = e.PageNumber;

// Get the co-ordinates on the page (in PDF points).
int pageCoordinateX = e.PageX;
int pageCoordinateY = e.PageY;
}
}
}

QueryAccessibilityHelp​

Occurs when AccessibleObject is providing help to accessibility applications. (Inherited from Control)

public event QueryAccessibilityHelpEventHandler PdfViewer.QueryAccessibilityHelp;
Public Event PdfViewer.QueryAccessibilityHelp As QueryAccessibilityHelpEventHandler

Event Handler​

QueryAccessibilityHelpEventHandler

QueryContinueDrag​

Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled. (Inherited from Control)

public event QueryContinueDragEventHandler PdfViewer.QueryContinueDrag;
Public Event PdfViewer.QueryContinueDrag As QueryContinueDragEventHandler

Event Handler​

QueryContinueDragEventHandler

RegionChanged​

Occurs when the value of the Region property changes. (Inherited from Control)

public event EventHandler PdfViewer.RegionChanged;
Public Event PdfViewer.RegionChanged As EventHandler

Event Handler​

EventHandler

Resize​

Occurs when the control is resized. (Inherited from Control)

public event EventHandler PdfViewer.Resize;
Public Event PdfViewer.Resize As EventHandler

Event Handler​

EventHandler

RightToLeftChanged​

Occurs when the RightToLeft property value changes. (Inherited from Control)

public event EventHandler PdfViewer.RightToLeftChanged;
Public Event PdfViewer.RightToLeftChanged As EventHandler

Event Handler​

EventHandler

SearchDialogShowing​

Occurs when the search dialog is being displayed.

public event SearchDialogShowingEventHandler PdfViewer.SearchDialogShowing;
Public Event PdfViewer.SearchDialogShowing As SearchDialogShowingEventHandler

Event Handler​

SearchDialogShowingEventHandler

Examples​

This example shows, how to hide the search dialog and set the match option for search using SearchDialogShowing event.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.SearchDialogShowing, AddressOf MyPdfViewer_SearchDialogShowing
End Sub

Private Sub MyPdfViewer_SearchDialogShowing(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.SearchDialogShowingEventArgs)
' Hide the search dialog.
e.Cancel = True

' Set the match option for search
e.MatchOption = MatchOptions.WholeWordOnly
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.SearchDialogShowing += new ceTe.DynamicPDF.Viewer.SearchDialogShowingEventHandler(this.pdfViewer_SearchDialogShowing);
}

private void pdfViewer_SearchDialogShowing(object sender, ceTe.DynamicPDF.Viewer.SearchDialogShowingEventArgs e)
{
// Hide the search dialog.
e.Cancel = true;

// Set the match option for search
e.MatchOption = MatchOptions.WholeWordOnly;
}
}
}

Searched​

Occurs when the search term is found successfully.

public event SearchedEventHandler PdfViewer.Searched;
Public Event PdfViewer.Searched As SearchedEventHandler

Event Handler​

SearchedEventHandler

Examples​

This example demonstrates, how to get the count of successful search results and status of search completion using SearchedEventArgs class.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.Searched, AddressOf pdfViewer_Searched
End Sub

Private Sub pdfViewer_Searched(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.SearchedEventArgs)
' Get the status of search completion.
Dim searchStatus As SearchStatus = e.Status

' Get the count of search results found.
Dim count As Integer = e.Count
End Sub
End Class
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;

namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.Searched += new ceTe.DynamicPDF.Viewer.SearchedEventHandler(this.pdfViewer_Searched);
}

private void pdfViewer_Searched(object sender, ceTe.DynamicPDF.Viewer.SearchedEventArgs e)
{
// Get the status of search completion.
SearchStatus searchStatus = e.Status;

// Get the count of search results found.
int count = e.Count;
}
}
}

SearchProgressing​

Occurs when the search for a string is in progress.

public event SearchProgressingEventHandler PdfViewer.SearchProgressing;
Public Event PdfViewer.SearchProgressing As SearchProgressingEventHandler

Event Handler​

SearchProgressingEventHandler

Examples​

This example demonstrates, how to get the search term, match option used, current page numberwhere search is going on and cancelling the search using SearchProgressingEventArgs class.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.SearchProgressing, AddressOf MyPdfViewer_SearchProgressing
End Sub

Private Sub MyPdfViewer_SearchProgressing(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.SearchProgressingEventArgs)
' Get the search string.
Dim MysearchTerm As String = e.SearchTerm

' Get the Match option used for searching.
Dim [option] As MatchOptions = DirectCast(e.MatchOption, MatchOptions)

' If user wants to cancel the search. Use the below commented code.
'e.Cancel = true;

' Get the current page number where search is in progress.
Dim pagenumber As Integer = e.CurrentPageNumber
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.SearchProgressing += new ceTe.DynamicPDF.Viewer.SearchProgressingEventHandler(this.pdfViewer_SearchProgressing);
}

private void pdfViewer_SearchProgressing(object sender, ceTe.DynamicPDF.Viewer.SearchProgressingEventArgs e)
{
// Get the search string.
string searchTerm = e.SearchTerm;

// Get the Match option used for searching.
MatchOptions option = (MatchOptions)e.MatchOption;

// If user wants to cancel the search. Use the below commented code.
//e.Cancel = true;

// Get the current page number where search is in progress.
int pagenumber = e.CurrentPageNumber;
}
}
}

Remarks​

To cancel the search which is in progress set the value of Cancel to true otherwise by default it is false.

SizeChanged​

Occurs when the Size property value changes. (Inherited from Control)

public event EventHandler PdfViewer.SizeChanged;
Public Event PdfViewer.SizeChanged As EventHandler

Event Handler​

EventHandler

StyleChanged​

Occurs when the control style changes. (Inherited from Control)

public event EventHandler PdfViewer.StyleChanged;
Public Event PdfViewer.StyleChanged As EventHandler

Event Handler​

EventHandler

SystemColorsChanged​

Occurs when the system colors change. (Inherited from Control)

public event EventHandler PdfViewer.SystemColorsChanged;
Public Event PdfViewer.SystemColorsChanged As EventHandler

Event Handler​

EventHandler

TabIndexChanged​

Occurs when the TabIndex property value changes. (Inherited from Control)

public event EventHandler PdfViewer.TabIndexChanged;
Public Event PdfViewer.TabIndexChanged As EventHandler

Event Handler​

EventHandler

TabStopChanged​

Occurs when the TabStop property value changes. (Inherited from Control)

public event EventHandler PdfViewer.TabStopChanged;
Public Event PdfViewer.TabStopChanged As EventHandler

Event Handler​

EventHandler

TextSelected​

Occurs when the text selection is completed.

public event TextSelectedEventHandler PdfViewer.TextSelected;
Public Event PdfViewer.TextSelected As TextSelectedEventHandler

Event Handler​

TextSelectedEventHandler

Examples​

This example shows how to get selected text, when text selection done using TextSelected event.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.TextSelected, AddressOf MyPdfViewer_TextSelected
End Sub

Private Sub MyPdfViewer_TextSelected(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.TextSelectedEventArgs) ' Get the selected text.
Dim MySelectedText As String = e.SelectedText
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.TextSelected += new ceTe.DynamicPDF.Viewer.TextSelectedEventHandler(this.pdfViewer_TextSelected);
}

private void pdfViewer_TextSelected(object sender, ceTe.DynamicPDF.Viewer.TextSelectedEventArgs e)
{
// Get the selected text.
string selectedText = e.SelectedText;
}
}
}

TextSelecting​

Occurs when the text is being selected.

public event TextSelectingEventHandler PdfViewer.TextSelecting;
Public Event PdfViewer.TextSelecting As TextSelectingEventHandler

Event Handler​

TextSelectingEventHandler

Examples​

This example shows how to disable or cancel text selection using TextSelecting event.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.TextSelecting, AddressOf MyPdfViewer_TextSelecting
End Sub

Private Sub MyPdfViewer_TextSelecting(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.TextSelectingEventArgs)
' Cencel the text selection.
e.Cancel = True
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.TextSelecting += new ceTe.DynamicPDF.Viewer.TextSelectingEventHandler(this.pdfViewer_TextSelecting);
}

private void pdfViewer_TextSelecting(object sender, ceTe.DynamicPDF.Viewer.TextSelectingEventArgs e)
{
// Cancel the text selection.
e.Cancel = true;
}
}
}

Validated​

Occurs when the control is finished validating. (Inherited from Control)

public event EventHandler PdfViewer.Validated;
Public Event PdfViewer.Validated As EventHandler

Event Handler​

EventHandler

Validating​

Occurs when the control is validating. (Inherited from Control)

public event CancelEventHandler PdfViewer.Validating;
Public Event PdfViewer.Validating As CancelEventHandler

Event Handler​

CancelEventHandler

ViewChanged​

Occurs each time when the view of the display is changed.

public event ViewChangedEventHandler PdfViewer.ViewChanged;
Public Event PdfViewer.ViewChanged As ViewChangedEventHandler

Event Handler​

ViewChangedEventHandler

Examples​

This example demonstrates, how to get the changed view and add it to history using ViewChangedEventArgs class.

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

Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.ViewChanged, AddressOf MyPdfViewer_ViewChanged
End Sub

Private Sub MyPdfViewer_ViewChanged(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.ViewChangedEventArgs)
' Get the changed view.
Dim changedView As ceTe.DynamicPDF.Viewer.View = e.PreviousView

' Setting to false, will exclude this view from storing into the view history.
e.AddViewToHistory = False
End Sub

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

namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private PdfViewer pdfViewer;

public Form1()
{
InitializeComponent();
}

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

private void InitializeComponent()
{
this.pdfViewer = new PdfViewer();
this.Controls.Add(pdfViewer);
pdfViewer.ViewChanged += new ceTe.DynamicPDF.Viewer.ViewChangedEventHandler(this.pdfViewer_ViewChanged);
}

private void pdfViewer_ViewChanged(object sender, ceTe.DynamicPDF.Viewer.ViewChangedEventArgs e)
{
// Get the changed view.
ceTe.DynamicPDF.Viewer.View changedView = e.PreviousView;

// Setting to false, will exclude this view from storing into the view history.
e.AddViewToHistory = false;
}
}
}

VisibleChanged​

Occurs when the Visible property value changes. (Inherited from Control)

public event EventHandler PdfViewer.VisibleChanged;
Public Event PdfViewer.VisibleChanged As EventHandler

Event Handler​

EventHandler

See Also​

ceTe.DynamicPDF.Viewer

Documentation version