Skip to main content
All docs
V25.1
  • 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.

    1. Create a custom ViewController in the Controllers folder of the SolutionName.Blazor.Server / SolutionName.Win project.
    2. Call the CustomizeViewItemControl method to access the PdfViewerPropertyEditor in the OnActivated method handler.
    3. Use the editor’s ComponentModel (Blazor) or Control (WinForms) property to access the underlying component settings.
    4. 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());
            });
        }
    }