[]
Defines AcroForm field.
public class Field : PdfDictWrapper, IPdfDict, IOwnedObject, ActionHide.ILinkedObject, ActionFieldsBase.IFieldDef
Initializes a new instance of the Field class.
public Field()
Gets the AcroForm that owns this object.
public AcroForm AcroForm { get; }
Gets the actual justification to be used when displaying the field’s text.
public VariableTextJustification ActualJustification { get; }
Gets or sets an alternate field name to be used in place of the actual field name wherever the field must be identified in the user interface (such as in error or status messages referring to the field). This text is also useful when extracting the document’s contents in support of accessibility to users with disabilities or for other purposes.
public string AlternateName { get; set; }
Gets or sets an index that is used to determine the field's calculation order. Fields with lower indices are calculated before fields with higher indices.
If several fields have the same CalculationIndex, the calculation order is determined by the order of fields in the collection.
RecalculateValue can be used to specify JavaScript that is used to calculate the field's value.
public int CalculationIndex { get; set; }
Gets the list of child fields.
public FieldCollection Children { get; }
Gets or sets the field's default value.
public object DefaultValue { get; set; }
Gets the GcPdfDocument owning this field.
public GcPdfDocument Doc { get; }
Gets the Field.TriggerEvents object defining events of this field.
public Field.TriggerEvents Events { get; }
Gets or sets a value indicating whether the field must not be exported by a ActionSubmitForm action.
public bool Export { get; set; }
Gets the PdfDict object that can be used to associate arbitrary data with this field.
Note that for text values, in most cases the PdfString type should be used rather than string.
public PdfDict GcProps { get; }
Gets a value indicating whether the GcProps is not empty (i.e. whether this filed has any associated custom properties).
public bool HasGcProps { get; }
Gets or sets the justification to be used in displaying the field’s text.
Note that this field is used only if Justification is not specified.
public VariableTextJustification? Justification { get; set; }
Gets or sets the mapping name to be used when exporting interactive form field data from the document.
public string MappingName { get; set; }
Gets or sets the field's name.
public string Name { get; set; }
Gets the FieldCollection containing this field.
public FieldCollection Owner { get; }
Gets the parent field.
public Field Parent { get; }
Gets or sets the default field's value.
public IPdfObject PdfDefaultValue { get; set; }
Gets or sets the field's value.
public IPdfObject PdfValue { get; set; }
Gets or sets a value indicating whether the user may not change the value of the field. Any associated widget annotations will not interact with the user; that is, they will not respond to mouse clicks or change their appearance in response to mouse motions. This flag is useful for fields whose values are computed or imported from a database.
public bool ReadOnly { get; set; }
Gets or sets a value indicating whether the field must have a value at the time it is exported by a ActionSubmitForm action.
public bool Required { get; set; }
Gets or sets arbitrary data associated with the current field.
Note that this data is runtime only and is not persisted in the PDF.
public object UserData { get; set; }
Gets or sets the field's value.
public object Value { get; set; }
Gets the list of widget annotations associated with this field.
public FieldWidgetCollection Widgets { get; }
Formats a System.DateTime value using the specified date format string.
The syntax of the format string is similar to .NET format strings. Some examples are "m/d/yyyy" or "d-mmm-yy".
public static string FormatDateTimeValue(DateTime value, string format)
value
System.DateTimeThe value to format.
format
stringThe format string. Cannot be null or empty.
Formats a value using the specified numeric formatting options.
public static string FormatNumberValue(double value, int decimalPlaces, Field.NumberSeparatorStyle separatorStyle, Field.NumberNegativeStyle negativeStyle, string currencySymbol, Field.CurrencySymbolStyle currencySymbolStyle)
value
doubleThe value to format.
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.
Formats a value using the specified percentage formatting options.
public static string FormatPercentValue(double value, int decimalPlaces, Field.NumberSeparatorStyle separatorStyle)
value
doubleThe value to format.
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.
The string containing the formatted value.