Class FormFieldsExportEventArgs
Provides event data for the form fields export event in the SfPdfViewer2 component.
Inheritance
System.Object
FormFieldsExportEventArgs
Namespace: Syncfusion.Blazor.SfPdfViewer
Assembly: Syncfusion.Blazor.SfPdfViewer.dll
Syntax
public class FormFieldsExportEventArgs : Object
Remarks
The FormFieldsExportEventArgs class contains details about the form fields being exported. Developers can use this information to implement custom logic when exporting form field data.
Examples
<SfPdfViewer2 @ref="Viewer" DocumentPath="@DocumentPath" Height="100%" Width="100%">
<PdfViewerEvents FormFieldsExporting="@OnFormFieldsExporting"></PdfViewerEvents>
</SfPdfViewer2>
@code {
void OnFormFieldsExporting(FormFieldsExportEventArgs args)
{
Console.WriteLine($"Form fields export started.");
// Implement additional logic if needed
}
}
Constructors
FormFieldsExportEventArgs()
Declaration
public FormFieldsExportEventArgs()
Properties
Cancel
Gets or sets a value indicating whether the form fields export operation should be canceled in the SfPdfViewer2 component.
Declaration
public bool Cancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | A |
Remarks
Setting this property to true
will prevent the form fields from being exported in the SfPdfViewer2 component.
This is useful when you need to implement conditions to restrict exporting based on user roles, document state, or other validations.
Examples
<SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
<PdfViewerEvents FormFieldsExporting="@OnFormFieldsExporting"></PdfViewerEvents>
</SfPdfViewer2>
@code {
void OnFormFieldsExporting(FormFieldsExportEventArgs args)
{
// Prevent export if a certain condition is met
if (!UserHasExportPermission)
{
args.Cancel = true;
Console.WriteLine("Form fields export has been canceled due to permission restrictions.");
}
}
}