Package com.lowagie.text.pdf
Class TextField
java.lang.Object
com.lowagie.text.pdf.BaseField
com.lowagie.text.pdf.TextField
Deprecated.
Supports text, combo and list fields generating the correct appearances. All the option in the Acrobat GUI are
supported in an easy to use API.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]Deprecated.Holds value of property choiceExports.private String[]Deprecated.Holds value of property choices.Deprecated.Holds value of property choiceSelection.private StringDeprecated.Holds value of property defaultText.private BaseFontDeprecated.Holds value of property extensionFont.private floatDeprecated.private floatDeprecated.Deprecated.Holds value of property substitutionFonts.private intDeprecated.Fields inherited from class com.lowagie.text.pdf.BaseField
alignment, alternateFieldName, backgroundColor, BORDER_WIDTH_MEDIUM, BORDER_WIDTH_THICK, BORDER_WIDTH_THIN, borderColor, borderStyle, borderWidth, box, COMB, DO_NOT_SCROLL, DO_NOT_SPELL_CHECK, EDIT, fieldName, FILE_SELECTION, font, fontSize, HIDDEN, HIDDEN_BUT_PRINTABLE, INVISIBLE, LOCKED, mappingName, maxCharacterLength, MULTILINE, MULTISELECT, NOVIEW, options, PASSWORD, PRINT, READ_ONLY, REQUIRED, rotation, text, textColor, visibility, VISIBLE, VISIBLE_BUT_DOES_NOT_PRINT, writer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChoiceSelection(int selection) Deprecated.adds another (or a first I suppose) selection to a MULTISELECT list.private static voidchangeFontSize(Phrase p, float size) Deprecated.private static booleanDeprecated.private PhrasecomposePhrase(String text, BaseFont ufont, Color color, float fontSize) Deprecated.Deprecated.Get thePdfAppearanceof a text or combo fieldString[]Deprecated.Gets the export values in list/combo fields.protected PdfFormFieldgetChoiceField(boolean isList) Deprecated.String[]Deprecated.Gets the choices to be presented to the user in list/combo fields.intDeprecated.Gets the zero based index of the selected item.Deprecated.Gets a new combo field.Deprecated.Gets the default text.Deprecated.Gets the extensionFont.(package private) PdfAppearanceDeprecated.Get thePdfAppearanceof a list fieldDeprecated.Gets a new list field.Deprecated.Gets the list of substitution fonts.private intgetTextAlignment(int runDirection) Deprecated.Flip text alignment for RTL texts Not sure why but this is neededDeprecated.Gets a new text field.private intDeprecated.(package private) intDeprecated.Deprecated.static StringobfuscatePassword(String text) Deprecated.Obfuscates a passwordString.static StringremoveCRLF(String text) Deprecated.Removes CRLF from aString.voidsetChoiceExports(String[] choiceExports) Deprecated.Sets the export values in list/combo fields.voidsetChoices(String[] choices) Deprecated.Sets the choices to be presented to the user in list/combo fields.voidsetChoiceSelection(int choiceSelection) Deprecated.Sets the zero based index of the selected item.voidsetChoiceSelections(List<Integer> selections) Deprecated.replaces the existing selections with the param.voidsetDefaultText(String defaultText) Deprecated.Sets the default text.voidsetExtensionFont(BaseFont extensionFont) Deprecated.Sets the extensionFont.voidsetExtraMargin(float extraMarginLeft, float extraMarginTop) Deprecated.Sets extra margins in text fields to better mimic the Acrobat layout.voidsetSubstitutionFontList(List<BaseFont> substitutionFonts) Deprecated.Sets a list of substitution fonts.private static inttextRunDirection(String ptext) Deprecated.private static inttextRunDirectionByContent(String ptext) Deprecated.Chose the run direction of a text field by it's contentprivate static inttextRunDirectionDefault(String ptext) Deprecated.private voidwriteMultipleValues(PdfFormField field, String[][] mix) Deprecated.Methods inherited from class com.lowagie.text.pdf.BaseField
breakLines, getAlignment, getAllHardBreaks, getAlternateFieldName, getBackgroundColor, getBorderAppearance, getBorderColor, getBorderStyle, getBorderWidth, getBox, getFieldName, getFont, getFontSize, getMappingName, getMaxCharacterLength, getOptions, getRealFont, getRotation, getText, getTextColor, getVisibility, getWriter, moveFields, setAlignment, setAlternateFieldName, setBackgroundColor, setBorderColor, setBorderStyle, setBorderWidth, setBox, setFieldName, setFont, setFontSize, setMappingName, setMaxCharacterLength, setOptions, setRotation, setRotationFromPage, setText, setTextColor, setVisibility, setWriter, trimRight
-
Field Details
-
defaultText
Deprecated.Holds value of property defaultText. -
choices
Deprecated.Holds value of property choices. -
choiceExports
Deprecated.Holds value of property choiceExports. -
choiceSelections
Deprecated.Holds value of property choiceSelection. -
topFirst
private int topFirstDeprecated. -
extraMarginLeft
private float extraMarginLeftDeprecated. -
extraMarginTop
private float extraMarginTopDeprecated. -
substitutionFonts
Deprecated.Holds value of property substitutionFonts. -
extensionFont
Deprecated.Holds value of property extensionFont.
-
-
Constructor Details
-
TextField
Deprecated.Creates a newTextField.- Parameters:
writer- the documentPdfWriterbox- the field location and dimensionsfieldName- the field name. Ifnullonly the widget keys will be included in the field allowing it to be used as a kid field.
-
-
Method Details
-
checkRTL
Deprecated. -
textRunDirectionDefault
Deprecated. -
textRunDirectionByContent
Deprecated.Chose the run direction of a text field by it's content- Parameters:
ptext- text field content- Returns:
- int run direction (PdfWriter.RUN_DIRECTION_LTR or PdfWriter.RUN_DIRECTION_RTL or PdfWriter.RUN_DIRECTION_NO_BIDI)
-
textRunDirection
Deprecated. -
changeFontSize
Deprecated. -
removeCRLF
Deprecated.Removes CRLF from aString.- Parameters:
text- the String to remove the CRLF from- Returns:
- String
- Since:
- 2.1.5
-
obfuscatePassword
Deprecated.Obfuscates a passwordString. Every character is replaced by an asterisk (*).- Parameters:
text- the text to obfuscate- Returns:
- String
- Since:
- 2.1.5
-
composePhrase
Deprecated. -
getTextAlignment
private int getTextAlignment(int runDirection) Deprecated.Flip text alignment for RTL texts Not sure why but this is needed -
getAppearance
Deprecated.Get thePdfAppearanceof a text or combo field- Returns:
- A
PdfAppearance - Throws:
IOException- on errorDocumentException- on error
-
getListAppearance
Deprecated.Get thePdfAppearanceof a list field- Returns:
- A
PdfAppearance - Throws:
IOException- on errorDocumentException- on error
-
getTextField
Deprecated.Gets a new text field.- Returns:
- a new text field
- Throws:
IOException- on errorDocumentException- on error
-
getComboField
Deprecated.Gets a new combo field.- Returns:
- a new combo field
- Throws:
IOException- on errorDocumentException- on error
-
getListField
Deprecated.Gets a new list field.- Returns:
- a new list field
- Throws:
IOException- on errorDocumentException- on error
-
getTopChoice
private int getTopChoice()Deprecated. -
getChoiceField
Deprecated.- Throws:
IOExceptionDocumentException
-
writeMultipleValues
Deprecated. -
getDefaultText
Deprecated.Gets the default text.- Returns:
- the default text
-
setDefaultText
Deprecated.Sets the default text. It is only meaningful for text fields.- Parameters:
defaultText- the default text
-
getChoices
Deprecated.Gets the choices to be presented to the user in list/combo fields.- Returns:
- the choices to be presented to the user
-
setChoices
Deprecated.Sets the choices to be presented to the user in list/combo fields.- Parameters:
choices- the choices to be presented to the user
-
getChoiceExports
Deprecated.Gets the export values in list/combo fields.- Returns:
- the export values in list/combo fields
-
setChoiceExports
Deprecated.Sets the export values in list/combo fields. If this array isnullthen the choice values will also be used as the export values.- Parameters:
choiceExports- the export values in list/combo fields
-
getChoiceSelection
public int getChoiceSelection()Deprecated.Gets the zero based index of the selected item.- Returns:
- the zero based index of the selected item
-
setChoiceSelection
public void setChoiceSelection(int choiceSelection) Deprecated.Sets the zero based index of the selected item.- Parameters:
choiceSelection- the zero based index of the selected item
-
gteChoiceSelections
Deprecated. -
addChoiceSelection
public void addChoiceSelection(int selection) Deprecated.adds another (or a first I suppose) selection to a MULTISELECT list. This doesn't do anything unlessthis.options & MUTLISELECT != 0- Parameters:
selection- new selection
-
setChoiceSelections
Deprecated.replaces the existing selections with the param. If this field isn't a MULTISELECT list, all but the first element will be removed.- Parameters:
selections- new selections. If null, it clear()s the underlying ArrayList.
-
getTopFirst
int getTopFirst()Deprecated. -
setExtraMargin
public void setExtraMargin(float extraMarginLeft, float extraMarginTop) Deprecated.Sets extra margins in text fields to better mimic the Acrobat layout.- Parameters:
extraMarginLeft- the extra margin leftextraMarginTop- the extra margin top
-
getSubstitutionFontList
Deprecated.Gets the list of substitution fonts. The list is composed ofBaseFontand can benull. The fonts in this list will be used if the original font doesn't contain the needed glyphs.- Returns:
- the list
-
setSubstitutionFontList
Deprecated.Sets a list of substitution fonts. The list is composed ofBaseFontand can also benull. The fonts in this list will be used if the original font doesn't contain the needed glyphs.- Parameters:
substitutionFonts- the list
-
getExtensionFont
Deprecated.Gets the extensionFont. This font will be searched before the substitution fonts. It may benull.- Returns:
- the extensionFont
-
setExtensionFont
Deprecated.Sets the extensionFont. This font will be searched before the substitution fonts. It may benull.- Parameters:
extensionFont- New value of property extensionFont.
-