DocumentViewerControl.ZoomMode Property
Specifies the current document zoom mode. This is a dependency property.
Namespace: DevExpress.Xpf.DocumentViewer
Assembly: DevExpress.Xpf.DocumentViewer.v24.2.Core.dll
NuGet Package: DevExpress.Wpf.DocumentViewer.Core
#Declaration
#Property Value
Type | Description |
---|---|
Zoom |
A Zoom |
Available values:
Name | Description |
---|---|
Custom | The document zoom factor is defined by the Document |
Actual |
Sets the document zoom factor value to 100%. |
Fit |
Sets the document zoom factor value to fit to the width of the widest page in a document. If the bleed box is smaller than the crop box, the Fit |
Fit |
The document zoom factor is calculated to fit to the width of the visible content of a page. The region of the visible page content is defined by the bleed box (see section 14. |
Page |
Sets the document zoom factor value to fit to the widest or highest page in a document. |
#Remarks
The ZoomMode property’s default value is ActualSize that corresponds to 100%. You can change this property value in XAML …
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/printing">
...
<dxp:DocumentPreviewControl x:Name="documentPreview" ZoomMode="FitToWidth" />
</Window>
… or in code behind.
using DevExpress.Xpf.DocumentViewer;
// ...
XtraReport1 report = new XtraReport1();
documentPreview.DocumentSource = report;
report.CreateDocument();
documentPreview.ZoomMode = ZoomMode.FitToWidth;
You can also use the ZoomFactor property to specify a custom zoom value. This sets the ZoomMode property to Custom automatically.
The Document Preview’s Toolbar provides commands to zoom a document.