New to Telerik UI for WinUI? Download free 30-day trial

Scrolling

The PdfViewer has a built-in scrolling mechanism.

Scrolling with the Scrollbars

You can scroll with the horizontal and vertical scrollbars of the control by dragging them, or by using the arrow keys of the keyboard or the mouse wheel.

WinUI RadPdfViewer

Programmatic Scrolling

The PdfViewer exposes the following properties related to the scrolling functionality that can be used to access or modify the scrolling behavior and appearance:

  • HorizontalScrollBar—Holds a reference to the horizontal ScrollBar control. You can use this property to access the scrollbar and update its value or change its appearance.
  • VerticalScrollBar—Holds a reference to the vertical ScrollBar control. You can use this property to access the scrollbar and update its value or change its appearance.
  • CanHorizontallyScroll—Indicates if the document can be scrolled horizontally. This property has only a getter and is true when the horizontal scrollbar is rendered.
  • CanVerticallyScroll—Indicates if the document can be scrolled vertically. This property has only a getter and is true when the vertical scrollbar is rendered.
  • HorizontalScrollOffset—Gets the current horizontal scroll offset.
  • VerticalScrollOffset—Gets the current vertical scroll offset.

To enable manual scrolling, set the Value property of the ScrollBar elements, or use the ScrollToHorizontalOffset and ScrollToVerticalOffset methods of the PdfViewer.

Scroll to the horizontal offset

this.pdfViewer.ScrollToHorizontalOffset(50); 

Scroll to the vertical offset

this.pdfViewer.ScrollToVerticalOffset(50); 
The PdfViewer also allows you to scroll to a specific position in the document with the GoToDestination method.

Scroll to a destination

Destination destination = new Location() { Page = this.pdfViewer.Document.Pages[2], Left = 0, Top = 0, Zoom = 1 }; 
this.pdfViewer.GoToDestination(destination); 

See Also

In this article
Not finding the help you need?