menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class FormFieldsImportEventArgs - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class FormFieldsImportEventArgs

    Provides event data for the form field importing event in the SfPdfViewer2 component.

    Inheritance
    System.Object
    FormFieldsImportEventArgs
    Namespace: Syncfusion.Blazor.SfPdfViewer
    Assembly: Syncfusion.Blazor.SfPdfViewer.dll
    Syntax
    public class FormFieldsImportEventArgs : Object
    Remarks

    The FormFieldsImportEventArgs class contains information about the form field import operation. It allows developers to control whether the import should proceed by setting the Cancel property.

    Examples
    <SfPdfViewer2 @ref="Viewer" DocumentPath="@DocumentPath" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldsImporting="@OnFormFieldsImporting"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
        void OnFormFieldsImporting(FormFieldsImportEventArgs args)
        {
            // Execute logic before form fields import begins
            Console.WriteLine("Form fields import started.");
    
            // Implement additional logic if needed
        }
    }

    Constructors

    FormFieldsImportEventArgs()

    Declaration
    public FormFieldsImportEventArgs()

    Properties

    Cancel

    Gets or sets a value indicating whether the form field import operation should be canceled in the SfPdfViewer2 component.

    Declaration
    public bool Cancel { get; set; }
    Property Value
    Type Description
    System.Boolean

    A bool indicating whether the import operation should be canceled. The default value is false.

    Remarks

    Setting the Cancel property to true will prevent the form fields from being imported into the SfPdfViewer2 component. This is useful when validation or custom conditions must be met before allowing the import.

    Examples
    <SfPdfViewer2 @ref="Viewer" DocumentPath="@DocumentPath" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldsImporting="@OnFormFieldsImporting"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldsImporting(FormFieldsImportEventArgs args)
    {
        // Prevent the form field import process
        args.Cancel = true;
        Console.WriteLine("Form fields import operation was canceled.");
    }
    }
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved