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:

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

CurrentPageNumberGets the current page number of the view.
CurrentScrollXPositionGets the current horizontal scroll position of the page.
CurrentScrollYPositionGets the current vertical scroll position of the page.
MaxScrollXGets the maximum horizontal scroll value possible based on current view.
MaxScrollYGets the maximum verical scroll value possible based on current view.
PageDisplayModeGets the page display mode of the view.
PageOrientationGets the page orientation of the view.
StartPageNumberGets the start page number of the view.
ZoomModeGets the zoom mode of the view.
ZoomPercentGets the zoom percent of the view.

Methods

Equals(Object)Determines whether the specified View object is equal to the current View object.
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF.Viewer

In this topic