[]
Represents the text field.
public class TextField : Field, IPdfDict, IOwnedObject, ActionHide.ILinkedObject, ActionFieldsBase.IFieldDef
Initializes a new instance of the TextField class.
public TextField()
Gets or sets the default style string used when the field value is specified using RichTextValue. See PDF specification for details.
Note that GcPdf does not automatically regenerates appearance streams for text fields containing RTF text.
public string DefaultStyleString { get; set; }
Gets or sets the default value of this TextField, applied when the field is reset.
public string DefaultValue { get; set; }
Gets or sets the maximum length of the field’s text, in characters.
public int MaxLen { get; set; }
Gets or sets a value indicating whether the field can contain multiple lines of text.
public bool Multiline { get; set; }
Gets or sets a value indicating whether the field is intended for entering a secure password that should not be echoed visibly to the screen.
public bool Password { get; set; }
Gets or sets a value indicating whether the value of this field should be represented as a rich text string.
public bool RichText { get; set; }
Gets or sets the rich text to be displayed in the TextField. This text can be formatted using HTML tags, see PDF specification for details.
Note that GcPdf does not automatically regenerates appearance streams for text fields containing RTF text.
public string RichTextValue { get; set; }
Gets or sets a value indicating whether the field is scrollable to accommodate more text than fits within its annotation rectangle.
public bool Scrollable { get; set; }
Gets or sets a value indicating whether the text entered in the field is spell-checked.
public bool SpellCheck { get; set; }
Gets or sets the value of TextField.
public string Value { get; set; }
Gets the WidgetAnnotation defining view properties of the text field.
public WidgetAnnotation Widget { get; }
Imposes the specified date format string on the current TextField.
The syntax of the format string is similar to .NET format strings. Some examples are "m/d/yyyy" or "d-mmm-yy".
Note that this method initializes the values of Field.Events.FormatValue and Field.Events.KeyPress only, it does not change the field's value or widget appearance streams.
public void SetDateFormat(string format)
format
stringThe format string. Cannot be null or empty.
Imposes the specified date format string on the current TextField, and assigns to it the specified value as a date.
The syntax of the format string is similar to .NET format strings. Some examples are "m/d/yyyy" or "d-mmm-yy".
public void SetDateValue(DateTime value, string format)
value
System.DateTimeThe value to assign.
format
stringThe format string. Cannot be null or empty.
Imposes the specified numeric formatting options on the current TextField.
Note that this method initializes the values of Field.Events.FormatValue and Field.Events.KeyPress only, it does not change the field's value or widget appearance streams.
public void SetNumberFormat(int decimalPlaces, Field.NumberSeparatorStyle separatorStyle, Field.NumberNegativeStyle negativeStyle, string currencySymbol, Field.CurrencySymbolStyle currencySymbolStyle)
decimalPlaces
intThe number of digits that appear to the right of the decimal point. Valid values are from 0 to 10, inclusive.
separatorStyle
Field.NumberSeparatorStyleThe placement of commas and periods, see Field.NumberSeparatorStyle.
negativeStyle
Field.NumberNegativeStyleHow negative numbers are displayed.
currencySymbol
stringThe currency symbol, or null or empty string.
currencySymbolStyle
Field.CurrencySymbolStyleThe location of the currency symbol in relation to the number.
This parameter is meaningful only if currencySymbol
is not null or empty.
Imposes the specified numeric formatting options on the current TextField, and assigns to it the specified value as a number.
public void SetNumberValue(double value, int decimalPlaces, Field.NumberSeparatorStyle separatorStyle, Field.NumberNegativeStyle negativeStyle, string currencySymbol, Field.CurrencySymbolStyle currencySymbolStyle)
value
doubleThe value to assign.
decimalPlaces
intThe number of digits that appear to the right of the decimal point. Valid values are from 0 to 10, inclusive.
separatorStyle
Field.NumberSeparatorStyleThe placement of commas and periods, see Field.NumberSeparatorStyle.
negativeStyle
Field.NumberNegativeStyleHow negative numbers are displayed.
currencySymbol
stringThe currency symbol, or null or empty string.
currencySymbolStyle
Field.CurrencySymbolStyleThe location of the currency symbol in relation to the number.
This parameter is meaningful only if currencySymbol
is not null or empty.
Imposes the specified percentage formatting options on the current TextField.
Note that this method initializes the values of Field.Events.FormatValue and Field.Events.KeyPress only, it does not change the field's value or widget appearance streams.
public void SetPercentFormat(int decimalPlaces, Field.NumberSeparatorStyle separatorStyle)
decimalPlaces
intThe number of digits that appear to the right of the decimal point. Valid values are from 0 to 10, inclusive.
separatorStyle
Field.NumberSeparatorStyleThe placement of commas and periods, see Field.NumberSeparatorStyle.
Imposes the specified percentage formatting options on the current TextField, and assigns to it the specified value as percentage.
public void SetPercentValue(double value, int decimalPlaces, Field.NumberSeparatorStyle separatorStyle)
value
doubleThe percentage value to assign. For example, 1 corresponds to 100%, 0.5 to 50%, and so on.
decimalPlaces
intThe number of digits that appear to the right of the decimal point. Valid values are from 0 to 10, inclusive.
separatorStyle
Field.NumberSeparatorStyleThe placement of commas and periods.
Imposes the specified special format on the current TextField.
Note that this method initializes the values of Field.Events.FormatValue and Field.Events.KeyPress only, it does not change the field's value or widget appearance streams.
public void SetSpecialFormat(Field.SpecialFormat specialFormat)
specialFormat
Field.SpecialFormatThe special format to use.
Sets the value of the current TextField as a value
formatted according to format
.
This method assumes that value
is already formatted as required.
E.g. if format
is SSN, value
should look like "123-45-6789".
public void SetSpecialFormatValue(string value, Field.SpecialFormat format)
value
stringThe value to assign.
format
Field.SpecialFormatThe special format to use.
Imposes the specified time format string on the current TextField.
The syntax of the format string is similar to .NET format strings. Some examples are "HH:MM" or "H:MM tt".
Note that this method initializes the values of Field.Events.FormatValue and Field.Events.KeyPress only, it does not change the field's value or widget appearance streams.
public void SetTimeFormat(string format)
format
stringThe format string. Cannot be null or empty.
Imposes the specified time format string on the current TextField, and assigns to it the specified value as time.
The syntax of the format string is similar to .NET format strings. Some examples are "HH:MM" or "H:MM tt".
public void SetTimeValue(DateTime value, string format)
value
System.DateTimeThe value to assign.
format
stringThe format string. Cannot be null or empty.