DocumentViewerControl.ZoomMode Property
Specifies the current document zoom mode. This is a dependency property.
Namespace: DevExpress.Xpf.DocumentViewer
Assembly: DevExpress.Xpf.DocumentViewer.v24.1.Core.dll
NuGet Package: DevExpress.Wpf.DocumentViewer.Core
Declaration
Property Value
Type | Description |
---|---|
ZoomMode | A ZoomMode enumeration value. |
Available values:
Name | Description |
---|---|
Custom | The document zoom factor is defined by the DocumentViewerControl.ZoomFactor property value. |
ActualSize | Sets the document zoom factor value to 100%. |
FitToWidth | 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 FitToWidth provides different result from the FitToVisible mode. |
FitToVisible | 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.11.2 of the PDF 32000-1:2008 standard). If the bleed box is smaller than the crop box, the FitToWidth and FitToVisible modes provide different results. |
PageLevel | 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.