Class FormFieldAddedEventArgs
Provides event data for the form field addition event in the SfPdfViewer2 component.
Namespace: Syncfusion.Blazor.SfPdfViewer
Assembly: Syncfusion.Blazor.SfPdfViewer.dll
Syntax
public class FormFieldAddedEventArgs : Object
Remarks
This class contains information about the form field being added to the PDF Viewer.
It allows access to field properties and enables additional processing after the field is added.
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
}
}
Constructors
FormFieldAddedEventArgs()
Declaration
public FormFieldAddedEventArgs()
Properties
Field
Gets the form field object that was added or is being added in the SfPdfViewer2 component.
Declaration
public FormFieldInfo Field { get; }
Property Value
Type | Description |
---|---|
FormFieldInfo | A FormFieldInfo object representing the form field that was added or is currently being added. |
Remarks
This property provides access to the FormFieldInfo instance representing the form field involved in the addition process.
It is read-only and can be used to retrieve field-specific information such as name, type, and properties.
Examples
The following example demonstrates how to access the form field when handling 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
}
}
PageNumber
Gets the page number where the form field was added or is being added in the SfPdfViewer2 component.
Declaration
public int PageNumber { get; }
Property Value
Type | Description |
---|---|
System.Int32 | An System.Int32 representing the page number where the form field was added. |
Remarks
The PageNumber
property specifies the page number where the form field is added in the PDF document.
This property is read-only and helps identify the exact location of the form field within the document.
Examples
The following example demonstrates how to retrieve the page number when handling the FormFieldAdded event:
<SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
<PdfViewerEvents FormFieldAdded="@OnFormFieldAdded"></PdfViewerEvents>
</SfPdfViewer2>
@code {
SfPdfViewer2 Viewer;
void OnFormFieldAdded(FormFieldAddEventArgs args)
{
// Retrieve the page number where the form field was added
int pageNumber = args.PageNumber;
Console.WriteLine($"Form field added on page: {pageNumber}");
// Additional processing logic
}
}