diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Images/DisablePersistZoom.gif b/Document-Processing/PDF/PDF-Viewer/maui/Images/DisablePersistZoom.gif new file mode 100644 index 0000000000..a5f63b5409 Binary files /dev/null and b/Document-Processing/PDF/PDF-Viewer/maui/Images/DisablePersistZoom.gif differ diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Images/EnablePersistZoom.gif b/Document-Processing/PDF/PDF-Viewer/maui/Images/EnablePersistZoom.gif new file mode 100644 index 0000000000..bbb7e1c2ff Binary files /dev/null and b/Document-Processing/PDF/PDF-Viewer/maui/Images/EnablePersistZoom.gif differ diff --git a/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md b/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md index be219e0fb3..be166fbd6b 100644 --- a/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md +++ b/Document-Processing/PDF/PDF-Viewer/maui/Magnification.md @@ -110,4 +110,48 @@ pdfViewer.ZoomMode = ZoomMode.FitToWidth; {% endhighlight %} {% endtabs %} -N> When the `ZoomFactor` is manually changed, the `ZoomMode` resets to `Default`. You can reapply the desired zoom mode afterward. +N> When the `ZoomFactor` is manually changed, the `ZoomMode` resets to `Default`. You can reapply the desired zoom mode afterward. + +## Maintain Zoom Level in Single Page View Mode + +In single-page view mode, the zoom level resets to default each time you navigate to a new page. To maintain a consistent zoom factor throughout the document, enable the PersistZoomOnPageChange property. This applies whether navigation is triggered by the built-in toolbar controls or programmatic APIs. +The default value of `PersistZoomOnPageChange` is `False`. + +### Enable PersistZoomOnPageChange + +You can enable persistent zoom by setting the `PersistZoomOnPageChange` property to `True`. When enabled, the viewer preserves the numeric `ZoomFactor` when switching pages in `SinglePage` layout and applies that same zoom to the destination page. Refer to the following code example: + +{% tabs %} +{% highlight xaml %} + +{% endhighlight %} + +{% highlight c# %} +// Enable persistence and set an initial zoom +PdfViewer.PageLayoutMode = PageLayoutMode.SinglePage; +PdfViewer.PersistZoomOnPageChange = true; +{% endhighlight %} +{% endtabs %} + +![Enable PersistZoomOnPageChange](Images/EnablePersistZoom.gif) + +### Disable PersistZoomOnPageChange + +Set `PersistZoomOnPageChange` to `False` to keep the viewer's default behavior. When disabled, navigating to a different page resets the viewer to the default zoom level unless you explicitly set a zoom after navigation. Refer to the following example: + +{% tabs %} +{% highlight xaml %} + +{% endhighlight %} + +{% highlight c# %} +// Disable persistence +PdfViewer.PersistZoomOnPageChange = false; +{% endhighlight %} +{% endtabs %} + +![Disable PersistZoomOnPageChange](Images/DisablePersistZoom.gif)