Access and Customize PDF Viewer Controls (CTP)
- 2 minutes to read
The PDF Viewer Property Editor internally uses the following components: DxPdfViewer (Blazor) or PdfViewer (WinForms). This topic describes how to access and customize these components in XAF applications.
Important
The PDF Viewer Property Editor is currently available as a Community Technology Preview (CTP).
The following approach is based on our standard way to access and customize a property editor using the CustomizeViewItemControl event, as described in the following guide: Access the Settings of a Property Editor in a Detail View.
- Create a custom ViewController in the Controllers folder of the SolutionName.Blazor.Server / SolutionName.Win project.
- Call the CustomizeViewItemControl method to access the
PdfViewerPropertyEditor
in theOnActivated
method handler. - Use the editor’s
ComponentModel
(Blazor) orControl
(WinForms) property to access the underlying component settings. - Modify component settings. The following code samples specify zoom level and hide the toolbar:
using DevExpress.Blazor.Reporting.Models;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Office.Blazor.Editors;
using Microsoft.AspNetCore.Components;
public class BlazorPdfViewerController : ViewController<DetailView> {
protected override void OnActivated() {
base.OnActivated();
View.CustomizeViewItemControl<PdfViewerPropertyEditor>(this, editor => {
editor.ComponentModel.ZoomLevel = 0.7;
editor.ComponentModel.CustomizeToolbar =
EventCallback.Factory.Create<ToolbarModel>(this, toolbar => toolbar.AllItems.Clear());
});
}
}