Page Navigation in WPF Pdf Viewer

PDF Viewer allows you to navigate through the pages of the PDF document using the GotoPage method. The following code example illustrates the navigation to page 2 of the PDF document.

//Initialize PDF Viewer.

PdfViewerControl pdfViewer1 = new PdfViewerControl();



//Load the PDF.

pdfViewer1.Load("Sample.pdf");


//Navigate to page 2

pdfviewer1.GotoPage(2);
'Initialize PDF Viewer.

Private pdfViewer1 As New PdfViewerControl()



'Load the PDF.

pdfViewer1.Load("Sample.pdf")

'Navigate to page 2

pdfviewer1.GotoPage(2)

You can now scroll to the given horizontal and vertical offset of the PDF document programmatically using the ScrollTo method of PdfViewerControl. Refer to the following code to scroll the PDF document to the horizontal and vertical offset of 160 and 400 respectively.

//Initialize PDF Viewer.
PdfViewerControl pdfViewerControl = new PdfViewerControl();

//Load the PDF.
pdfViewerControl.Load("Sample.pdf");

//Navigate to the horizontal and vertical offset of 160 and 400 respectively
pdfViewerControl.ScrollTo (160, 400);
'Initialize PDF Viewer.
Private pdfViewerControl As New PdfViewerControl()

'Load the PDF.
pdfViewerControl.Load("Sample.pdf")

'Navigate to the horizontal and vertical offset of 160 and 400 respectively
pdfViewerControl.ScrollTo (160, 400)