com.lowagie.text.pdf
public abstract class BaseField extends Object
Field Summary | |
---|---|
protected int | alignment |
protected Color | backgroundColor |
protected Color | borderColor |
protected int | borderStyle |
protected float | borderWidth |
protected Rectangle | box |
static float | BORDER_WIDTH_MEDIUM A medium border with 2 point width. |
static float | BORDER_WIDTH_THICK A thick border with 3 point width. |
static float | BORDER_WIDTH_THIN A thin border with 1 point width. |
static int | COMB
combo box flag. |
static int | DO_NOT_SCROLL The field will not scroll (horizontally for single-line
fields, vertically for multiple-line fields) to accommodate more text
than will fit within its annotation rectangle. |
static int | DO_NOT_SPELL_CHECK The text entered in the field will not be spell-checked.
|
static int | EDIT If set the combo box includes an editable text box as well as a drop list; if
clear, it includes only a drop list.
|
static HashMap | fieldKeys |
protected String | fieldName Holds value of property fieldName. |
protected BaseFont | font |
protected float | fontSize |
static int | FILE_SELECTION The text entered in the field represents the pathname of
a file whose contents are to be submitted as the value of the field. |
static int | HIDDEN The field is hidden. |
static int | HIDDEN_BUT_PRINTABLE The field is hidden but is printable. |
protected int | maxCharacterLength Holds value of property maxCharacterLength. |
static int | MULTILINE The field may contain multiple lines of text.
|
protected int | options Holds value of property options. |
static int | PASSWORD The field is intended for entering a secure password that should
not be echoed visibly to the screen. |
protected int | rotation Holds value of property rotation. |
static int | READ_ONLY The user may not change the value of the field. |
static int | REQUIRED The field must have a value at the time it is exported by a submit-form
action. |
protected String | text |
protected Color | textColor |
protected int | visibility Holds value of property visibility. |
static int | VISIBLE The field is visible. |
static int | VISIBLE_BUT_DOES_NOT_PRINT The field is visible but does not print. |
protected PdfWriter | writer |
Constructor Summary | |
---|---|
BaseField(PdfWriter writer, Rectangle box, String fieldName) Creates a new TextField . |
Method Summary | |
---|---|
protected static ArrayList | breakLines(ArrayList breaks, BaseFont font, float fontSize, float width) |
void | drawBottomFrame(PdfAppearance app) |
void | drawTopFrame(PdfAppearance app) |
int | getAlignment() Gets the text horizontal alignment. |
Color | getBackgroundColor() Gets the background color. |
protected PdfAppearance | getBorderAppearance() |
Color | getBorderColor() Gets the border color. |
int | getBorderStyle() Gets the border style. |
float | getBorderWidth() Gets the border width in points. |
Rectangle | getBox() Gets the field dimension and position. |
String | getFieldName() Gets the field name. |
BaseFont | getFont() Gets the text font. |
float | getFontSize() Gets the font size. |
protected static ArrayList | getHardBreaks(String text) |
int | getMaxCharacterLength() Gets the maximum length of the fields text, in characters. |
int | getOptions() Gets the option flags. |
protected BaseFont | getRealFont() |
int | getRotation() Gets the field rotation. |
String | getText() Gets the text. |
Color | getTextColor() Gets the text color. |
int | getVisibility() Gets the field visibility flag. |
PdfWriter | getWriter()
Getter for property writer. |
static void | moveFields(PdfDictionary from, PdfDictionary to)
Moves the field keys from from to to . |
void | setAlignment(int alignment) Sets the text horizontal alignment. |
void | setBackgroundColor(Color backgroundColor) Sets the background color. |
void | setBorderColor(Color borderColor) Sets the border color. |
void | setBorderStyle(int borderStyle) Sets the border style. |
void | setBorderWidth(float borderWidth) Sets the border width in points. |
void | setBox(Rectangle box) Sets the field dimension and position. |
void | setFieldName(String fieldName) Sets the field name. |
void | setFont(BaseFont font) Sets the text font. |
void | setFontSize(float fontSize) Sets the font size. |
void | setMaxCharacterLength(int maxCharacterLength) Sets the maximum length of the fields text, in characters.
|
void | setOptions(int options) Sets the option flags. |
void | setRotation(int rotation) Sets the field rotation. |
void | setRotationFromPage(Rectangle page) Convenience method to set the field rotation the same as the
page rotation. |
void | setText(String text) Sets the text for text fields. |
void | setTextColor(Color textColor) Sets the text color. |
void | setVisibility(int visibility) Sets the field visibility flag. |
void | setWriter(PdfWriter writer)
Setter for property writer. |
protected static void | trimRight(StringBuffer buf) |
EDIT
flag set.TextField
.Parameters: writer the document PdfWriter
box the field location and dimensions fieldName the field name. If null
only the widget keys
will be included in the field allowing it to be used as a kid field.
Returns: the text horizontal alignment
Returns: the background color
Returns: the border color
Returns: the border style
Returns: the border width in points
Returns: the field dimension and position
Returns: the field name
Returns: the text font
Returns: the font size
Returns: the maximum length of the fields text, in characters.
Returns: the option flags
Returns: the field rotation
Returns: the text
Returns: the text color
Returns: the field visibility flag
Returns: Value of property writer.
from
to to
. The moved keys
are removed from from
.Parameters: from the source to the destination. It may be null
Element.ALIGN_LEFT
,
Element.ALIGN_CENTER
and Element.ALIGN_RIGHT
.Parameters: alignment the text horizontal alignment
null
for
transparent background.Parameters: backgroundColor the background color
null
to remove
the border.Parameters: borderColor the border color
PdfBorderDictionary
and can be STYLE_SOLID
, STYLE_DASHED
,
STYLE_BEVELED
, STYLE_INSET
and
STYLE_UNDERLINE
.Parameters: borderStyle the border style
null
.Parameters: borderWidth the border width in points
Parameters: box the field dimension and position
Parameters: fieldName the field name. If null
only the widget keys
will be included in the field allowing it to be used as a kid field.
null
then Helvetica
will be used.Parameters: font the text font
Parameters: fontSize the font size
Parameters: maxCharacterLength the maximum length of the fields text, in characters
READ_ONLY
, REQUIRED
,
MULTILINE
, DO_NOT_SCROLL
,
PASSWORD
, FILE_SELECTION
,
DO_NOT_SPELL_CHECK
and EDIT
.Parameters: options the option flags
Parameters: rotation the field rotation
Parameters: page the page
Parameters: text the text
null
the color used
will be black.Parameters: textColor the text color
VISIBLE
, HIDDEN
, VISIBLE_BUT_DOES_NOT_PRINT
and HIDDEN_BUT_PRINTABLE
.Parameters: visibility field visibility flag
Parameters: writer New value of property writer.