menu

Blazor

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

    Show / Hide Table of Contents

    Class PdfViewerEvents

    Represents the event handlers and configurations for the PDF Viewer.

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

    This class provides various event-related functionalities for the PDF Viewer component,
    allowing users to handle interactions, changes, and actions performed within the viewer.
    It is designed to be initialized and used as part of the PDF Viewer lifecycle.

    Constructors

    PdfViewerEvents()

    Declaration
    public PdfViewerEvents()

    Properties

    AddSignature

    Triggers when signature is added over the page of the PDF document.

    Declaration
    public EventCallback<AddSignatureEventArgs> AddSignature { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<AddSignatureEventArgs>

    An event callback function.

    AjaxRequestFailed

    Triggers when the AJAX request is failed.

    Declaration
    public EventCallback<AjaxRequestFailureEventArgs> AjaxRequestFailed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<AjaxRequestFailureEventArgs>

    An event callback function.

    AnnotationAdded

    Triggers when an annotation is added over the page of the PDF document.

    Declaration
    public EventCallback<AnnotationAddEventArgs> AnnotationAdded { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<AnnotationAddEventArgs>

    An event callback function.

    AnnotationMouseover

    Triggers when mouse over the annotation object.

    Declaration
    public EventCallback<AnnotationMouseoverEventArgs> AnnotationMouseover { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<AnnotationMouseoverEventArgs>

    An event callback function.

    AnnotationMoved

    Triggers when an annotation is moved over the page of the PDF document.

    Declaration
    public EventCallback<AnnotationMoveEventArgs> AnnotationMoved { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<AnnotationMoveEventArgs>

    An event callback function.

    Remarks

    AnnotationMove event is not applicable for text markup annotations.

    AnnotationPropertiesChanged

    Triggers when the property of the annotation is changed in the page of the PDF document.

    Declaration
    public EventCallback<AnnotationPropertiesChangeEventArgs> AnnotationPropertiesChanged { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<AnnotationPropertiesChangeEventArgs>

    An event callback function.

    AnnotationRemoved

    Triggers when an annotation is removed from the page of the PDF document.

    Declaration
    public EventCallback<AnnotationRemoveEventArgs> AnnotationRemoved { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<AnnotationRemoveEventArgs>

    An event callback function.

    AnnotationResized

    Triggers when an annotation is resized over the page of the PDF document.

    Declaration
    public EventCallback<AnnotationResizeEventArgs> AnnotationResized { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<AnnotationResizeEventArgs>

    An event callback function.

    Remarks

    This event does not applicable for Sticky note annotation.

    AnnotationSelected

    Triggers when an annotation is selected over the page of the PDF document.

    Declaration
    public EventCallback<AnnotationSelectEventArgs> AnnotationSelected { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<AnnotationSelectEventArgs>

    An event callback function.

    AnnotationUnselected

    Triggers when an annotation is unselected over the page of the PDF document.

    Declaration
    public EventCallback<AnnotationUnselectEventArgs> AnnotationUnselected { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<AnnotationUnselectEventArgs>

    An event callback function.

    Examples
       <SfPdfViewer2>
            <PdfViewerEvents AnnotationUnSelected="annotationUnSelected"></PdfViewerEvents>
       </SfPdfViewer2>
     @code {
       public void annotationUnSelected(AnnotationUnSelectEventArgs args)
       {
       }
     }

    CommandExecuted

    Represents the method to be called when the designated command is invoked.

    Declaration
    public EventCallback<CommandExecutedEventArgs> CommandExecuted { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<CommandExecutedEventArgs>

    Represents an event callback function.

    Created

    Triggers when the PdfViewer component is created.

    Declaration
    public EventCallback<object> Created { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An event callback function.

    DocumentEdited

    Trigger an event when the document getting edited

    Declaration
    public EventCallback<DocumentEditedEventArgs> DocumentEdited { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<DocumentEditedEventArgs>

    An event callback function

    Remarks

    Use this property to subscribe to the event that provide a callback function that will be executed when the document edited.

    DocumentLoaded

    Triggers while loading document into PdfViewer.

    Declaration
    public EventCallback<LoadEventArgs> DocumentLoaded { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<LoadEventArgs>

    An event callback function.

    DocumentLoadFailed

    Triggers while loading document got failed in PdfViewer.

    Declaration
    public EventCallback<LoadFailedEventArgs> DocumentLoadFailed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<LoadFailedEventArgs>

    An event callback function.

    DocumentUnloaded

    Triggers while close the document

    Declaration
    public EventCallback<UnloadEventArgs> DocumentUnloaded { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<UnloadEventArgs>

    An event callback function.

    DownloadEnd

    Triggers an event when the download actions is finished.

    Declaration
    public EventCallback<DownloadEndEventArgs> DownloadEnd { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<DownloadEndEventArgs>

    An event callback function.

    DownloadStart

    Triggers an event when the download action is started.

    Declaration
    public EventCallback<DownloadStartEventArgs> DownloadStart { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<DownloadStartEventArgs>

    An event callback function.

    ExportFailed

    Triggers when an export annotations failed in the PDF Viewer.

    Declaration
    public EventCallback<ExportFailureEventArgs> ExportFailed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ExportFailureEventArgs>

    An event callback function.

    ExportStarted

    Triggers when an exported annotations started in the PDF Viewer.

    Declaration
    public EventCallback<ExportStartEventArgs> ExportStarted { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ExportStartEventArgs>

    An event callback function.

    ExportSucceed

    Triggers when an export annotations succeed in the PDF Viewer.

    Declaration
    public EventCallback<ExportSuccessEventArgs> ExportSucceed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ExportSuccessEventArgs>

    An event callback function.

    ExtractTextCompleted

    Triggers when an text extraction is completed in the PDF Viewer.

    Declaration
    public EventCallback<ExtractTextCompletedEventArgs> ExtractTextCompleted { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ExtractTextCompletedEventArgs>

    An event callback function.

    FormFieldAdded

    Triggers when a form field is added to the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldAddedEventArgs> FormFieldAdded { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldAddedEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked when the form field is added.

    Remarks

    This event provides an instance of the FormFieldAddedEventArgs class,
    containing details about the form field that was successfully added.
    It is part of the PdfViewerEvents class and can be used to handle post-addition logic or notifications.

    Examples

    The following example demonstrates how to handle the FormFieldAdded event:

    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldAdded="@OnFormFieldAdded"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    SfPdfViewer2 Viewer;
    void OnFormFieldAdded(FormFieldAddedEventArgs args)
    {
        // Access details about the added form field
        Console.WriteLine($"Form Field added: {args.Field.Name}");
        // Additional processing logic
    }
    }

    FormFieldAdding

    Triggers before a form field addition starts in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldAddEventArgs> FormFieldAdding { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldAddEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked before the form field is added.

    Remarks

    This event provides an instance of the FormFieldAddEventArgs class, offering details about the form field being added. It is part of the PdfViewerEvents class and allows customization before the form field is added.

    Examples

    The following example demonstrates how to handle the FormFieldAdding event.

    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldAdding="@OnFormFieldAdding"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    SfPdfViewer2 Viewer;
    void OnFormFieldAdding(FormFieldAddEventArgs args)
    {
        Console.WriteLine($"Form Field going to add: {args.Field.Name}");
        // Additional processing logic
    }
    }

    FormFieldClick

    Triggers an event when the form field is clicked.

    Declaration
    public EventCallback<FormFieldClickArgs> FormFieldClick { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldClickArgs>

    An event callback function.

    FormFieldDeleted

    Triggers when a form field is deleted from the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldDeletedEventArgs> FormFieldDeleted { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldDeletedEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked when a form field is deleted.

    Remarks

    The FormFieldDeleted event provides details about the form field that was removed, allowing developers to track deletions and perform necessary actions, such as updating the UI or persisting data.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldDeleted="@OnFormFieldDeleted"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldDeleted(FormFieldDeletedEventArgs args)
    {
        Console.WriteLine($"Form field deleted: {args.Field.Name}");
    
        // Implement additional logic, such as logging or UI updates
    }
    }

    FormFieldDoubleClick

    Triggers when a form field is double-clicked in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldDoubleClickEventArgs> FormFieldDoubleClick { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldDoubleClickEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked when the form field is double-clicked.

    Remarks

    The FormFieldDoubleClick event provides details about the form field that was double-clicked.
    This event can be used to perform actions such as displaying a custom editor or modifying field properties.

    Examples

    The following example demonstrates how to handle the FormFieldDoubleClick event:

    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldDoubleClick="@OnFormFieldDoubleClick"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    SfPdfViewer2 Viewer;
    void OnFormFieldDoubleClick(FormFieldDoubleClickEventArgs args)
    {
        // Retrieve details about the double-clicked form field
        Console.WriteLine($"Form field double-clicked: {args.Field.Name}");
        // Additional processing logic
    }
    }

    FormFieldFocusIn

    Triggers when a user focuses on a form field in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldFocusInEventArgs> FormFieldFocusIn { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldFocusInEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that invoked when the form field is focused.

    Remarks

    The FormFieldFocusIn event provides access to the form field that has gained focus within the SfPdfViewer2 component. This allows handling of specific actions when a form field is focused.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldFocusIn="@OnFormFieldFocusIn"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    SfPdfViewer2 Viewer;
    void OnFormFieldFocusIn(FormFieldFocusInEventArgs args)
    {
        // Handle the focused form field
        Console.WriteLine($"Form field focused: {args.Field.Name}");
        // Additional processing logic
    }
    }

    FormFieldFocusOut

    Triggers when a user moves focus away from a form field in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldFocusOutEventArgs> FormFieldFocusOut { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldFocusOutEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that invoked when the form field that lost focus.

    Remarks

    The FormFieldFocusOut event is triggered when a form field loses focus within the SfPdfViewer2 component. This allows developers to perform actions such as validation, data processing, or cleanup when the user moves away from a form field.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldFocusOut="@OnFormFieldFocusOut"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    SfPdfViewer2 Viewer;
    void OnFormFieldFocusOut(FormFieldFocusOutEventArgs args)
    {
        // Handle the form field losing focus
        Console.WriteLine($"Form field lost focus: {args.Field.Name}");
    
        // Additional processing logic
    }
    }

    FormFieldMouseEnter

    Triggers when the mouse pointer enters a form field in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldMouseEnterEventArgs> FormFieldMouseEnter { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldMouseEnterEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that invoked when the form field where the mouse entered.

    Remarks

    The FormFieldMouseEnter event occurs when the user moves the mouse pointer over a form field within the SfPdfViewer2 component. This event can be used to implement hover effects, display tooltips, or perform other UI-related interactions.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldMouseEnter="@OnFormFieldMouseEnter"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    SfPdfViewer2 Viewer;
    void OnFormFieldMouseEnter(FormFieldMouseEnterEventArgs args)
    {
        // Handle mouse entering the form field
        Console.WriteLine($"Mouse entered form field: {args.Field.Name}");
    
        // Additional hover-related logic
    }
    }

    FormFieldMouseLeave

    Triggers when the mouse pointer leaves a form field in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldMouseLeaveEventArgs> FormFieldMouseLeave { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldMouseLeaveEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked when the mouse pointer leaves a form field.

    Remarks

    The FormFieldMouseLeave event provides information about the form field that the mouse pointer exited. This can be used to implement custom interactions, such as hiding tooltips or resetting field styling.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldMouseLeave="@OnFormFieldMouseLeave"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldMouseLeave(FormFieldMouseLeaveEventArgs args)
    {
        // Retrieve the form field that the mouse left
        FormFieldInfo fieldInfo = args.Field;
        Console.WriteLine($"Mouse left form field: {fieldInfo.Name}");
    
        // Implement additional logic
    }
    }

    FormFieldPropertyChanged

    Triggers when one or more properties of a form field change in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldPropertyChangedEventArgs> FormFieldPropertyChanged { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldPropertyChangedEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that invoked when the form field property is changed.

    Remarks

    The FormFieldPropertyChanged event occurs whenever one or more properties of a form field, such as its value, appearance, or settings, are modified. This event allows developers to track changes and implement custom logic based on user interactions.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldPropertyChanged="@OnFormFieldPropertyChanged"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldPropertyChanged(FormFieldPropertyChangedEventArgs args)
    {
        // Retrieve the changed properties
        Console.WriteLine($"Form field properties changed: New Value: {args.NewValue}");
    
        // Implement additional logic based on property changes
    }
    }

    FormFieldResized

    Triggers when a form field is resized in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldResizedEventArgs> FormFieldResized { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldResizedEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked when a form field is resized.

    Remarks

    The FormFieldResized event provides information about the resized form field, including its previous and updated dimensions. This allows developers to handle custom resizing logic or restrictions.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldResized="@OnFormFieldResized"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldResized(FormFieldResizedEventArgs args)
    {
        // Retrieve the resized form field
        FormFieldInfo resizedField = args.Field;
        Console.WriteLine($"Form field resized: {resizedField.Name}");
    
        // Retrieve old and new sizes
        Bound oldSize = args.OldBounds;
        Bound newSize = args.NewBounds;
    
        Console.WriteLine($"Old Size: {oldSize.Width}x{oldSize.Height}");
        Console.WriteLine($"New Size: {newSize.Width}x{newSize.Height}");
    
        // Implement additional logic
    }
    }

    FormFieldSelected

    Triggers when select a form field in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldSelectedEventArgs> FormFieldSelected { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldSelectedEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that invoked when the form field is selected.

    Remarks

    The FormFieldSelected event allows developers to execute logic when a form field is selected. This can be useful for highlighting the field, displaying additional options, or tracking user interactions.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldSelected="@OnFormFieldSelected"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldSelected(FormFieldSelectedEventArgs args)
    {
        // Retrieve the selected form field
        Console.WriteLine($"Form field selected: {args.Field.Name}");
    
        // Implement additional logic
    }
    }

    FormFieldsExported

    Triggers after the form fields have been successfully exported in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldsExportedEventArgs> FormFieldsExported { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldsExportedEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that invoked when the form fields have been successfully exported.

    Remarks

    The FormFieldsExported event provides information about the exported form fields, allowing developers to handle post-export actions such as logging, notifications, or further processing.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldsExported="@OnFormFieldsExported"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldsExported(FormFieldsExportedEventArgs args)
    {
        // Handle post-export actions
        Console.WriteLine("Form fields have been successfully exported.");
        // Implement additional logic if needed
    }
    }

    FormFieldsExportFailed

    Triggers when the form fields export operation fails in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldsExportFailedEventArgs> FormFieldsExportFailed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldsExportFailedEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that invoked when the form fields export operation fails.

    Remarks

    The FormFieldsExportFailed event is useful for handling errors or issues that occur during the export process. It provides a way to capture and respond to export failures, such as when the export could not be completed due to missing fields, invalid data, or other problems.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldsExportFailed="@OnFormFieldsExportFailed"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldsExportFailed(FormFieldsExportFailedEventArgs args)
    {
        // Handle the export failure
        Console.WriteLine($"Form fields export failed: {args.ErrorDetails}");
        // Implement error handling logic
    }
    }

    FormFieldsExporting

    Triggers when the form fields export process starts in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldsExportEventArgs> FormFieldsExporting { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldsExportEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that invoked when the form fields export process starts.

    Remarks

    This event allows developers to execute custom logic before the form fields are exported,
    such as modifying data, logging, or displaying a progress indicator. Also, set the Cancel property to true to cancel the export process.

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

    FormFieldsImported

    Triggers after form fields have been successfully imported into the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldsImportedEventArgs> FormFieldsImported { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldsImportedEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that invoked when the form fields have been successfully imported.

    Remarks

    The FormFieldsImported event is fired once the import process of form fields is complete. Developers can use this event to perform actions or updates after the form fields are successfully imported.

    Examples
    <SfPdfViewer2 @ref="Viewer" DocumentPath="@DocumentPath" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldsImported="@OnFormFieldsImported"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldsImported(FormFieldsImportedEventArgs args)
    {
        // Handle the post-import event
        Console.WriteLine("Form fields have been successfully imported.");
        // Additional processing logic can go here
    }
    }

    FormFieldsImportFailed

    Triggers when the form fields import process fails in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldsImportFailedEventArgs> FormFieldsImportFailed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldsImportFailedEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that invoked when the form fields import operation fails.

    Remarks

    The FormFieldsImportFailed event is triggered when the attempt to import form fields fails. It allows developers to handle import failures by accessing detailed error information.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldsImportFailed="@OnFormFieldsImportFailed"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldsImportFailed(FormFieldsImportFailedEventArgs args)
    {
        // Handle the import failure
        Console.WriteLine($"Import failed with error details: {args.ErrorDetails}");
        // Implement custom error handling logic
    }
    }

    FormFieldsImporting

    Triggers when the form fields import process starts in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldsImportEventArgs> FormFieldsImporting { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldsImportEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that invoked when the form fields import process starts.

    Remarks

    This event allows developers to execute custom logic before the form fields are imported,
    such as modifying data, logging, or displaying a progress indicator. Also, set the Cancel property to true to cancel the import process.

    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
        }
    }

    FormFieldUnselected

    Triggers when a form field is unselected in the SfPdfViewer2 component.

    Declaration
    public EventCallback<FormFieldUnselectedEventArgs> FormFieldUnselected { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FormFieldUnselectedEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that invoked when a form field is unselected.

    Remarks

    The FormFieldUnselected event occurs when a previously selected form field is unselected. This allows developers to execute custom logic when a user or programmatic action deselects a form field.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldUnselected="@OnFormFieldUnselected"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldUnselected(FormFieldUnselectedEventArgs args)
    {
        Console.WriteLine($"Form field unselected: {args.Field.Name}"); 
        // Implement additional logic
    }
    }

    ImportFailed

    Triggers when an imports annotations failed in the PDF document.

    Declaration
    public EventCallback<ImportFailureEventArgs> ImportFailed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ImportFailureEventArgs>

    An event callback function.

    ImportStarted

    Triggers when an imported annotations started in the PDF document.

    Declaration
    public EventCallback<ImportStartEventArgs> ImportStarted { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ImportStartEventArgs>

    An event callback function.

    ImportSucceed

    Triggers when an imports annotations succeed in the PDF document.

    Declaration
    public EventCallback<ImportSuccessEventArgs> ImportSucceed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ImportSuccessEventArgs>

    An event callback function.

    MoveSignature

    Triggers when an signature is moved over the page of the PDF document.

    Declaration
    public EventCallback<MoveSignatureEventArgs> MoveSignature { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<MoveSignatureEventArgs>

    An event callback function.

    OnAnnotationDoubleClick

    Triggers an event when the annotation is double click.

    Declaration
    public EventCallback<AnnotationDoubleClickEventArgs> OnAnnotationDoubleClick { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<AnnotationDoubleClickEventArgs>

    An event callback function.

    OnHyperlinkClick

    Triggers when hyperlink in the PDF Document is clicked

    Declaration
    public EventCallback<HyperlinkClickEventArgs> OnHyperlinkClick { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<HyperlinkClickEventArgs>

    An event callback function.

    OnHyperlinkMouseOver

    Triggers when hyperlink in the PDF Document is hovered

    Declaration
    public EventCallback<HyperlinkMouseOverArgs> OnHyperlinkMouseOver { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<HyperlinkMouseOverArgs>

    An event callback function.

    OnPageClick

    Triggers when the mouse click is performed over the page of the PDF document.

    Declaration
    public EventCallback<PageClickEventArgs> OnPageClick { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<PageClickEventArgs>

    An event callback function.

    OnTextSearchComplete

    Triggers an event when the text search is completed.

    Declaration
    public EventCallback<TextSearchCompleteEventArgs> OnTextSearchComplete { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<TextSearchCompleteEventArgs>

    An event callback function.

    OnTextSearchHighlight

    Triggers an event when the text search text is highlighted.

    Declaration
    public EventCallback<TextSearchHighlightEventArgs> OnTextSearchHighlight { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<TextSearchHighlightEventArgs>

    An event callback function.

    OnTextSearchStart

    Triggers an event when the text search is started.

    Declaration
    public EventCallback<TextSearchStartEventArgs> OnTextSearchStart { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<TextSearchStartEventArgs>

    An event callback function.

    OnTextSelectionEnd

    Triggers an event when the text selection is finished.

    Declaration
    public EventCallback<TextSelectionEndEventArgs> OnTextSelectionEnd { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<TextSelectionEndEventArgs>

    An event callback function.

    OnTextSelectionStart

    Triggers an event when the text selection is started.

    Declaration
    public EventCallback<TextSelectionStartEventArgs> OnTextSelectionStart { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<TextSelectionStartEventArgs>

    An event callback function.

    OnThumbnailClick

    Triggers an event when the thumbnail is clicked in the thumbnail panel of PDF Viewer.

    Declaration
    public EventCallback<ThumbnailClickEventArgs> OnThumbnailClick { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ThumbnailClickEventArgs>

    An event callback function.

    PageChanged

    Triggers when there is change in current page number.

    Declaration
    public EventCallback<PageChangeEventArgs> PageChanged { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<PageChangeEventArgs>

    An event callback function.

    PageMouseover

    Triggers when mouse over the page.

    Declaration
    public EventCallback<PageMouseoverEventArgs> PageMouseover { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<PageMouseoverEventArgs>

    An event callback function.

    Parent

    Represent Pdf Viewer component.

    Declaration
    protected PdfViewerBase Parent { get; set; }
    Property Value
    Type
    PdfViewerBase

    PrintEnd

    Triggers an event when the print actions is finished.

    Declaration
    public EventCallback<PrintEndEventArgs> PrintEnd { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<PrintEndEventArgs>

    An event callback function.

    PrintStart

    Triggers an event when the print action is started.

    Declaration
    public EventCallback<PrintStartEventArgs> PrintStart { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<PrintStartEventArgs>

    An event callback function.

    RemoveSignature

    Triggers when signature is removed over the page of the PDF document.

    Declaration
    public EventCallback<RemoveSignatureEventArgs> RemoveSignature { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<RemoveSignatureEventArgs>

    An event callback function.

    ResizeSignature

    Triggers when signature is resized over the page of the PDF document.

    Declaration
    public EventCallback<ResizeSignatureEventArgs> ResizeSignature { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ResizeSignatureEventArgs>

    An event callback function.

    SignaturePropertiesChange

    Triggers when the property of the signature is changed in the page of the PDF document.

    Declaration
    public EventCallback<SignaturePropertiesChangeEventArgs> SignaturePropertiesChange { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<SignaturePropertiesChangeEventArgs>

    An event callback function.

    SignatureSelected

    Triggers when signature is selected over the page of the PDF document.

    Declaration
    public EventCallback<SignatureSelectEventArgs> SignatureSelected { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<SignatureSelectEventArgs>

    An event callback function.

    SignatureUnselected

    Triggers when signature is unselected over the page of the PDF document.

    Declaration
    public EventCallback<SignatureSelectEventArgs> SignatureUnselected { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<SignatureSelectEventArgs>

    An event callback function.

    ToolbarClicked

    Triggers an event when a Custom Toolbar Item is clicked in the Toolbar.

    Declaration
    public EventCallback<ClickEventArgs> ToolbarClicked { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ClickEventArgs>

    An event callback function.

    Remarks

    Use this property to assign a function or method to handle the click event of the Custom Toolbar Item.

    ValidateFormFields

    Triggers when validation is failed. This event will be triggered if set enableFormValidations as true.

    Declaration
    public EventCallback<ValidateFormFieldsArgs> ValidateFormFields { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ValidateFormFieldsArgs>

    An event callback function.

    ZoomChanged

    Triggers when there is change in the magnification value.

    Declaration
    public EventCallback<ZoomChangeEventArgs> ZoomChanged { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ZoomChangeEventArgs>

    An event callback function.

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder

    OnInitializedAsync()

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type
    System.Threading.Tasks.Task
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved