public class

TextWidget

extends Widget
java.lang.Object
   ↳ com.pdftron.pdf.Annot
     ↳ com.pdftron.pdf.annots.Widget
       ↳ com.pdftron.pdf.annots.TextWidget

Class Overview

An object representing a Text Box used in a PDF Form.

Summary

[Expand]
Inherited Constants
From class com.pdftron.pdf.annots.Widget
From class com.pdftron.pdf.Annot
Public Constructors
TextWidget(Obj d)
Creates a Text Widget annotation and initialize it using given Cos/SDF object.
TextWidget()
Create an empty Text Widget annotation.
TextWidget(Annot annot)
Creates a Text Widget annotation and initialize it using given annotation object.
Public Methods
static TextWidget create(Doc doc, Rect pos, String field_name)
Creates a new Text Widget annotation, in the specified document.
static TextWidget create(Doc doc, Rect pos, Field field)
Creates a new Text Widget annotation, in the specified document.
static TextWidget create(Doc doc, Rect pos)
Creates a new Text Widget annotation, in the specified document.
String getText()
Retrieves the text content of the Text Widget.
void setText(String text)
Sets the text content of the Text Widget.
[Expand]
Inherited Methods
From class com.pdftron.pdf.annots.Widget
From class com.pdftron.pdf.Annot
From class java.lang.Object

Public Constructors

public TextWidget (Obj d)

Creates a Text Widget annotation and initialize it using given Cos/SDF object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Parameters
d The object to use to initialize the Text Widget

public TextWidget ()

Create an empty Text Widget annotation.

public TextWidget (Annot annot)

Creates a Text Widget annotation and initialize it using given annotation object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Parameters
annot The annotation to use.

Public Methods

public static TextWidget create (Doc doc, Rect pos, String field_name)

Creates a new Text Widget annotation, in the specified document.

Parameters
doc The document to which the annotation is added.
pos A rectangle specifying the annotation's bounds, specified in user space coordinates.
field_name The name of the field for which to create a Text widget.
Returns
  • A newly created blank Text Widget annotation.

public static TextWidget create (Doc doc, Rect pos, Field field)

Creates a new Text Widget annotation, in the specified document.

Parameters
doc The document to which the annotation is added.
pos A rectangle specifying the annotation's bounds, specified in user space coordinates.
field the field for which to create a Text Widget.
Returns
  • A newly created blank Widget annotation.

public static TextWidget create (Doc doc, Rect pos)

Creates a new Text Widget annotation, in the specified document.

Parameters
doc The document to which the annotation is added.
pos A rectangle specifying the annotation's bounds, specified in user space coordinates.
Returns
  • A newly created blank Text Widget annotation.

public String getText ()

Retrieves the text content of the Text Widget.

Returns
  • The Text Widget contents.

public void setText (String text)

Sets the text content of the Text Widget.

Parameters
text The text to be displayed in the Text Widget.