menu

Blazor

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

    Show / Hide Table of Contents

    Class FormFieldSettings

    Configures the form field settings in the SfPdfViewer2.

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

    Enables users to add, edit, and customize form fields within the PDF Viewer. Provides options to modify properties such as field appearance, alignment, and behavior.

    Examples

    @using Syncfusion.Blazor.SfPdfViewer

    <SfPdfViewer2 DocumentPath="@DocumentPath&quot; Height="800px" Width="100%"> <FormFieldSettings TextBoxFieldSettings="textBoxFieldSettings"> </FormFieldSettings> </SfPdfViewer2>

    @code { private string DocumentPath { get; set; } = "wwwroot/data/sample.pdf"; private TextBoxFieldSettings textBoxFieldSettings = new TextBoxFieldSettings { FontSize = 12, FontFamily = "Symbol" }; }

    Constructors

    FormFieldSettings()

    Declaration
    public FormFieldSettings()

    Properties

    BackgroundColor

    Gets or sets the background color of the form field in the SfPdfViewer2 component.

    Declaration
    public string BackgroundColor { get; set; }
    Property Value
    Type
    System.String
    Remarks

    Defines the background color of the form field to enhance its visual appearance.
    This property accepts any valid HEX color code, RGB value, or CSS color name.

    Key Points:

    • The default background color is transparent.
    • The property supports standard color formats like #RRGGBB, #AARRGGBB, and CSS color names.
    • Setting this property helps improve user experience by highlighting form fields.
    • This setting applies to all newly added form fields through the FormFieldSettings configuration.

    Example Color Values:

    • &quot;#FFFF00&quot; - Yellow
    • &quot;rgba(255, 0, 0, 0.5)&quot; - Semi-transparent red
    • &quot;Blue&quot; - CSS Color Name
    Examples

    The following example demonstrates how to set a custom background color for button form fields in the SfPdfViewer2 component.

    @using Syncfusion.Blazor.SfPdfViewer
    
    
    
    
    
    
    @code {
        private string DocumentPath { get; set; } = "wwwroot/data/sample.pdf";
    
        private string backgroundColor = "#FFFF00"; // Yellow background
    }
    See Also
    FormFieldSettings
    SfPdfViewer2

    BorderColor

    Gets or sets the border color of the form field in the SfPdfViewer2 component.

    Declaration
    public string BorderColor { get; set; }
    Property Value
    Type
    System.String
    Remarks

    Specifies the color of the border surrounding the form field. The border color enhances the visual appearance of the field, making it easily identifiable. This property is applicable only to newly added form fields and does not affect existing fields.

    Examples
    @using Syncfusion.Blazor.SfPdfViewer
    
    
    
    
    
    
    @code {
        private string DocumentPath { get; set; } = "wwwroot/data/sample.pdf";
        private string backgroundColor = "#FFFF00"; // Yellow border
    }

    Color

    Gets or sets the text color for the form field in the SfPdfViewer2 component.

    Declaration
    public string Color { get; set; }
    Property Value
    Type
    System.String
    Remarks

    Defines the color of the text inside the form field.
    It is applicable to text-based fields such as Button, Text Box, Password, List Box, and Drop Down fields.
    This property is not applicable to non-text fields like Radio Button, Check Box, Signature, and Initial fields.
    This setting applies to all newly added form fields.

    Examples
    @using Syncfusion.Blazor.SfPdfViewer
    
    
    
    
    
    
    @code {
        private string DocumentPath { get; set; } = "wwwroot/data/sample.pdf";
        private string color = "#FF5733";
    }

    FontFamily

    Gets or sets the font family of the text in the form field in the SfPdfViewer2 component.

    Declaration
    public string FontFamily { get; set; }
    Property Value
    Type
    System.String
    Remarks

    Defines the font style used for displaying text inside the form field. This setting is applicable to text-based fields such as Button, Text Box, Password, List Box, and Drop Down fields.
    It does not apply to non-text fields like Radio Button, Check Box, Signature, and Initial fields.
    If the specified font is unavailable, the browser may use a default fallback font.
    This setting applies to all newly added form fields.

    Examples
    @using Syncfusion.Blazor.SfPdfViewer
    
    
    
    
    
    
    @code {
        private string DocumentPath { get; set; } = "wwwroot/data/sample.pdf";
        private string fontFamily = "Symbol";
    }

    FontSize

    Gets or sets the font size of the text in the form field in the SfPdfViewer2 component.

    Declaration
    public double FontSize { get; set; }
    Property Value
    Type
    System.Double
    Remarks

    Defines the size of the text displayed inside the form field.
    This property is applicable to text-based fields such as Button, Text Box, Password, List Box, and Drop Down fields.
    It does not apply to non-text fields like Radio Button, Check Box, Signature, and Initial fields.
    This setting applies to all newly added form fields.

    Examples
    @using Syncfusion.Blazor.SfPdfViewer
    
    
    
    
    
    
    @code {
        private string DocumentPath { get; set; } = "wwwroot/data/sample.pdf";
        private double fontSize = 14;
    }

    FontStyle

    Gets or sets the font style of the text in the form field in the SfPdfViewer2 component.

    Declaration
    public FontStyle FontStyle { get; set; }
    Property Value
    Type
    FontStyle
    Remarks

    Defines the style of the text displayed inside the form field.
    This property is applicable to text-based fields such as Button, Text Box, Password, List Box, and Drop Down fields. It does not apply to non-text fields like Radio Button, Check Box, Signature, and Initial fields. This setting applies to all newly added form fields.

    Examples
    @using Syncfusion.Blazor.SfPdfViewer
    
    
    
    
    
    
    @code {
        private string DocumentPath { get; set; } = "wwwroot/data/sample.pdf";
        private FontStyle style = FontStyle.Bold;
    }

    JsNamespace

    Declaration
    protected virtual string JsNamespace { get; set; }
    Property Value
    Type
    System.String

    jsProperty

    Declaration
    protected string jsProperty { get; set; }
    Property Value
    Type
    System.String

    mainParent

    Declaration
    protected SfBaseComponent mainParent { get; set; }
    Property Value
    Type
    SfBaseComponent

    SfTagIndex

    Declaration
    protected virtual int SfTagIndex { get; set; }
    Property Value
    Type
    System.Int32

    Thickness

    Gets or sets the thickness of the border surrounding the form field in the SfPdfViewer2 component.

    Declaration
    public double Thickness { get; set; }
    Property Value
    Type
    System.Double
    Remarks

    Specifies the border thickness of the form field, allowing users to customize the visual appearance of the field's boundary.
    The thickness value is measured in pixels, with higher values resulting in a thicker border.

    Key Points:

    • The default thickness is 1 pixel.
    • Setting the value to 0 hides the form field border.
    • This setting applies globally to all newly added form fields through the FormFieldSettings class.
    • This property enhances the visual appearance and user interface consistency of form fields.

    Default Value: 1

    Examples

    The following example demonstrates how to set a custom border thickness for button form fields in the SfPdfViewer2 component.

    @using Syncfusion.Blazor.SfPdfViewer
    
    
    
    
    
    
    @code {
        private string DocumentPath { get; set; } = "wwwroot/data/sample.pdf";
        private double thickness = 2;
    }
    See Also
    FormFieldSettings
    SfPdfViewer2

    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

    OnParametersSetAsync()

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