Page Navigation in WPF Pdf Viewer
4 Sep 2020 / 1 minute to read
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)
Navigate to the horizontal and vertical offset
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)
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page