blazor-devexpress-dot-blazor-dot-pdfviewer-dot-dxpdfviewer-8b5e33e6.md
Specifies the document’s zoom level.
Namespace : DevExpress.Blazor.PdfViewer
Assembly : DevExpress.Blazor.PdfViewer.v25.2.dll
NuGet Package : DevExpress.Blazor.PdfViewer
[DefaultValue(-1)]
[Parameter]
public double ZoomLevel { get; set; }
| Type | Default | Description |
|---|---|---|
| Double | -1 |
The zoom level as a percentage:
-1 to fit a whole single page into the PDF Viewer.
-2 to fit the document into the PDF Viewer’s current width.
A ZoomConstants enumeration value.
|
Use the ZoomLevel property to specify the document’s initial zoom level. Set this property to one of the following values:
-1 to fit a whole single page into the PDF Viewer (corresponds to the ZoomConstants.WholePage option).-2 to fit the document into the PDF Viewer’s current width (corresponds to the ZoomConstants.PageWidth option).The following code snippet sets the initial zoom level to 125%:
@using System.Reflection
<DxPdfViewer @ref="pdfViewer"
DocumentContent="@DocumentContent"
ZoomLevel="1.25"/>
@code {
DxPdfViewer pdfViewer { get; set; }
byte[] DocumentContent { get; set; }
protected override async Task OnInitializedAsync() {
Assembly assembly = Assembly.GetExecutingAssembly();
Stream stream = assembly.GetManifestResourceStream("PdfSample.DataSources.Invoice.pdf");
using (var binaryReader = new BinaryReader(stream)) {
DocumentContent = binaryReader.ReadBytes((int)stream.Length);
}
}
}
See Also