Skip to main content

Page Navigation

  • 3 minutes to read

This document explains how to navigate through pages in the PDF Viewer control.

Use the following commands to implement your own your UI that allows users to navigate to specific pages:

The example below implements a navigation panel in a PDF viewer app:

<Grid Grid.Row="1" HorizontalOptions="Fill" Background="#ECE6F0">
    <StackLayout Orientation="Horizontal" HorizontalOptions="Center" VerticalOptions="Center" Grid.Row="2" >
        <Button ImageSource="first" Style="{StaticResource btnStyle}"
                Command="{Binding Commands.GoToFirstPage, Source={x:Reference pdfViewer}}" />
        <Button ImageSource="previous" Style="{StaticResource btnStyle}"
                Command="{Binding Commands.GoToPreviousPage, Source={x:Reference pdfViewer}}" />
        <Label Text="{Binding CurrentPageNumber, Source={x:Reference pdfViewer}}" Padding="4" VerticalOptions="Center" />
        <Button ImageSource="next" Style="{StaticResource btnStyle}"
                Command="{Binding Commands.GoToNextPage, Source={x:Reference pdfViewer}}" />
        <Button ImageSource="last" Style="{StaticResource btnStyle}"
                Command="{Binding Commands.GoToLastPage, Source={x:Reference pdfViewer}}" />
    </StackLayout>
</Grid>

Users can tap the page counter to invoke the Go to page dialog:

DevExpress PDF Viewer for .NET MAUI

Search Through Document Content

Use PdfViewerCommands.SearchForward and PdfViewerCommands.SearchBackward commands to search for the specified text in the document.

The first SearchForward or SearchBackward command call searches for the first occurrence of the search query string starting from the document beginning. Consecutive command calls continue the search forward or backward respectively.

Use the following properties to configure search filters:

  • SearchCaseSensitive - Allows you differentiate between uppercase and lowercase letters. If SearchCaseSensitive is true, “viewer”, “Viewer” and “VIEWER” are different words.

  • SearchWholeWords - Allows you to look for whole words when searching for a given string.

Show Outlines

The built-in Outlines page contains a list of bookmarks that allow users to navigate between different document sections. Users can tap the Outlines icon DevExpress PDF Viewer for .NET MAUI to view PDF document outlines.

DevExpress PDF Viewer for .NET MAUI

The Outlines icon appears disabled if the viewed document does not have outlines (no Outlines entry in the document catalogue).

To check whether the Outlines page is currently visible, use the IsOutlinesViewOpened property.

You can use the ToggleOutlines command to invoke Outlines programmatically.

Show Thumbnails

The built-in Thumbnails page shows preview images for all document pages. Users can tap the Thumbnails icon ~DevExpress PDF Viewer for .NET MAUI to view thumbnails.

DevExpress PDF Viewer for .NET MAUI

To check whether the Thumbnails page is currently visible, use the IsThumbnailsViewOpened property.

You can use the ToggleThumbnails command to invoke Thumbnails programmatically.

Zoom the Document

Users can use pinch gestures to zoom document in and out. To obtain the current zoom level, use the ZoomFactor property. The possible values range from 0.2 to 5, where 0.2 means that the page occupies 20% of the screen width and 5 corresponds to the maximum supported zoom level (500%).

Specify MinZoomFactor and MaxZoomFactor properties to constrain minimum and maximum zoom levels for users.

You can bind to ZoomIn and ZoomOut commands to zoom the document programmatically.