[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.AcroForms.TextField

Class TextField

Namespace
GrapeCity.Documents.Pdf.AcroForms
Assembly
GcDocs.Pdf.dll

Represents the text field.

public class TextField : Field, IPdfDict, IOwnedObject, ActionHide.ILinkedObject, ActionFieldsBase.IFieldDef
Inheritance
object
TextField
Implements
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Extension Methods

Constructors

TextField()

Initializes a new instance of the TextField class.

public TextField()

Properties

DefaultStyleString

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; }

Property Value

string

DefaultValue

Gets or sets the default value of this TextField, applied when the field is reset.

public string DefaultValue { get; set; }

Property Value

string

MaxLen

Gets or sets the maximum length of the field’s text, in characters.

public int MaxLen { get; set; }

Property Value

int

Multiline

Gets or sets a value indicating whether the field can contain multiple lines of text.

public bool Multiline { get; set; }

Property Value

bool

Password

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; }

Property Value

bool

RichText

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; }

Property Value

bool

RichTextValue

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; }

Property Value

string

Scrollable

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; }

Property Value

bool

SpellCheck

Gets or sets a value indicating whether the text entered in the field is spell-checked.

public bool SpellCheck { get; set; }

Property Value

bool

Value

Gets or sets the value of TextField.

public string Value { get; set; }

Property Value

string

Widget

Gets the WidgetAnnotation defining view properties of the text field.

public WidgetAnnotation Widget { get; }

Property Value

WidgetAnnotation

Methods

SetDateFormat(string)

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)

Parameters

format string

The format string. Cannot be null or empty.

SetDateValue(DateTime, string)

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)

Parameters

value System.DateTime

The value to assign.

format string

The format string. Cannot be null or empty.

SetNumberFormat(int, NumberSeparatorStyle, NumberNegativeStyle, string, CurrencySymbolStyle)

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)

Parameters

decimalPlaces int

The number of digits that appear to the right of the decimal point. Valid values are from 0 to 10, inclusive.

separatorStyle Field.NumberSeparatorStyle

The placement of commas and periods, see Field.NumberSeparatorStyle.

negativeStyle Field.NumberNegativeStyle

How negative numbers are displayed.

currencySymbol string

The currency symbol, or null or empty string.

currencySymbolStyle Field.CurrencySymbolStyle

The location of the currency symbol in relation to the number. This parameter is meaningful only if currencySymbol is not null or empty.

SetNumberValue(double, int, NumberSeparatorStyle, NumberNegativeStyle, string, CurrencySymbolStyle)

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)

Parameters

value double

The value to assign.

decimalPlaces int

The number of digits that appear to the right of the decimal point. Valid values are from 0 to 10, inclusive.

separatorStyle Field.NumberSeparatorStyle

The placement of commas and periods, see Field.NumberSeparatorStyle.

negativeStyle Field.NumberNegativeStyle

How negative numbers are displayed.

currencySymbol string

The currency symbol, or null or empty string.

currencySymbolStyle Field.CurrencySymbolStyle

The location of the currency symbol in relation to the number. This parameter is meaningful only if currencySymbol is not null or empty.

SetPercentFormat(int, NumberSeparatorStyle)

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)

Parameters

decimalPlaces int

The number of digits that appear to the right of the decimal point. Valid values are from 0 to 10, inclusive.

separatorStyle Field.NumberSeparatorStyle

The placement of commas and periods, see Field.NumberSeparatorStyle.

SetPercentValue(double, int, 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)

Parameters

value double

The percentage value to assign. For example, 1 corresponds to 100%, 0.5 to 50%, and so on.

decimalPlaces int

The number of digits that appear to the right of the decimal point. Valid values are from 0 to 10, inclusive.

separatorStyle Field.NumberSeparatorStyle

The placement of commas and periods.

SetSpecialFormat(SpecialFormat)

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)

Parameters

specialFormat Field.SpecialFormat

The special format to use.

SetSpecialFormatValue(string, SpecialFormat)

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)

Parameters

value string

The value to assign.

format Field.SpecialFormat

The special format to use.

SetTimeFormat(string)

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)

Parameters

format string

The format string. Cannot be null or empty.

SetTimeValue(DateTime, string)

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)

Parameters

value System.DateTime

The value to assign.

format string

The format string. Cannot be null or empty.