alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class PdfViewerEvents

    Represents the event handlers and configurations for the PDF Viewer.

    Inheritance
    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
    [Parameter]
    [JsonIgnore]
    public EventCallback<AddSignatureEventArgs> AddSignature { get; set; }
    Property Value
    Type Description
    EventCallback<AddSignatureEventArgs>

    An event callback function.

    AjaxRequestFailed

    Triggers when the AJAX request is failed.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<AjaxRequestFailureEventArgs> AjaxRequestFailed { get; set; }
    Property Value
    Type Description
    EventCallback<AjaxRequestFailureEventArgs>

    An event callback function.

    AnnotationAdded

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<AnnotationAddEventArgs> AnnotationAdded { get; set; }
    Property Value
    Type Description
    EventCallback<AnnotationAddEventArgs>

    An event callback function.

    AnnotationMouseover

    Triggers when mouse over the annotation object.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<AnnotationMouseoverEventArgs> AnnotationMouseover { get; set; }
    Property Value
    Type Description
    EventCallback<AnnotationMouseoverEventArgs>

    An event callback function.

    AnnotationMoved

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<AnnotationMoveEventArgs> AnnotationMoved { get; set; }
    Property Value
    Type Description
    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
    [Parameter]
    [JsonIgnore]
    public EventCallback<AnnotationPropertiesChangeEventArgs> AnnotationPropertiesChanged { get; set; }
    Property Value
    Type Description
    EventCallback<AnnotationPropertiesChangeEventArgs>

    An event callback function.

    AnnotationRemoved

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<AnnotationRemoveEventArgs> AnnotationRemoved { get; set; }
    Property Value
    Type Description
    EventCallback<AnnotationRemoveEventArgs>

    An event callback function.

    AnnotationResized

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<AnnotationResizeEventArgs> AnnotationResized { get; set; }
    Property Value
    Type Description
    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
    [Parameter]
    [JsonIgnore]
    public EventCallback<AnnotationSelectEventArgs> AnnotationSelected { get; set; }
    Property Value
    Type Description
    EventCallback<AnnotationSelectEventArgs>

    An event callback function.

    AnnotationUnselected

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<AnnotationUnselectEventArgs> AnnotationUnselected { get; set; }
    Property Value
    Type Description
    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
    [Parameter]
    [JsonIgnore]
    public EventCallback<CommandExecutedEventArgs> CommandExecuted { get; set; }
    Property Value
    Type Description
    EventCallback<CommandExecutedEventArgs>

    Represents an event callback function.

    Created

    Triggers when the PdfViewer component is created.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<object> Created { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An event callback function.

    DocumentEdited

    Trigger an event when the document getting edited

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<DocumentEditedEventArgs> DocumentEdited { get; set; }
    Property Value
    Type Description
    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.

    DocumentLoadFailed

    Triggers while loading document got failed in PdfViewer.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<LoadFailedEventArgs> DocumentLoadFailed { get; set; }
    Property Value
    Type Description
    EventCallback<LoadFailedEventArgs>

    An event callback function.

    DocumentLoaded

    Triggers while loading document into PdfViewer.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<LoadEventArgs> DocumentLoaded { get; set; }
    Property Value
    Type Description
    EventCallback<LoadEventArgs>

    An event callback function.

    DocumentUnloaded

    Triggers while close the document

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<UnloadEventArgs> DocumentUnloaded { get; set; }
    Property Value
    Type Description
    EventCallback<UnloadEventArgs>

    An event callback function.

    DownloadEnd

    Triggers an event when the download actions is finished.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<DownloadEndEventArgs> DownloadEnd { get; set; }
    Property Value
    Type Description
    EventCallback<DownloadEndEventArgs>

    An event callback function.

    DownloadStart

    Triggers an event when the download action is started.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<DownloadStartEventArgs> DownloadStart { get; set; }
    Property Value
    Type Description
    EventCallback<DownloadStartEventArgs>

    An event callback function.

    ExportFailed

    Triggers when an export annotations failed in the PDF Viewer.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ExportFailureEventArgs> ExportFailed { get; set; }
    Property Value
    Type Description
    EventCallback<ExportFailureEventArgs>

    An event callback function.

    ExportStarted

    Triggers when an exported annotations started in the PDF Viewer.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ExportStartEventArgs> ExportStarted { get; set; }
    Property Value
    Type Description
    EventCallback<ExportStartEventArgs>

    An event callback function.

    ExportSucceed

    Triggers when an export annotations succeed in the PDF Viewer.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ExportSuccessEventArgs> ExportSucceed { get; set; }
    Property Value
    Type Description
    EventCallback<ExportSuccessEventArgs>

    An event callback function.

    ExtractTextCompleted

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ExtractTextCompletedEventArgs> ExtractTextCompleted { get; set; }
    Property Value
    Type Description
    EventCallback<ExtractTextCompletedEventArgs>

    An event callback function.

    FormFieldAdded

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldAddedEventArgs> FormFieldAdded { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldAddedEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldAddEventArgs> FormFieldAdding { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldAddEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldClickArgs> FormFieldClick { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldClickArgs>

    An event callback function.

    FormFieldDeleted

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldDeletedEventArgs> FormFieldDeleted { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldDeletedEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldDoubleClickEventArgs> FormFieldDoubleClick { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldDoubleClickEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldFocusInEventArgs> FormFieldFocusIn { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldFocusInEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldFocusOutEventArgs> FormFieldFocusOut { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldFocusOutEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldMouseEnterEventArgs> FormFieldMouseEnter { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldMouseEnterEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldMouseLeaveEventArgs> FormFieldMouseLeave { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldMouseLeaveEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldPropertyChangedEventArgs> FormFieldPropertyChanged { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldPropertyChangedEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldResizedEventArgs> FormFieldResized { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldResizedEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldSelectedEventArgs> FormFieldSelected { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldSelectedEventArgs>

    An EventCallback<TValue> 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
    }
    }

    FormFieldUnselected

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldUnselectedEventArgs> FormFieldUnselected { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldUnselectedEventArgs>

    An EventCallback<TValue> 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
    }
    }

    FormFieldsExportFailed

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldsExportFailedEventArgs> FormFieldsExportFailed { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldsExportFailedEventArgs>

    An EventCallback<TValue> 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
    }
    }

    FormFieldsExported

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldsExportedEventArgs> FormFieldsExported { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldsExportedEventArgs>

    An EventCallback<TValue> 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
    }
    }

    FormFieldsExporting

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldsExportEventArgs> FormFieldsExporting { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldsExportEventArgs>

    An EventCallback<TValue> 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
        }
    }

    FormFieldsImportFailed

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldsImportFailedEventArgs> FormFieldsImportFailed { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldsImportFailedEventArgs>

    An EventCallback<TValue> 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
    }
    }

    FormFieldsImported

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldsImportedEventArgs> FormFieldsImported { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldsImportedEventArgs>

    An EventCallback<TValue> 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
    }
    }

    FormFieldsImporting

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FormFieldsImportEventArgs> FormFieldsImporting { get; set; }
    Property Value
    Type Description
    EventCallback<FormFieldsImportEventArgs>

    An EventCallback<TValue> 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
        }
    }

    ImportFailed

    Triggers when an imports annotations failed in the PDF document.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ImportFailureEventArgs> ImportFailed { get; set; }
    Property Value
    Type Description
    EventCallback<ImportFailureEventArgs>

    An event callback function.

    ImportStarted

    Triggers when an imported annotations started in the PDF document.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ImportStartEventArgs> ImportStarted { get; set; }
    Property Value
    Type Description
    EventCallback<ImportStartEventArgs>

    An event callback function.

    ImportSucceed

    Triggers when an imports annotations succeed in the PDF document.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ImportSuccessEventArgs> ImportSucceed { get; set; }
    Property Value
    Type Description
    EventCallback<ImportSuccessEventArgs>

    An event callback function.

    MoveSignature

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<MoveSignatureEventArgs> MoveSignature { get; set; }
    Property Value
    Type Description
    EventCallback<MoveSignatureEventArgs>

    An event callback function.

    OnAnnotationDoubleClick

    Triggers an event when the annotation is double click.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<AnnotationDoubleClickEventArgs> OnAnnotationDoubleClick { get; set; }
    Property Value
    Type Description
    EventCallback<AnnotationDoubleClickEventArgs>

    An event callback function.

    OnHyperlinkClick

    Triggers when hyperlink in the PDF Document is clicked

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<HyperlinkClickEventArgs> OnHyperlinkClick { get; set; }
    Property Value
    Type Description
    EventCallback<HyperlinkClickEventArgs>

    An event callback function.

    OnHyperlinkMouseOver

    Triggers when hyperlink in the PDF Document is hovered

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<HyperlinkMouseOverArgs> OnHyperlinkMouseOver { get; set; }
    Property Value
    Type Description
    EventCallback<HyperlinkMouseOverArgs>

    An event callback function.

    OnPageClick

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PageClickEventArgs> OnPageClick { get; set; }
    Property Value
    Type Description
    EventCallback<PageClickEventArgs>

    An event callback function.

    OnTextSearchComplete

    Triggers an event when the text search is completed.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<TextSearchCompleteEventArgs> OnTextSearchComplete { get; set; }
    Property Value
    Type Description
    EventCallback<TextSearchCompleteEventArgs>

    An event callback function.

    OnTextSearchHighlight

    Triggers an event when the text search text is highlighted.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<TextSearchHighlightEventArgs> OnTextSearchHighlight { get; set; }
    Property Value
    Type Description
    EventCallback<TextSearchHighlightEventArgs>

    An event callback function.

    OnTextSearchStart

    Triggers an event when the text search is started.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<TextSearchStartEventArgs> OnTextSearchStart { get; set; }
    Property Value
    Type Description
    EventCallback<TextSearchStartEventArgs>

    An event callback function.

    OnTextSelectionEnd

    Triggers an event when the text selection is finished.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<TextSelectionEndEventArgs> OnTextSelectionEnd { get; set; }
    Property Value
    Type Description
    EventCallback<TextSelectionEndEventArgs>

    An event callback function.

    OnTextSelectionStart

    Triggers an event when the text selection is started.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<TextSelectionStartEventArgs> OnTextSelectionStart { get; set; }
    Property Value
    Type Description
    EventCallback<TextSelectionStartEventArgs>

    An event callback function.

    OnThumbnailClick

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ThumbnailClickEventArgs> OnThumbnailClick { get; set; }
    Property Value
    Type Description
    EventCallback<ThumbnailClickEventArgs>

    An event callback function.

    PageChanged

    Triggers when there is change in current page number.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PageChangeEventArgs> PageChanged { get; set; }
    Property Value
    Type Description
    EventCallback<PageChangeEventArgs>

    An event callback function.

    PageMouseover

    Triggers when mouse over the page.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PageMouseoverEventArgs> PageMouseover { get; set; }
    Property Value
    Type Description
    EventCallback<PageMouseoverEventArgs>

    An event callback function.

    PageOrganizerSaveRequested

    Provides event data for the save action triggered in the SfPdfViewer2 Page Organizer dialog.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PageOrganizerSaveEventArgs> PageOrganizerSaveRequested { get; set; }
    Property Value
    Type Description
    EventCallback<PageOrganizerSaveEventArgs>

    An instance of PageOrganizerSaveEventArgs containing details about the save operation in the Page Organizer.

    Remarks

    The PageOrganizerSaveEventArgs class contains details about the save operation, including the document stream, file name, and cancellation flag. Developers can use this event to customize the save behavior, intercept the action, or apply validations before saving.

    Examples
    <SfPdfViewer2 Height="100%" Width="100%" DocumentPath="wwwroot/Annotation.pdf">
        <PdfViewerEvents PageOrganizerSaveRequested="@OnPageOrganizerSaveRequested"></PdfViewerEvents>
    </SfPdfViewer2>

    PageOrganizerZoomChanged

    Triggered when the zoom level changes in the SfPdfViewer2 Page Organizer view.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PageOrganizerZoomChangedEventArgs> PageOrganizerZoomChanged { get; set; }
    Property Value
    Type Description
    EventCallback<PageOrganizerZoomChangedEventArgs>

    An instance of PageOrganizerZoomChangedEventArgs containing zoom change details.

    Remarks

    The PageOrganizerZoomChangedEventArgs provides access to the previous and current zoom levels. This allows you to track zoom changes and implement custom logic based on user interaction.

    Examples
    <SfPdfViewer2 Height="100%" Width="100%" DocumentPath="wwwroot/Annotation.pdf">
        <PdfViewerEvents PageOrganizerZoomChanged="@OnPageOrganizerZoomChanged"></PdfViewerEvents>
    </SfPdfViewer2>

    PageSelected

    Triggered when one or more pages are selected in the SfPdfViewer2 Page Organizer view.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PageSelectEventArgs> PageSelected { get; set; }
    Property Value
    Type Description
    EventCallback<PageSelectEventArgs>

    An instance of PageSelectEventArgs containing selected page information.

    Remarks

    The PageSelectEventArgs provides access to the selected pages and whether multiple pages were selected. This allows you to respond to user selections and perform actions like highlighting or editing.

    Examples
    <SfPdfViewer2 Height="100%" Width="100%" DocumentPath="wwwroot/Annotation.pdf">
        <PdfViewerEvents PageSelected="@OnPageSelected"></PdfViewerEvents>
    </SfPdfViewer2>

    Parent

    Represent Pdf Viewer component.

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

    PrintEnd

    Triggers an event when the print actions is finished.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PrintEndEventArgs> PrintEnd { get; set; }
    Property Value
    Type Description
    EventCallback<PrintEndEventArgs>

    An event callback function.

    PrintStart

    Triggers an event when the print action is started.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PrintStartEventArgs> PrintStart { get; set; }
    Property Value
    Type Description
    EventCallback<PrintStartEventArgs>

    An event callback function.

    RemoveSignature

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<RemoveSignatureEventArgs> RemoveSignature { get; set; }
    Property Value
    Type Description
    EventCallback<RemoveSignatureEventArgs>

    An event callback function.

    ResizeSignature

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ResizeSignatureEventArgs> ResizeSignature { get; set; }
    Property Value
    Type Description
    EventCallback<ResizeSignatureEventArgs>

    An event callback function.

    SignaturePropertiesChange

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<SignaturePropertiesChangeEventArgs> SignaturePropertiesChange { get; set; }
    Property Value
    Type Description
    EventCallback<SignaturePropertiesChangeEventArgs>

    An event callback function.

    SignatureSelected

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<SignatureSelectEventArgs> SignatureSelected { get; set; }
    Property Value
    Type Description
    EventCallback<SignatureSelectEventArgs>

    An event callback function.

    SignatureUnselected

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<SignatureSelectEventArgs> SignatureUnselected { get; set; }
    Property Value
    Type Description
    EventCallback<SignatureSelectEventArgs>

    An event callback function.

    ToolbarClicked

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

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ClickEventArgs> ToolbarClicked { get; set; }
    Property Value
    Type Description
    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
    [Parameter]
    [JsonIgnore]
    public EventCallback<ValidateFormFieldsArgs> ValidateFormFields { get; set; }
    Property Value
    Type Description
    EventCallback<ValidateFormFieldsArgs>

    An event callback function.

    ZoomChanged

    Triggers when there is change in the magnification value.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ZoomChangeEventArgs> ZoomChanged { get; set; }
    Property Value
    Type Description
    EventCallback<ZoomChangeEventArgs>

    An event callback function.

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    RenderTreeBuilder __builder

    OnInitializedAsync()

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type
    Task
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved