TextBoxField

Overview

TextBoxField is a class in Aspose.PDF FOSS for .NET. Inherits from: Field.

This class provides 26 methods for working with TextBoxField objects in .NET programs. Available methods include: Accept, AddBarcode, AddImage, ChangeAfterResize, Clone, CopyTo, ExecuteFieldJavaScript, ExportToJson, ExportValueToJson, Field, Flatten, GetCheckedStateName, and 10 additional methods. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: Action, Actions, ActiveState, Alignment, AlternateName, AnnotationFlags, and 81 more.

Properties

NameTypeAccessDescription
MaxFontSizedoubleRead/WriteStatic default applied to all newly-created TextBoxFields’ auto-fit appearance.
FitIntoRectangleboolRead/WriteStatic default applied to all newly-created TextBoxFields’ FitIntoRectangle flag.
WidthdoubleRead/WriteLayout width when the field is placed inside a layout container (table cell, paragraph).
HeightdoubleRead/WriteLayout height when the field is placed inside a layout container.
MultilineboolRead/WriteMultiline flag (bit 13 of /Ff).
MaxLenintRead/WriteGets or sets the max len.
IsMultilineboolReadGets the is multiline.
IsPasswordboolReadGets the is password.
TextVerticalAlignmentVerticalAlignmentRead/WriteVertical alignment of the text inside the field’s appearance — per published reference.
IsRichTextboolReadTrue when the Tx field has the rich-text flag (bit 26 of /Ff) set.
JustificationintReadText justification: 0 = Left, 1 = Center, 2 = Right.
ForceCombsboolRead/WriteBit 25 of /Ff (Comb): when set, the field is divided into MaxLen equal-width combs.
ScrollableboolRead/WriteInverse of bit 24 of /Ff (DoNotScroll).
SpellCheckboolRead/WriteInverse of bit 23 of /Ff (DoNotSpellCheck).
Valuestring?Read/WriteThe text value stored in /V.
TypeFieldTypeReadThe field type.
FullNamestring?ReadThe fully qualified field name.
Namestring?Read/WriteThe fully qualified field name (alias for FullName).
TextHorizontalAlignmentAspose.Pdf.HorizontalAlignmentRead/WriteText-specific horizontal alignment override applied to the field’s widget appearance.
PageIndexintRead1-based index of the page that owns this field’s widget.
PartialNamestring?Read/WriteThe partial field name (/T).
NormalAppearanceXForm?ReadThe field’s “Normal” appearance (the /AP /N entry).
AppearanceAspose.Pdf.Annotations.AppearanceDictionaryReadThe field widget’s appearance streams (the /AP entry), keyed by appearance name.
OnActivatedAnnotations.PdfAction?Read/WriteThe action triggered when this field is activated (/A entry).
CountintReadNumber of kids in this field’s /Kids array — either child fields (hierarchy nodes) or widget annotations (a terminal field with multiple visual widgets, such as a grouped checkbox/radio).
FieldsField[]ReadField-typed child kids of this field as a snapshot array — convenience accessor mirroring Fields on the form.
DefaultValuestring?ReadThe default value (/DV).
AlternateNamestring?Read/WriteThe alternate field name / tooltip (/TU entry).
FlagsAspose.Pdf.Annotations.AnnotationFlagsRead/WriteThe widget annotation flags (/F entry), e.g.
TabOrderintRead/WriteTab order index for this field.
IsReadOnlyboolReadWhether the field is read-only.
ReadOnlyboolRead/WriteWhether the field is read-only (settable alias for API parity).
IsRequiredboolReadWhether the field is required.
CharacteristicsAspose.Pdf.Annotations.CharacteristicsReadAppearance characteristics (border / background colors, widget rotation).
DefaultAppearanceAspose.Pdf.Annotations.DefaultAppearanceRead/WriteDefault appearance (font, size, colour) of the field — per published reference on WidgetAnnotation.
RectRectangle?Read/WriteThe field rectangle.
BorderBorder?Read/WriteThe field border.
ColorColorRead/WriteThe field color (stored in /DA default appearance string as RGB).
AnnotationIndexintRead/Write1-based index of the widget annotation used by AcroForm rendering when the field has multiple widgets.
IsGroupboolReadWhether this field is a container/group of child fields.
IsSharedFieldboolRead/WriteWhether this field belongs to a shared-fields group.
IsSynchronizedboolReadWhether the collection is thread-safe.
SyncRootobjectReadSynchronization root; returns this instance.
MinFontSizedoubleRead/WriteMinimum font size used by the field’s appearance auto-fit.
MappingNamestring?Read/WriteMapping name used by external scripts to identify the field.
AnnotationTypeAnnotationTypeReadAlways Widget.
ActionsAnnotationActionCollectionReadAction slots for the widget’s /AA tree.
ExportableboolRead/WriteWhether the widget’s value should be exported on form submit.
HighlightingHighlightingModeRead/WriteVisual highlighting mode used when the user clicks the widget (/H entry).
ParentForms.Field?ReadParent Field when this widget is the visual child of an AcroForm field.
RequiredboolRead/WriteWhether the widget must be filled before submit (/Ff bit 2).
HighlightModestringReadThe highlight mode (/H entry).
DefaultAppearanceStringstring?ReadThe default appearance string (/DA entry).
FieldValuestring?ReadThe field value (/V entry).
DefaultFieldValuestring?ReadThe default field value (/DV entry).
FieldTypestring?ReadThe field type (/FT entry).
ActiveStatestring?Read/WriteCurrently-active appearance state (/AS entry).
AlignmentTextAlignmentRead/WriteText alignment (for free-text / widget annotations carrying rich text).
HorizontalAlignmentAspose.Pdf.HorizontalAlignmentRead/WriteHorizontal alignment, exposed in addition to Alignment; the two are independently settable.
StatesAppearanceDictionaryReadAppearance-state dictionary (the per-state sub-dict of AP/N, e.g.
UpdateAppearanceOnConvertboolRead/WriteWhether to regenerate the appearance stream when the annotation is saved into a converted document.
UseFontSubsetboolRead/WriteWhether the embedded font (if any) should be subsetted.
Contentsstring?Read/WriteThe annotation contents (text).
OpacitydoubleRead/WriteAnnotation opacity (0.0 = transparent, 1.0 = opaque).
InteriorColorColor?Read/WriteThe annotation interior color (/IC entry, for circle/square/line annotations).
Titlestring?Read/WriteThe annotation title (author for markup annotations).
Subjectstring?Read/WriteThe annotation subject (/Subj entry).
ModifiedDatestring?ReadThe modification date.
ModifiedDateTimeRead/WriteThe /M (modified) date as a typed DateTime.
AnnotationFlagsAnnotationFlagsRead/WriteTyped alias of Flags exposing AnnotationFlags as a property.
ActionPdfAction?Read/WriteThe action associated with this annotation (/A entry).
Authorstring?ReadThe annotation author (/T entry).
AnnotationStatestring?ReadThe annotation state (/State entry), e.g.
AnnotationStateModelstring?ReadThe annotation state model (/StateModel entry), e.g.
ReplyTypestring?ReadThe reply type (/RT entry), e.g.
InReplyToAnnotation?Read/WriteThe annotation this one is replying to (/IRT entry).
QuadPointsPoint[]Read/WriteQuadPoints as an array of Point values.
PagePage?ReadThe page that owns this annotation, or null when it can’t be resolved (e.g.
VerticalAlignmentVerticalAlignmentRead/WriteVertical alignment applied to this paragraph.
MarginMarginInfo?Read/WriteOuter-margin info applied to this paragraph.
IsFirstParagraphInColumnboolRead/WriteForce the paragraph to start a new column.
IsKeptWithNextboolRead/WriteKeep this paragraph on the same page as the next one.
IsInNewPageboolRead/WriteForce the paragraph to start on a new page.
IsInLineParagraphboolRead/WriteInline paragraph flag (does not start a new line).
HyperlinkTextstring?Read/WriteLegacy string-typed hyperlink target.
HyperlinkHyperlink?Read/WriteTyped hyperlink decoration applied to the paragraph.
ZIndexintRead/WriteZ-order index used by the DOM renderer.

Methods

SignatureDescription
TextBoxField(page: Page, rect: Rectangle)Creates a new text box field on the specified page with the given rectangle.
TextBoxField(doc: Document, rect: Rectangle)Creates a new text box field associated with the document (page assigned via Form.Add).
TextBoxField(doc: Document)Document-bound text box without a rectangle.
TextBoxField(page: Page, rects: Rectangle[])Multi-widget text field — first rectangle is used for the widget dictionary; additional rectangles are stored on /Kids to honour the multi-widget contract.
TextBoxField()Parameterless ctor — creates an unbound text box field.
AddBarcode(code: string)Encode code as a placeholder barcode in the field value.
AddImage(image: System.Drawing.Image)Stub for image overlay support.
Field(doc: Document)Create a field bound to a document.
GetEnumerator()Iterates widget annotations for this field’s kids in the /Kids array.
CopyTo(array: Aspose.Pdf.Annotations.WidgetAnnotation[], index: int)Copy widget annotations into an array starting at index.
ExecuteFieldJavaScript(javaScriptAction: Aspose.Pdf.Annotations.JavascriptAction)Execute the supplied JavaScript action against this field.
ExportToJson(stream: Stream)Serialise this field to JSON (a single FieldExportingData object) via the supplied stream.
ExportValueToJson(outputJsonStream: Stream, indented: bool)Write the field’s name, flags and value to a JSON stream.
Flatten()Flatten this field — turn its value into static page content.
GetWidgetEnumerator()Enumerator typed to WidgetAnnotation.
ImportValueFromJson(inputJsonStream: Stream)Read this field’s value from a JSON stream.
Recalculate()Recalculate the field’s value from its calculation script.
SetPosition(point: Aspose.Pdf.Point)Move the field’s first widget rectangle to the supplied point (top-left corner).
WidgetAnnotation(doc: Document)Programmatic ctor — creates a bare widget annotation associated with doc’s reader.
GetCheckedStateName()Returns the appearance state name that represents the “on” / “checked” state of this widget (typically “Yes”), looked up from the /AP/N dict’s keys (anything that isn’t “Off”).
Accept(visitor: AnnotationSelector)Calls Accept on this TextBoxField instance.
GetRectangle(considerRotation: bool)Bounding rectangle adjusted by considerRotation.
ChangeAfterResize(transform: Matrix)Adjust the annotation’s geometry after the user resized the page or the host rectangle.
UpdateAppearances()Regenerate the normal appearance stream (/AP /N) from the annotation’s current geometry and colours.
WriteXfdf(writer: System.Xml.XmlWriter)Serialize this annotation as an XFDF element to writer (PDF 32000 §12.7.8 / XFDF 3.0).
Clone()Shallow clone — copies scalar/ref-shared state.

See Also