Click or drag to resize

TextWidgetAnnotation Class

A TextWidgetAnnotation is used to provide a user-fillable text field on a form in a document. Note that the act of putting a widget annotation of a page is not enough to mark it as a form field. The annotation must also be put into the Fields collection of the document's Form property as well.
Examples
Creating a typical widget annotation.
TextWidgetAnnotation anno = new TextWidgetAnnotation(bounds, "user", "anonymous");
page.Annotations.Add(anno);
doc.Form.Fields.Add(anno);
Inheritance Hierarchy
SystemObject
  Atalasoft.PdfDoc.Generating.AnnotationsBaseAnnotation
    Atalasoft.PdfDoc.Generating.AnnotationsBaseWidgetAnnotation
      Atalasoft.PdfDoc.Generating.AnnotationsTextWidgetAnnotation

Namespace:  Atalasoft.PdfDoc.Generating.Annotations
Assembly:  Atalasoft.PdfDoc (in Atalasoft.PdfDoc.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public class TextWidgetAnnotation : BaseWidgetAnnotation

The TextWidgetAnnotation type exposes the following members.

Constructors
  NameDescription
Public methodTextWidgetAnnotation
Initializes a new instance of the TextWidgetAnnotation class.
Public methodTextWidgetAnnotation(PdfBounds, String, String)
Initializes a new instance of the TextWidgetAnnotation class.
Public methodTextWidgetAnnotation(PdfBounds, String, String, String, String)
Initializes a new instance of the TextWidgetAnnotation class.
Top
Properties
  NameDescription
Public propertyAdditionalActions
Gets the additional actions associated with the annotation. These are generally only used by widget annotations.
(Inherited from BaseAnnotation.)
Public propertyAnnotationType
Gets the type of the original PDF annotation if this annotation was imported from a file. This is generally only useful if the annotation was a type not recognized or not currently modeled by DotPdf
(Inherited from BaseAnnotation.)
Public propertyAppearance
Gets or sets the AppearanceSet for the annotation. This property defaults to null (no appearance set).
(Inherited from BaseAnnotation.)
Public propertyAutoGenerateBasicAppearance
Gets or sets a value indicating whether to auto generate a basic appearance for the text box. Generation of the appearance happens when the document is saved. Default value is true.
Public propertyBackgroundColor
Gets or sets the color of the background.
(Inherited from BaseWidgetAnnotation.)
Public propertyBorder
Gets or sets the AnnotationBorder for this annotation.
(Inherited from BaseAnnotation.)
Public propertyBorderColor
Gets or sets the color of the border.
(Inherited from BaseWidgetAnnotation.)
Public propertyBorderStyle
Gets or sets the BorderStyle for the annotation.
(Inherited from BaseAnnotation.)
Public propertyBounds
Gets or sets the bounding rectangle for this annotation.
(Inherited from BaseAnnotation.)
Public propertyChildFields
Gets the child fields for this annotation. This will always be null in a BaseWidgetAnnotation
(Inherited from BaseWidgetAnnotation.)
Public propertyClickActions
Gets the set of actions performed when the annotation has been clicked.
(Inherited from BaseAnnotation.)
Public propertyColor
Gets or sets the color of the annotation. The meaning of this color varies based on the annotation type. It may represent the background color of the annotation's icon (if any) when closed, the title bar of the annotation's pop-up window, the border color of the annotation.
(Inherited from BaseAnnotation.)
Public propertyContents
Gets or sets the text contents of the annotation. How contents is used depends on the annotation type. For example a StickyNoteAnnotation will use Contents to represent text the user has entered.
(Inherited from BaseAnnotation.)
Public propertyDefaultAppearanceState
Gets or sets the name of the default appearance state for the annotation. In annotations that may have multiple possible states (say, "On" of "Off") this the name of the default state. In an annotation's "normal" state, this corresponds to Appearance.Normal[DefaultAppearanceState].
(Inherited from BaseAnnotation.)
Public propertyCode exampleDefaultRichTextStyleString
Gets or sets the default style string. The style string is a string that specifies the rich text style to use by default for the annotation, if using the RichTextContent property.
Public propertyDefaultTextAppearance
Gets or sets the default text appearance.
(Inherited from BaseWidgetAnnotation.)
Public propertyDefaultTextValue
Gets or sets the default text value.
Public propertyDefaultValueAsString
Gets the default value as a string.
(Overrides BaseWidgetAnnotationDefaultValueAsString.)
Public propertyDocumentRevision
Gets the revision of the document in which this widget was found.
(Inherited from BaseAnnotation.)
Public propertyEnforceReadyOnlyWithException
Gets or sets a value indicating whether to enforce ready only with the ReadOnly propery with an exception.
(Inherited from BaseAnnotation.)
Public propertyFieldAlternateDescription
Gets or sets the field alternate description for display in the UI.
(Inherited from BaseWidgetAnnotation.)
Public propertyFieldFullName
Gets the fully qualified name of the field. This value is only correct if ParentField has been set. When the parent chain is properly set up, this will return ParentField.FieldFullName + '.' + FieldName
(Inherited from BaseWidgetAnnotation.)
Public propertyFieldName
Gets or sets the name of the field.
(Inherited from BaseWidgetAnnotation.)
Public propertyFieldNameForExport
Gets or sets the field name for export. When data from a form is aggregated, if FieldNameForExport is non-null, it will be used in place of FieldName. This allows you to have field values mapped to a different name which may be more suitable for a data collection application.
(Inherited from BaseWidgetAnnotation.)
Public propertyHidden
Gets or sets a value indicating whether this BaseAnnotation is hidden. A hidden annotation is neither displayed nor printed by a viewer under any circumstances. Default is false.
(Inherited from BaseAnnotation.)
Public propertyHighlightAppearance
Gets or sets the highlight appearance.
(Inherited from BaseWidgetAnnotation.)
Public propertyInvisible
Gets or sets a value indicating whether this BaseAnnotation is invisible. Invisibility specifically means that if the annotation is not recognized by the viewer, then it should not be displayed, otherwise the viewer may make a substitute appearance for the annotation. Default is false.
(Inherited from BaseAnnotation.)
Public propertyIsColumns
Gets or sets a value indicating whether this instance is columns of text.
Public propertyIsDirty
Gets or sets a value indicating whether the annotation is dirty and in need of being written.
(Inherited from BaseAnnotation.)
Public propertyIsFieldNoExport
Gets or sets a value indicating whether this field should not be export.
(Inherited from BaseWidgetAnnotation.)
Public propertyIsFieldReadOnly
Gets or sets a value indicating whether this field is read only.
(Inherited from BaseWidgetAnnotation.)
Public propertyIsFieldRequired
Gets or sets a value indicating whether this field is required.
(Inherited from BaseWidgetAnnotation.)
Public propertyIsFileSelection
Gets or sets a value indicating whether the text is a file selection.
Public propertyIsMultiLine
Gets or sets a value indicating whether this instance is multi line text.
Protected propertyIsParentRequired
Gets a value indicating whether this instance requires the parent property.
(Inherited from BaseAnnotation.)
Public propertyIsPassword
Gets or sets a value indicating whether this instance is password. If true, a PDF viewer should display neutral marks for each of the characters entered. Note that fields values are stored in the PDF file without any encryption. Labeling a field as a password does not imply any security on how that value is stored in the file. At the very least client code should consider encrypting the the output PDF to prevent the password from being stored in clear text.
Public propertyIsReadOnlyOrFieldReadOnly
Determines whether the annotation is read only if either ReadOnly is true or if this object implements IFormElement, if IsFieldReadOnly is true.
(Inherited from BaseAnnotation.)
Public propertyIsRichText
Gets or sets a value indicating whether text is represented by rich text
Public propertyIsScrollable
Gets or sets a value indicating whether the text box will have scroll bars if needed.
Public propertyIsSpellChecked
Gets or sets a value indicating whether the text is spell checked. If true, text entered should be checked by a client service for correct spelling.
Public propertyIsTransparent
Gets or sets a value indicating whether this instance is transparent. This is an indication that there was no Color specified for the annotation.
(Inherited from BaseAnnotation.)
Public propertyLocked
Gets or sets a value indicating whether this BaseAnnotation is locked. A locked annotation may not be deleted or have its properties changed, but its contents (such as a form field) may still be editable.
(Inherited from BaseAnnotation.)
Public propertyMaximumLength
Gets or sets the maximum length of text in the field.
Public propertyModificationDate
Gets or sets the modification date for this annotation. DotPdf does not update this property. It is the client's responsibility to change it.
(Inherited from BaseAnnotation.)
Public propertyName
Gets or sets the name of the annotation. This name is meant to be a unique identifier for the annotation and may be use in scripts in PdfJavaScriptAction objects that want to find an annotation.
(Inherited from BaseAnnotation.)
Public propertyNoRotate
Gets or sets a value indicating whether the annotation should be rotated when a page is rotated. Default is false.
(Inherited from BaseAnnotation.)
Public propertyNoView
Gets or sets a value indicating whether the annotation is viewable and will interact with the user. This is different from hidden in that an annotation NoView set to true can be printed. This is a way, for example, to put watermarks on a page that only show when printed. Default is false.
(Inherited from BaseAnnotation.)
Public propertyNoZoom
Gets or sets a value indicating whether the annotation's appearance is scaled when the page is zoomed in. Default is false.
(Inherited from BaseAnnotation.)
Public propertyParentField
Gets or sets the parent field. When the document is saved, this will be set for you if you haven't set it yourself.
(Inherited from BaseWidgetAnnotation.)
Public propertyParentPage
Gets or sets the parent page that contains this annotation.
(Inherited from BaseAnnotation.)
Public propertyPrint
Gets or sets a value indicating whether this BaseAnnotation is printed. Default is false.
(Inherited from BaseAnnotation.)
Public propertyReadOnly
Gets or sets a value indicating whether the annotation can interact with the user. Default is false.
(Inherited from BaseAnnotation.)
Public propertyRichTextValue
Gets or sets the rich text value.
Public propertyTextAlignment
Gets or sets the text alignment.
Public propertyTextValue
Gets or sets the text value of the field.
Public propertyToggleNoView
Gets or sets a value indicating whether to toggle the sense of the NoView property. This might be used to make an annotation visible when the mouse enters it.
(Inherited from BaseAnnotation.)
Public propertyValueAsString
Gets the value as a string.
(Overrides BaseWidgetAnnotationValueAsString.)
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic memberGenerateAutoFontSize
Calculates the font size used for auto-sized fonts.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasAppearance
Determines whether this instance has at least 1 element in the Normal appearance set.
(Inherited from BaseAnnotation.)
Public methodIsValidChildOf
Determines whether this annotation is valid child of the specified form field. Returns true is elem is a GenericFormField or a TextFormField
(Overrides BaseWidgetAnnotationIsValidChildOf(IFormElement).)
Public methodStatic memberCode exampleMakeBasicAppearance
Makes the basic appearance for the annotation. Unlike CheckboxWidgetAnnotation, TextWidgetAnnotation can't easily share the same appearance since appearances are geometrically scaled to fit the bounds of the annotation. This means that border outlines will grow or shrink when drawn. When the Bounds of the annotation change, the appearance needs to be rebuilt in order to render correctly in the document. This method is provided so that, for example, client code might add in custom coloring or easily build consistent appearances for when the annotation has been cliecked on or when it is rolled over.
Public methodMakeRepairContext
Makes the repair context for repairing problems in this annotation object. An object implementing IValidatable should at least return an empty RepairContext object.
(Inherited from BaseAnnotation.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodNotifyResourceRenamed
This method is called when a global resourec has been renamed, allowing the resource consumer to update to the new name. Annotations defer this to their appearance, if any.
(Inherited from BaseAnnotation.)
Public methodResourcesUsed
Reports a list of all resources consumed by the object of the given class.
(Inherited from BaseAnnotation.)
Protected methodThrowIfReadOnlyT
If EnforceReadyOnlyWithException is true and ReadOnly is true, throw an InvalidOperationException, otherwise return value.
(Inherited from BaseAnnotation.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidate
Validates the annotation and accumulates any problems.
(Inherited from BaseAnnotation.)
Protected methodValidateActionList
Validates the action list.
(Inherited from BaseAnnotation.)
Protected methodValidateActions
Validates the actions.
(Inherited from BaseAnnotation.)
Protected methodValidateProperties
Validates the properties of this object and adds any issues to the problems list.
(Overrides BaseWidgetAnnotationValidateProperties(ProblemList, PageRepairContext).)
Top
See Also