PdfViewer.Navigate

Overloads

Navigate(Action)Navigate to the destination stored in the Action object of the link.
Navigate(Bookmark)Navigate to the Bookmark specified.
Navigate(View)Navigates to the View specified.
Navigate(View, Int32, Int32)Navigates to the View specified.

Navigate(Action)

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

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

Parameters

action
Action

The Action object containing the information about the link.

Licensing Info

This method 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 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 dpdfViewer;

        public Form1()
        {
             InitializeComponent();
        }

        [STAThread]
        static void Main()
        {
            Application.Run(new Form1());
        }						                				
											
        private void InitializeComponent()
        {
            this.dpdfViewer = new PdfViewer();
            this.Controls.Add(dpdfViewer);
            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.Navigate(action);
        }
    }
}

Remarks

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

Navigate(Bookmark)

Navigate to the Bookmark specified.

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

Parameters

bookmark
Bookmark

The Bookmark to move to.

Licensing Info

This method 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 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 dpdfViewer;

        public Form1()
        {
            InitializeComponent();
        }

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

        private void NavigationToBookmark()
        {
            // Get a PDF document object and open in viewer.
            PdfDocument document = new PdfDocument(@"C:\MyDocument.pdf");
            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.
            Navigate(bookmark);
        }
    }
}

Navigate(View)

Navigates to the View specified.

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

Parameters

view
View

The View to move to.

Licensing Info

This method is a DynamicPDF Viewer feature. One of the following is required for non-evaluation usage:

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

        public Form1()
        {
            InitializeComponent();
        }

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

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

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

Navigate(View, Int32, Int32)

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

view
View

The View to move to.

offsetX
Int32

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

offsetY
Int32

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

Licensing Info

This method is a DynamicPDF Viewer feature. One of the following is required for non-evaluation usage:

See Also

PdfViewer
ceTe.DynamicPDF.Viewer

In this topic