Class FormFieldResizedEventArgs
Provides event data for the form field resized event in the SfPdfViewer2 component.
Inheritance
Namespace: Syncfusion.Blazor.SfPdfViewer
Assembly: Syncfusion.Blazor.SfPdfViewer.dll
Syntax
public class FormFieldResizedEventArgs : Object
Remarks
The FormFieldResizedEventArgs class contains details about the form field that was resized, including its previous and updated dimensions, and the page number where the resize occurred. Developers can use this event data to track changes and implement custom logic for resizing 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
}
}
Constructors
FormFieldResizedEventArgs()
Declaration
public FormFieldResizedEventArgs()
Properties
Field
Gets the form field object that was resized in the SfPdfViewer2 component.
Declaration
public FormFieldInfo Field { get; }
Property Value
Type | Description |
---|---|
FormFieldInfo | An instance of FormFieldInfo representing the resized form field. |
Remarks
This property provides access to the form field that was resized, allowing you to retrieve its details and perform necessary actions in response to the resize event.
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}");
// Implement additional logic
}
}
NewBounds
Gets the updated bounds of the form field after resized in the SfPdfViewer2 component.
Declaration
public Bound NewBounds { get; }
Property Value
Type | Description |
---|---|
Bound | A Bound structure representing the form field position and dimensions after resized. |
Remarks
This property provides the updated position and dimensions of the form field after the resize event has occurred. It allows developers to track layout changes, enforce resizing constraints, and dynamically update UI elements.
Examples
<SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
<PdfViewerEvents FormFieldResized="@OnFormFieldResized"></PdfViewerEvents>
</SfPdfViewer2>
@code {
void OnFormFieldResized(FormFieldResizedEventArgs args)
{
// Retrieve the updated bounds of the form field
Bound newBounds = args.NewBounds;
Console.WriteLine($"New Bounds - X: {newBounds.X}, Y: {newBounds.Y}, Width: {newBounds.Width}, Height: {newBounds.Height}");
// Implement additional logic
}
}
OldBounds
Gets the previous bounds of the form field before resizing in the SfPdfViewer2 component.
Declaration
public Bound OldBounds { get; }
Property Value
Type | Description |
---|---|
Bound | A Bound structure representing the form field position and dimensions before resizing. |
Remarks
This property provides the position and dimensions of the form field before the resize event occurred. It helps track layout changes, enforce resizing constraints, and maintain a consistent user experience.
Examples
<SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
<PdfViewerEvents FormFieldResized="@OnFormFieldResized"></PdfViewerEvents>
</SfPdfViewer2>
@code {
void OnFormFieldResized(FormFieldResizedEventArgs args)
{
// Retrieve the previous bounds of the form field
Bound oldBounds = args.OldBounds;
Console.WriteLine($"Old Bounds - X: {oldBounds.X}, Y: {oldBounds.Y}, Width: {oldBounds.Width}, Height: {oldBounds.Height}");
// Implement additional logic
}
}
PageNumber
Gets the page number where the form field was resized 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 resized. |
Remarks
This property helps identify the location of the resized form field within the document.
Examples
<SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
<PdfViewerEvents FormFieldResized="@OnFormFieldResized"></PdfViewerEvents>
</SfPdfViewer2>
@code {
void OnFormFieldResized(FormFieldResizedEventArgs args)
{
// Retrieve the page number where the form field was resized
int pageNumber = args.PageNumber;
Console.WriteLine($"Form field resized on page: {pageNumber}");
// Implement additional logic
}
}