PageVisibleArea

Provides the details of visible area of a page.

public class PageVisibleArea
Public Class PageVisibleArea

Inheritance: ObjectPageVisibleArea

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 we can get the array of PageVisibleArea for a 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 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)

        'Get a view to calculate visible page area
        Dim MyCurrentView As ceTe.DynamicPDF.Viewer.View = MyPdfViewer.GetCurrentView()

        'Get the array of pages with their visible area
        Dim MyVisibleAreaArray As PageVisibleArea() = MyPdfViewer.GetPageVisibleArea(MyCurrentView)

        'Get the details of visible page area
        Dim pageNumber As Integer = MyVisibleAreaArray(0).PageNumber
        Dim left As Single = MyVisibleAreaArray(0).Left
        Dim top As Single = MyVisibleAreaArray(0).Top
        Dim right As Single = MyVisibleAreaArray(0).Right
        Dim bottom As Single = MyVisibleAreaArray(0).Bottom

    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);

            // Get a view to calculate visible page area
            ceTe.DynamicPDF.Viewer.View currentView = pdfViewer.GetCurrentView();

            // Get the array of pages with their visible area
            PageVisibleArea[] visibleAreaArray = pdfViewer.GetPageVisibleArea(currentView);

            // Get the details of visible page area
            int pageNumber = visibleAreaArray[0].PageNumber;
            float left = visibleAreaArray[0].Left;
            float top = visibleAreaArray[0].Top;
            float right = visibleAreaArray[0].Right;
            float bottom = visibleAreaArray[0].Bottom;
        }
    }
}

Properties

BottomGets the bottom value of the page.
LeftGets the left value of the page.
PageNumberGets the page number.
PixelBottomGets the bottom display end position of the page in pixels.
PixelLeftGets the left display start position of the page in pixels.
PixelRightGets the right display end position of the page in pixels.
PixelTopGets the top display start position of the page in pixels.
RightGets the right value of the page.
TopGets the top value of the page.

Methods

Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from 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