menu

Blazor

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

    Show / Hide Table of Contents

    Class PasswordField

    Represents a password input field in the SfPdfViewer2 component.

    Inheritance
    System.Object
    FormFieldInfo
    PasswordField
    Inherited Members
    FormFieldInfo.BackgroundColor
    FormFieldInfo.BorderColor
    FormFieldInfo.Bounds
    FormFieldInfo.Color
    FormFieldInfo.CustomData
    FormFieldInfo.FontFamily
    FormFieldInfo.FontSize
    FormFieldInfo.FontStyle
    FormFieldInfo.Id
    FormFieldInfo.IsReadOnly
    FormFieldInfo.IsRequired
    FormFieldInfo.Name
    FormFieldInfo.PageNumber
    FormFieldInfo.TextAlignment
    FormFieldInfo.Thickness
    FormFieldInfo.TooltipText
    FormFieldInfo.Type
    FormFieldInfo.Visibility
    Namespace: Syncfusion.Blazor.SfPdfViewer
    Assembly: Syncfusion.Blazor.SfPdfViewer.dll
    Syntax
    public class PasswordField : FormFieldInfo
    Remarks

    Initializes a new instance of the PasswordField class with the default field type set to "Password."
    This field allows users to input text securely in interactive PDF forms, where the input is masked for privacy.

    Examples
    PasswordField passwordField = new PasswordField();
    passwordField.Name = "UserPassword";
    passwordField.Value = "Enter your password";
    await viewer.AddFormFieldsAsync(new List<FormFieldInfo> { passwordField });

    Constructors

    PasswordField()

    Initializes a new instance of the PasswordField class in the SfPdfViewer2 component.

    Declaration
    public PasswordField()
    Remarks

    This constructor creates a password field with the default field type set to "Password." Password input fields mask user-entered text for security purposes.

    Examples
    PasswordField passwordField = new PasswordField();
    passwordField.Name = "UserPassword";
    passwordField.Value = "Enter your password";
    await viewer.AddFormFieldsAsync(new List<FormFieldInfo> { passwordField });

    Properties

    MaxLength

    Gets or sets the maximum number of characters allowed in the PasswordField of the SfPdfViewer2 component.

    Declaration
    public int MaxLength { get; set; }
    Property Value
    Type Description
    System.Int32

    A System.Int32 representing the maximum number of characters allowed in the password field.
    The default value is 0, meaning no limit is applied.

    Remarks

    Specifies the upper limit for user input in the PasswordField. When this property is set, the field restricts user input to the specified character limit. Setting the value to 0 or a negative number means no limit is applied. This property is useful for ensuring that password input meets security or formatting requirements.

    Examples
    PasswordField passwordField = new PasswordField();
    passwordField.MaxLength = 16; // Restricts password input to 16 characters.

    Value

    Gets or sets the password input of the PasswordField in the SfPdfViewer2 component.

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

    A System.String representing the password input of the PasswordField.
    The entered value is masked in the viewer for security.

    Remarks

    Represents the user-entered or pre-filled password in the PasswordField. Changing this property updates the stored password value in the corresponding PDF form field.
    The input is masked in the PDF viewer for security purposes.

    Examples
    PasswordField passwordField = new PasswordField();
    passwordField.Value = "SecurePass123"; // Sets the password field value.
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved