Save This Page
Home » iText-src-2.1.3 » com.lowagie » text » pdf » [javadoc | source]
com.lowagie.text.pdf
abstract public class: BaseField [javadoc | source]
java.lang.Object
   com.lowagie.text.pdf.BaseField

Direct Known Subclasses:
    TextField, PushbuttonField, RadioCheckField

Common field variables.
Field Summary
public static final  float BORDER_WIDTH_THIN    A thin border with 1 point width. 
public static final  float BORDER_WIDTH_MEDIUM    A medium border with 2 point width. 
public static final  float BORDER_WIDTH_THICK    A thick border with 3 point width. 
public static final  int VISIBLE    The field is visible. 
public static final  int HIDDEN    The field is hidden. 
public static final  int VISIBLE_BUT_DOES_NOT_PRINT    The field is visible but does not print. 
public static final  int HIDDEN_BUT_PRINTABLE    The field is hidden but is printable. 
public static final  int READ_ONLY    The user may not change the value of the field. 
public static final  int REQUIRED    The field must have a value at the time it is exported by a submit-form action. 
public static final  int MULTILINE    The field may contain multiple lines of text. This flag is only meaningful with text fields. 
public static final  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. Once the field is full, no further text will be accepted. 
public static final  int PASSWORD    The field is intended for entering a secure password that should not be echoed visibly to the screen. 
public static final  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. 
public static final  int DO_NOT_SPELL_CHECK    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. 
public static final  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. This flag is only meaningful with combo fields. 
public static final  int COMB    combo box flag. 
protected  float borderWidth     
protected  int borderStyle     
protected  Color borderColor     
protected  Color backgroundColor     
protected  Color textColor     
protected  BaseFont font     
protected  float fontSize     
protected  int alignment     
protected  PdfWriter writer     
protected  String text     
protected  Rectangle box     
protected  int rotation    Holds value of property rotation. 
protected  int visibility    Holds value of property visibility. 
protected  String fieldName    Holds value of property fieldName. 
protected  int options    Holds value of property options. 
protected  int maxCharacterLength    Holds value of property maxCharacterLength. 
Constructor:
 public BaseField(PdfWriter writer,
    Rectangle box,
    String fieldName) 
    Creates a new 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.
Method from com.lowagie.text.pdf.BaseField Summary:
breakLines,   getAlignment,   getBackgroundColor,   getBorderAppearance,   getBorderColor,   getBorderStyle,   getBorderWidth,   getBox,   getFieldName,   getFont,   getFontSize,   getHardBreaks,   getMaxCharacterLength,   getOptions,   getRealFont,   getRotation,   getText,   getTextColor,   getVisibility,   getWriter,   moveFields,   setAlignment,   setBackgroundColor,   setBorderColor,   setBorderStyle,   setBorderWidth,   setBox,   setFieldName,   setFont,   setFontSize,   setMaxCharacterLength,   setOptions,   setRotation,   setRotationFromPage,   setText,   setTextColor,   setVisibility,   setWriter,   trimRight
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.lowagie.text.pdf.BaseField Detail:
 protected static ArrayList breakLines(ArrayList breaks,
    BaseFont font,
    float fontSize,
    float width) 
 public int getAlignment() 
    Gets the text horizontal alignment.
 public Color getBackgroundColor() 
    Gets the background color.
 protected PdfAppearance getBorderAppearance() 
 public Color getBorderColor() 
    Gets the border color.
 public int getBorderStyle() 
    Gets the border style.
 public float getBorderWidth() 
    Gets the border width in points.
 public Rectangle getBox() 
    Gets the field dimension and position.
 public String getFieldName() 
    Gets the field name.
 public BaseFont getFont() 
    Gets the text font.
 public float getFontSize() 
    Gets the font size.
 protected static ArrayList getHardBreaks(String text) 
 public int getMaxCharacterLength() 
    Gets the maximum length of the field's text, in characters.
 public int getOptions() 
    Gets the option flags.
 protected BaseFont getRealFont() throws IOException, DocumentException 
 public int getRotation() 
    Gets the field rotation.
 public String getText() 
    Gets the text.
 public Color getTextColor() 
    Gets the text color.
 public int getVisibility() 
    Gets the field visibility flag.
 public PdfWriter getWriter() 
    Getter for property writer.
 public static  void moveFields(PdfDictionary from,
    PdfDictionary to) 
    Moves the field keys from from to to. The moved keys are removed from from.
 public  void setAlignment(int alignment) 
    Sets the text horizontal alignment. It can be Element.ALIGN_LEFT, Element.ALIGN_CENTER and Element.ALIGN_RIGHT.
 public  void setBackgroundColor(Color backgroundColor) 
    Sets the background color. Set to null for transparent background.
 public  void setBorderColor(Color borderColor) 
    Sets the border color. Set to null to remove the border.
 public  void setBorderStyle(int borderStyle) 
    Sets the border style. The styles are found in PdfBorderDictionary and can be STYLE_SOLID, STYLE_DASHED, STYLE_BEVELED, STYLE_INSET and STYLE_UNDERLINE.
 public  void setBorderWidth(float borderWidth) 
    Sets the border width in points. To eliminate the border set the border color to null.
 public  void setBox(Rectangle box) 
    Sets the field dimension and position.
 public  void setFieldName(String fieldName) 
    Sets the field name.
 public  void setFont(BaseFont font) 
    Sets the text font. If null then Helvetica will be used.
 public  void setFontSize(float fontSize) 
    Sets the font size. If 0 then auto-sizing will be used but only for text fields.
 public  void setMaxCharacterLength(int maxCharacterLength) 
    Sets the maximum length of the field's text, in characters. It is only meaningful for text fields.
 public  void setOptions(int options) 
    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.
 public  void setRotation(int rotation) 
    Sets the field rotation. This value should be the same as the page rotation where the field will be shown.
 public  void setRotationFromPage(Rectangle page) 
    Convenience method to set the field rotation the same as the page rotation.
 public  void setText(String text) 
    Sets the text for text fields.
 public  void setTextColor(Color textColor) 
    Sets the text color. If null the color used will be black.
 public  void setVisibility(int visibility) 
    Sets the field visibility flag. This flags can be one of VISIBLE, HIDDEN, VISIBLE_BUT_DOES_NOT_PRINT and HIDDEN_BUT_PRINTABLE.
 public  void setWriter(PdfWriter writer) 
    Setter for property writer.
 protected static  void trimRight(StringBuffer buf)