View
Represents the view containing the attributes which defines the display.
public class View
Public Class View
Inheritance: ObjectView
Licensing Info
This class is a DynamicPDF Viewer feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Viewer selected.
- A DynamicPDF Viewer for .NET v3.X Developer license.
Examples
The following example will show how to get a 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
Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler Me.Load, New EventHandler(AddressOf Form1_Load)
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 Initial view of the document
Dim MyInitialView As ceTe.DynamicPDF.Viewer.View = MyPdfViewer.GetInitialView()
' Get the details from a view
Dim pageNumber As Integer = MyCurrentView.StartPageNumber
Dim zoomValue As Single = MyCurrentView.ZoomPercent
Dim MyDisplayMode As PageDisplayMode = MyCurrentView.PageDisplayMode
Dim MyZoomMode As Zoom = MyCurrentView.ZoomMode
Dim pageOrientation 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 Initial view of the document
ceTe.DynamicPDF.Viewer.View initialView = pdfViewer.GetInitialView();
// Get the details from a view
int pageNumber = currentView.StartPageNumber;
float zoomValue = currentView.ZoomPercent;
PageDisplayMode displayMode = currentView.PageDisplayMode;
Zoom zoomMode = currentView.ZoomMode;
ceTe.DynamicPDF.Viewer.Orientation pageOrientation = currentView.PageOrientation;
}
}
}
Properties
CurrentPageNumber | Gets the current page number of the view. |
CurrentScrollXPosition | Gets the current horizontal scroll position of the page. |
CurrentScrollYPosition | Gets the current vertical scroll position of the page. |
MaxScrollX | Gets the maximum horizontal scroll value possible based on current view. |
MaxScrollY | Gets the maximum verical scroll value possible based on current view. |
PageDisplayMode | Gets the page display mode of the view. |
PageOrientation | Gets the page orientation of the view. |
StartPageNumber | Gets the start page number of the view. |
ZoomMode | Gets the zoom mode of the view. |
ZoomPercent | Gets the zoom percent of the view. |
Methods
Equals(Object) | Determines whether the specified View object is equal to the current View object. |
GetHashCode() | |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |