You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MAUI/PDF-Viewer/Scrolling.md
+36-10Lines changed: 36 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,32 @@
1
1
---
2
2
layout: post
3
3
title: Scrolling in .NET MAUI PDF Viewer Control | Syncfusion
4
-
description: Learn here all about scrolling functionality in .NET MAUI PDF Viewer including programmatically setting scroll positions and detecting scroll changes.
4
+
description: Explore scrolling features in .NET MAUI PDF Viewer, including how to set scroll positions programmatically and detect scroll changes in real time.
5
5
platform: MAUI
6
6
control: SfPdfViewer
7
7
documentation: ug
8
8
---
9
9
10
10
# Scrolling in .NET MAUI PDF Viewer (SfPdfViewer)
11
11
12
-
The NET MAUI PDF Viewer has scrolling capabilities that allow users to navigate through content seamlessly. This section will walk you through various aspects of scrolling, including programmatically setting scroll positions and detecting scroll changes.
12
+
The .NET MAUI PDF Viewer provides built-in scrolling capabilities that allow users to navigate through PDF content smoothly. This guide covers how to control scroll positions programmatically, detect scroll changes, and manage scroll-related UI elements.
13
13
14
-
W> Please note that since the PDF Viewer has built-in scrolling capability, it is advised to avoid placing the PDF Viewer inside other controls that also offer scrolling, such as [ScrollView](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/scrollview?view=net-maui-8.0). Nesting within such controls may cause unexpected issues.
14
+
W> Since the PDF Viewer includes built-in scrolling, avoid placing it inside other scrollable containers like [ScrollView](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/scrollview?view=net-maui-8.0), as this may lead to unexpected behavior.
15
15
16
-
## Navigate to the desired offset programmatically
16
+
## Programmatic Scrolling
17
17
18
-
The [ScrollToOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ScrollToOffset_System_Double_System_Double_) method moves the scroll position of the SfPdfViewer to the specified horizontal and vertical offsets. If the specified offset value is wrong, the scroll will not happen, and the older position will be retained. The offset values are represented in device-independent units.
18
+
Use the [ScrollToOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ScrollToOffset_System_Double_System_Double_) method to scroll to a specific horizontal and vertical offset. Offset values are measured in **device-independent units**. If the specified offset is invalid or out of bounds, the scroll action will be ignored and the viewer will retain its current position.
19
19
20
20
{% tabs %}
21
21
{% highlight c# %}
22
-
// Navigate to the scroll offset position (100,1000).
22
+
// Scroll to position (100,1000)
23
23
PdfViewer.ScrollToOffset(100, 1000);
24
24
{% endhighlight %}
25
25
{% endtabs %}
26
26
27
-
## Scroll changes detection
27
+
## Detect Scroll Changes
28
28
29
-
The `PropertyChanged` event can be used to identify the scroll changes in the PDF Viewer effectively. By monitoring the [HorizontalOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_HorizontalOffset) and [VerticalOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_VerticalOffset) property changes, you can respond to both the horizontal and vertical scroll movements respectively.
29
+
You can monitor scroll changes using the `PropertyChanged` event. By monitoring the [HorizontalOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_HorizontalOffset) and [VerticalOffset](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_VerticalOffset) property changes, you can respond to both the horizontal and vertical scroll movements respectively.
30
30
31
31
The following is the code example for subscribing to the `PropertyChanged` event.
Handle scroll changes by implementing the event handler method. The following code example illustrates how to respond to both horizontal and vertical scroll changes:
52
+
The following code example illustrates how implement the event handler and to respond to both horizontal and vertical scroll changes:
On Android and iOS platforms, the scroll head offers a quick way to move through pages. Users can drag the thumb indicator to scroll within the PDF document.
119
+
120
+

121
+
122
+
### Page Navigation via Scroll Head
123
+
124
+
Tap the scroll head to open a page navigation dialog. Enter a valid page number and tap **OK** to jump directly to that page.
125
+
126
+

127
+
128
+
### Show or Hide the Scroll Head
129
+
130
+
Use the [ShowScrollHead](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ShowScrollHead) property to control the visibility of the scroll head.
131
+
132
+
{% tabs %}
133
+
{% highlight c# %}
134
+
// Hide the scroll head thumb
135
+
PdfViewer.ShowScrollHead = false;
136
+
{% endhighlight %}
137
+
{% endtabs %}
138
+
139
+
N> The scroll head is available only on **mobile platforms**. It is not supported on **Windows** or **macOS**.
Copy file name to clipboardExpand all lines: MAUI/PDF-Viewer/UI-Customization.md
-11Lines changed: 0 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,17 +11,6 @@ documentation: ug
11
11
12
12
This section walks you through the UI customization options supported in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html).
13
13
14
-
## Show or hide the scroll head
15
-
16
-
You can scroll through the pages by simply dragging the scroll head in the UI. The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to show or hide the scroll head thumb displayed using the [ShowScrollHead](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_ShowScrollHead) property. Refer to the following code example.
17
-
18
-
{% tabs %}
19
-
{% highlight c# %}
20
-
// Hide the scroll head thumb
21
-
PdfViewer.ShowScrollHead = false;
22
-
{% endhighlight %}
23
-
{% endtabs %}
24
-
25
14
## Customize the loading indicator
26
15
27
16
You can customize the loading indicator’s properties by applying a style with the `TargetType` property to `ActivityIndicator`. You may also need to set the [ApplyToDerivedTypes](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/styles/xaml?view=net-maui-7.0#apply-a-style-to-derived-types) property to `True` to get the style applied to the derived classes. See the following code example to customize the color of the loading indicator.
0 commit comments