Back to Devexpress

DocumentViewerControl.ZoomMode Property

wpf-devexpress-dot-xpf-dot-documentviewer-dot-documentviewercontrol-bf3a5ead.md

latest3.6 KB
Original Source

DocumentViewerControl.ZoomMode Property

Specifies the current document zoom mode. This is a dependency property.

Namespace : DevExpress.Xpf.DocumentViewer

Assembly : DevExpress.Xpf.DocumentViewer.v25.2.Core.dll

NuGet Package : DevExpress.Wpf.DocumentViewer.Core

Declaration

csharp
public ZoomMode ZoomMode { get; set; }
vb
Public Property ZoomMode As ZoomMode

Property Value

TypeDescription
ZoomMode

A ZoomMode enumeration value.

|

Available values:

NameDescription
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 …

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.

csharp
using DevExpress.Xpf.DocumentViewer;

// ...
XtraReport1 report = new XtraReport1();
documentPreview.DocumentSource = report;
report.CreateDocument();
documentPreview.ZoomMode = ZoomMode.FitToWidth;
vb
Imports DevExpress.Xpf.DocumentViewer

' ...
Private report As 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.

See Also

DocumentViewerControl Class

DocumentViewerControl Members

DevExpress.Xpf.DocumentViewer Namespace