| java.lang.Object com.lowagie.text.pdf.BaseField
All known Subclasses: com.lowagie.text.pdf.RadioCheckField, com.lowagie.text.pdf.TextField, com.lowagie.text.pdf.PushbuttonField,
BaseField | abstract public class BaseField (Code) | | Common field variables.
author: Paulo Soares (psoares@consiste.pt) |
Field Summary | |
final public static float | BORDER_WIDTH_MEDIUM A medium border with 2 point width. | final public static float | BORDER_WIDTH_THICK A thick border with 3 point width. | final public static float | BORDER_WIDTH_THIN A thin border with 1 point width. | final public static int | COMB combo box flag. | final public 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. | final public static int | DO_NOT_SPELL_CHECK The text entered in the field will not be spell-checked. | final public 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. | final public 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. | final public static int | HIDDEN The field is hidden. | final public static int | HIDDEN_BUT_PRINTABLE The field is hidden but is printable. | final public static int | MULTILINE The field may contain multiple lines of text. | final public static int | PASSWORD The field is intended for entering a secure password that should
not be echoed visibly to the screen. | final public static int | READ_ONLY The user may not change the value of the field. | final public static int | REQUIRED The field must have a value at the time it is exported by a submit-form
action. | final public static int | VISIBLE The field is visible. | final public static int | VISIBLE_BUT_DOES_NOT_PRINT The field is visible but does not print. | protected int | alignment | protected Color | backgroundColor | protected Color | borderColor | protected int | borderStyle | protected float | borderWidth | protected Rectangle | box | protected String | fieldName Holds value of property fieldName. | protected BaseFont | font | protected float | fontSize | protected int | maxCharacterLength Holds value of property maxCharacterLength. | protected int | options Holds value of property options. | protected int | rotation Holds value of property rotation. | protected String | text | protected Color | textColor | protected int | visibility Holds value of property visibility. | protected PdfWriter | writer |
Constructor Summary | |
public | BaseField(PdfWriter writer, Rectangle box, String fieldName) Creates a new TextField .
Parameters: writer - the document PdfWriter Parameters: box - the field location and dimensions Parameters: fieldName - the field name. |
BORDER_WIDTH_MEDIUM | final public static float BORDER_WIDTH_MEDIUM(Code) | | A medium border with 2 point width.
|
BORDER_WIDTH_THICK | final public static float BORDER_WIDTH_THICK(Code) | | A thick border with 3 point width.
|
BORDER_WIDTH_THIN | final public static float BORDER_WIDTH_THIN(Code) | | A thin border with 1 point width.
|
COMB | final public static int COMB(Code) | | combo box flag.
|
DO_NOT_SCROLL | final public static int DO_NOT_SCROLL(Code) | | 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. Once the field is full, no
further text will be accepted.
|
DO_NOT_SPELL_CHECK | final public static int DO_NOT_SPELL_CHECK(Code) | | The text entered in the field will not be spell-checked.
This flag is meaningful only in text fields and in combo
fields with the EDIT flag set.
|
EDIT | final public static int EDIT(Code) | | If set the combo box includes an editable text box as well as a drop list; if
clear, it includes only a drop list.
This flag is only meaningful with combo fields.
|
FILE_SELECTION | final public static int FILE_SELECTION(Code) | | The text entered in the field represents the pathname of
a file whose contents are to be submitted as the value of the field.
|
HIDDEN | final public static int HIDDEN(Code) | | The field is hidden.
|
HIDDEN_BUT_PRINTABLE | final public static int HIDDEN_BUT_PRINTABLE(Code) | | The field is hidden but is printable.
|
MULTILINE | final public static int MULTILINE(Code) | | The field may contain multiple lines of text.
This flag is only meaningful with text fields.
|
PASSWORD | final public static int PASSWORD(Code) | | The field is intended for entering a secure password that should
not be echoed visibly to the screen.
|
READ_ONLY | final public static int READ_ONLY(Code) | | The user may not change the value of the field.
|
REQUIRED | final public static int REQUIRED(Code) | | The field must have a value at the time it is exported by a submit-form
action.
|
VISIBLE | final public static int VISIBLE(Code) | | The field is visible.
|
VISIBLE_BUT_DOES_NOT_PRINT | final public static int VISIBLE_BUT_DOES_NOT_PRINT(Code) | | The field is visible but does not print.
|
alignment | protected int alignment(Code) | | |
borderStyle | protected int borderStyle(Code) | | |
borderWidth | protected float borderWidth(Code) | | |
fieldName | protected String fieldName(Code) | | Holds value of property fieldName.
|
fontSize | protected float fontSize(Code) | | |
maxCharacterLength | protected int maxCharacterLength(Code) | | Holds value of property maxCharacterLength.
|
options | protected int options(Code) | | Holds value of property options.
|
rotation | protected int rotation(Code) | | Holds value of property rotation.
|
visibility | protected int visibility(Code) | | Holds value of property visibility.
|
BaseField | public BaseField(PdfWriter writer, Rectangle box, String fieldName)(Code) | | Creates a new TextField .
Parameters: writer - the document PdfWriter Parameters: box - the field location and dimensions Parameters: fieldName - the field name. If null only the widget keyswill be included in the field allowing it to be used as a kid field. |
getAlignment | public int getAlignment()(Code) | | Gets the text horizontal alignment.
the text horizontal alignment |
getBackgroundColor | public Color getBackgroundColor()(Code) | | Gets the background color.
the background color |
getBorderColor | public Color getBorderColor()(Code) | | Gets the border color.
the border color |
getBorderStyle | public int getBorderStyle()(Code) | | Gets the border style.
the border style |
getBorderWidth | public float getBorderWidth()(Code) | | Gets the border width in points.
the border width in points |
getBox | public Rectangle getBox()(Code) | | Gets the field dimension and position.
the field dimension and position |
getFieldName | public String getFieldName()(Code) | | Gets the field name.
the field name |
getFont | public BaseFont getFont()(Code) | | Gets the text font.
the text font |
getFontSize | public float getFontSize()(Code) | | Gets the font size.
the font size |
getMaxCharacterLength | public int getMaxCharacterLength()(Code) | | Gets the maximum length of the field's text, in characters.
the maximum length of the field's text, in characters. |
getOptions | public int getOptions()(Code) | | Gets the option flags.
the option flags |
getRotation | public int getRotation()(Code) | | Gets the field rotation.
the field rotation |
getText | public String getText()(Code) | | Gets the text.
the text |
getTextColor | public Color getTextColor()(Code) | | Gets the text color.
the text color |
getVisibility | public int getVisibility()(Code) | | Gets the field visibility flag.
the field visibility flag |
getWriter | public PdfWriter getWriter()(Code) | | Getter for property writer.
Value of property writer. |
moveFields | public static void moveFields(PdfDictionary from, PdfDictionary to)(Code) | | Moves the field keys from from to to . The moved keys
are removed from from .
Parameters: from - the source Parameters: to - the destination. It may be null |
setAlignment | public void setAlignment(int alignment)(Code) | | Sets the text horizontal alignment. It can be Element.ALIGN_LEFT ,
Element.ALIGN_CENTER and Element.ALIGN_RIGHT .
Parameters: alignment - the text horizontal alignment |
setBackgroundColor | public void setBackgroundColor(Color backgroundColor)(Code) | | Sets the background color. Set to null for
transparent background.
Parameters: backgroundColor - the background color |
setBorderColor | public void setBorderColor(Color borderColor)(Code) | | Sets the border color. Set to null to remove
the border.
Parameters: borderColor - the border color |
setBorderStyle | public void setBorderStyle(int borderStyle)(Code) | | Sets the border style. The styles are found in PdfBorderDictionary
and can be STYLE_SOLID , STYLE_DASHED ,
STYLE_BEVELED , STYLE_INSET and
STYLE_UNDERLINE .
Parameters: borderStyle - the border style |
setBorderWidth | public void setBorderWidth(float borderWidth)(Code) | | Sets the border width in points. To eliminate the border
set the border color to null .
Parameters: borderWidth - the border width in points |
setBox | public void setBox(Rectangle box)(Code) | | Sets the field dimension and position.
Parameters: box - the field dimension and position |
setFieldName | public void setFieldName(String fieldName)(Code) | | Sets the field name.
Parameters: fieldName - the field name. If null only the widget keyswill be included in the field allowing it to be used as a kid field. |
setFont | public void setFont(BaseFont font)(Code) | | Sets the text font. If null then Helvetica
will be used.
Parameters: font - the text font |
setFontSize | public void setFontSize(float fontSize)(Code) | | Sets the font size. If 0 then auto-sizing will be used but
only for text fields.
Parameters: fontSize - the font size |
setMaxCharacterLength | public void setMaxCharacterLength(int maxCharacterLength)(Code) | | Sets the maximum length of the field's text, in characters.
It is only meaningful for text fields.
Parameters: maxCharacterLength - the maximum length of the field's text, in characters |
setOptions | public void setOptions(int options)(Code) | | Sets the option flags. The option flags can be a combination by oring of
READ_ONLY , REQUIRED ,
MULTILINE , DO_NOT_SCROLL ,
PASSWORD , FILE_SELECTION ,
DO_NOT_SPELL_CHECK and EDIT .
Parameters: options - the option flags |
setRotation | public void setRotation(int rotation)(Code) | | Sets the field rotation. This value should be the same as
the page rotation where the field will be shown.
Parameters: rotation - the field rotation |
setRotationFromPage | public void setRotationFromPage(Rectangle page)(Code) | | Convenience method to set the field rotation the same as the
page rotation.
Parameters: page - the page |
setText | public void setText(String text)(Code) | | Sets the text for text fields.
Parameters: text - the text |
setTextColor | public void setTextColor(Color textColor)(Code) | | Sets the text color. If null the color used
will be black.
Parameters: textColor - the text color |
setVisibility | public void setVisibility(int visibility)(Code) | | Sets the field visibility flag. This flags can be one of
VISIBLE , HIDDEN , VISIBLE_BUT_DOES_NOT_PRINT
and HIDDEN_BUT_PRINTABLE .
Parameters: visibility - field visibility flag |
setWriter | public void setWriter(PdfWriter writer)(Code) | | Setter for property writer.
Parameters: writer - New value of property writer. |
|
|