- java.lang.Object
-
- com.itextpdf.text.pdf.PdfObject
-
- com.itextpdf.text.pdf.PdfDictionary
-
- com.itextpdf.text.pdf.PdfAnnotation
-
- com.itextpdf.text.pdf.PdfFormField
-
public class PdfFormField extends PdfAnnotation
Implements form fields.- Author:
- Paulo Soares (psoares@consiste.pt)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.itextpdf.text.pdf.PdfAnnotation
PdfAnnotation.PdfImportedLink
-
-
Field Summary
Fields Modifier and Type Field Description static intFF_COMBstatic intFF_COMBOstatic intFF_DONOTSCROLLstatic intFF_DONOTSPELLCHECKstatic intFF_EDITstatic intFF_FILESELECTstatic intFF_MULTILINEstatic intFF_MULTISELECTstatic intFF_NO_EXPORTstatic intFF_NO_TOGGLE_TO_OFFstatic intFF_PASSWORDstatic intFF_PUSHBUTTONstatic intFF_RADIOstatic intFF_RADIOSINUNISONstatic intFF_READ_ONLYstatic intFF_REQUIREDstatic PdfNameIF_SCALE_ALWAYSstatic PdfNameIF_SCALE_ANAMORPHICstatic PdfNameIF_SCALE_BIGGERstatic PdfNameIF_SCALE_NEVERstatic PdfNameIF_SCALE_PROPORTIONALstatic PdfNameIF_SCALE_SMALLERprotected java.util.ArrayListkidsstatic intMK_CAPTION_ABOVEstatic intMK_CAPTION_BELOWstatic intMK_CAPTION_LEFTstatic intMK_CAPTION_OVERLAIDstatic intMK_CAPTION_RIGHTstatic intMK_NO_CAPTIONstatic intMK_NO_ICONstatic booleanMULTILINEprotected PdfFormFieldparentHolds value of property parent.static booleanPASSWORDstatic booleanPLAINTEXTstatic intQ_CENTERstatic intQ_LEFTstatic intQ_RIGHTstatic booleanSINGLELINE-
Fields inherited from class com.itextpdf.text.pdf.PdfAnnotation
AA_BLUR, AA_DOWN, AA_ENTER, AA_EXIT, AA_FOCUS, AA_JS_CHANGE, AA_JS_FORMAT, AA_JS_KEY, AA_JS_OTHER_CHANGE, AA_UP, annotation, APPEARANCE_DOWN, APPEARANCE_NORMAL, APPEARANCE_ROLLOVER, FLAGS_HIDDEN, FLAGS_INVISIBLE, FLAGS_LOCKED, FLAGS_NOROTATE, FLAGS_NOVIEW, FLAGS_NOZOOM, FLAGS_PRINT, FLAGS_READONLY, FLAGS_TOGGLENOVIEW, form, HIGHLIGHT_INVERT, HIGHLIGHT_NONE, HIGHLIGHT_OUTLINE, HIGHLIGHT_PUSH, HIGHLIGHT_TOGGLE, MARKUP_HIGHLIGHT, MARKUP_SQUIGGLY, MARKUP_STRIKEOUT, MARKUP_UNDERLINE, reference, templates, used, writer
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPdfFormField(PdfWriter writer)Creates new PdfFormFieldPdfFormField(PdfWriter writer, float llx, float lly, float urx, float ury, PdfAction action)Constructs a newPdfAnnotationof subtype link (Action).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddKid(PdfFormField field)protected static PdfFormFieldcreateButton(PdfWriter writer, int flags)static PdfFormFieldcreateCheckBox(PdfWriter writer)protected static PdfFormFieldcreateChoice(PdfWriter writer, int flags, PdfArray options, int topIndex)static PdfFormFieldcreateCombo(PdfWriter writer, boolean edit, java.lang.String[][] options, int topIndex)static PdfFormFieldcreateCombo(PdfWriter writer, boolean edit, java.lang.String[] options, int topIndex)static PdfFormFieldcreateEmpty(PdfWriter writer)static PdfFormFieldcreateList(PdfWriter writer, java.lang.String[][] options, int topIndex)static PdfFormFieldcreateList(PdfWriter writer, java.lang.String[] options, int topIndex)static PdfFormFieldcreatePushButton(PdfWriter writer)static PdfFormFieldcreateRadioButton(PdfWriter writer, boolean noToggleToOff)static PdfFormFieldcreateSignature(PdfWriter writer)static PdfFormFieldcreateTextField(PdfWriter writer, boolean multiline, boolean password, int maxLen)java.util.ArrayListgetKids()PdfFormFieldgetParent()Getter for property parent.protected static PdfArrayprocessOptions(java.lang.String[] options)protected static PdfArrayprocessOptions(java.lang.String[][] options)voidsetButton(int flags)voidsetDefaultValueAsName(java.lang.String s)voidsetDefaultValueAsString(java.lang.String s)intsetFieldFlags(int flags)voidsetFieldName(java.lang.String s)voidsetMappingName(java.lang.String s)voidsetQuadding(int v)voidsetUsed()Setter for property used.voidsetUserName(java.lang.String s)voidsetValue(PdfSignature sig)voidsetValueAsName(java.lang.String s)voidsetValueAsString(java.lang.String s)voidsetWidget(Rectangle rect, PdfName highlight)static PdfAnnotationshallowDuplicate(PdfAnnotation annot)-
Methods inherited from class com.itextpdf.text.pdf.PdfAnnotation
createFileAttachment, createFileAttachment, createFreeText, createInk, createLine, createLink, createLink, createLink, createLink, createMarkup, createPopup, createScreen, createSquareCircle, createStamp, createText, getIndirectReference, getMKColor, getPlaceInPage, getTemplates, isAnnotation, isForm, isUsed, setAction, setAdditionalActions, setAppearance, setAppearance, setAppearanceState, setBorder, setBorderStyle, setColor, setDefaultAppearanceString, setFlags, setHighlighting, setLayer, setMKAlternateCaption, setMKAlternateIcon, setMKBackgroundColor, setMKBorderColor, setMKIconFit, setMKNormalCaption, setMKNormalIcon, setMKRolloverCaption, setMKRolloverIcon, setMKRotation, setMKTextPosition, setName, setPage, setPage, setPlaceInPage, setPopup, setRotate, setTitle
-
Methods inherited from class com.itextpdf.text.pdf.PdfDictionary
contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, toPdf, toString
-
Methods inherited from class com.itextpdf.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
-
-
-
Field Detail
-
FF_READ_ONLY
public static final int FF_READ_ONLY
- See Also:
- Constant Field Values
-
FF_REQUIRED
public static final int FF_REQUIRED
- See Also:
- Constant Field Values
-
FF_NO_EXPORT
public static final int FF_NO_EXPORT
- See Also:
- Constant Field Values
-
FF_NO_TOGGLE_TO_OFF
public static final int FF_NO_TOGGLE_TO_OFF
- See Also:
- Constant Field Values
-
FF_RADIO
public static final int FF_RADIO
- See Also:
- Constant Field Values
-
FF_PUSHBUTTON
public static final int FF_PUSHBUTTON
- See Also:
- Constant Field Values
-
FF_MULTILINE
public static final int FF_MULTILINE
- See Also:
- Constant Field Values
-
FF_PASSWORD
public static final int FF_PASSWORD
- See Also:
- Constant Field Values
-
FF_COMBO
public static final int FF_COMBO
- See Also:
- Constant Field Values
-
FF_EDIT
public static final int FF_EDIT
- See Also:
- Constant Field Values
-
FF_FILESELECT
public static final int FF_FILESELECT
- See Also:
- Constant Field Values
-
FF_MULTISELECT
public static final int FF_MULTISELECT
- See Also:
- Constant Field Values
-
FF_DONOTSPELLCHECK
public static final int FF_DONOTSPELLCHECK
- See Also:
- Constant Field Values
-
FF_DONOTSCROLL
public static final int FF_DONOTSCROLL
- See Also:
- Constant Field Values
-
FF_COMB
public static final int FF_COMB
- See Also:
- Constant Field Values
-
FF_RADIOSINUNISON
public static final int FF_RADIOSINUNISON
- See Also:
- Constant Field Values
-
Q_LEFT
public static final int Q_LEFT
- See Also:
- Constant Field Values
-
Q_CENTER
public static final int Q_CENTER
- See Also:
- Constant Field Values
-
Q_RIGHT
public static final int Q_RIGHT
- See Also:
- Constant Field Values
-
MK_NO_ICON
public static final int MK_NO_ICON
- See Also:
- Constant Field Values
-
MK_NO_CAPTION
public static final int MK_NO_CAPTION
- See Also:
- Constant Field Values
-
MK_CAPTION_BELOW
public static final int MK_CAPTION_BELOW
- See Also:
- Constant Field Values
-
MK_CAPTION_ABOVE
public static final int MK_CAPTION_ABOVE
- See Also:
- Constant Field Values
-
MK_CAPTION_RIGHT
public static final int MK_CAPTION_RIGHT
- See Also:
- Constant Field Values
-
MK_CAPTION_LEFT
public static final int MK_CAPTION_LEFT
- See Also:
- Constant Field Values
-
MK_CAPTION_OVERLAID
public static final int MK_CAPTION_OVERLAID
- See Also:
- Constant Field Values
-
IF_SCALE_ALWAYS
public static final PdfName IF_SCALE_ALWAYS
-
IF_SCALE_BIGGER
public static final PdfName IF_SCALE_BIGGER
-
IF_SCALE_SMALLER
public static final PdfName IF_SCALE_SMALLER
-
IF_SCALE_NEVER
public static final PdfName IF_SCALE_NEVER
-
IF_SCALE_ANAMORPHIC
public static final PdfName IF_SCALE_ANAMORPHIC
-
IF_SCALE_PROPORTIONAL
public static final PdfName IF_SCALE_PROPORTIONAL
-
MULTILINE
public static final boolean MULTILINE
- See Also:
- Constant Field Values
-
SINGLELINE
public static final boolean SINGLELINE
- See Also:
- Constant Field Values
-
PLAINTEXT
public static final boolean PLAINTEXT
- See Also:
- Constant Field Values
-
PASSWORD
public static final boolean PASSWORD
- See Also:
- Constant Field Values
-
parent
protected PdfFormField parent
Holds value of property parent.
-
kids
protected java.util.ArrayList kids
-
-
Method Detail
-
createEmpty
public static PdfFormField createEmpty(PdfWriter writer)
-
setButton
public void setButton(int flags)
-
createButton
protected static PdfFormField createButton(PdfWriter writer, int flags)
-
createPushButton
public static PdfFormField createPushButton(PdfWriter writer)
-
createCheckBox
public static PdfFormField createCheckBox(PdfWriter writer)
-
createRadioButton
public static PdfFormField createRadioButton(PdfWriter writer, boolean noToggleToOff)
-
createTextField
public static PdfFormField createTextField(PdfWriter writer, boolean multiline, boolean password, int maxLen)
-
createChoice
protected static PdfFormField createChoice(PdfWriter writer, int flags, PdfArray options, int topIndex)
-
createList
public static PdfFormField createList(PdfWriter writer, java.lang.String[] options, int topIndex)
-
createList
public static PdfFormField createList(PdfWriter writer, java.lang.String[][] options, int topIndex)
-
createCombo
public static PdfFormField createCombo(PdfWriter writer, boolean edit, java.lang.String[] options, int topIndex)
-
createCombo
public static PdfFormField createCombo(PdfWriter writer, boolean edit, java.lang.String[][] options, int topIndex)
-
processOptions
protected static PdfArray processOptions(java.lang.String[] options)
-
processOptions
protected static PdfArray processOptions(java.lang.String[][] options)
-
createSignature
public static PdfFormField createSignature(PdfWriter writer)
-
getParent
public PdfFormField getParent()
Getter for property parent.- Returns:
- Value of property parent.
-
addKid
public void addKid(PdfFormField field)
-
getKids
public java.util.ArrayList getKids()
-
setFieldFlags
public int setFieldFlags(int flags)
-
setValueAsString
public void setValueAsString(java.lang.String s)
-
setValueAsName
public void setValueAsName(java.lang.String s)
-
setValue
public void setValue(PdfSignature sig)
-
setDefaultValueAsString
public void setDefaultValueAsString(java.lang.String s)
-
setDefaultValueAsName
public void setDefaultValueAsName(java.lang.String s)
-
setFieldName
public void setFieldName(java.lang.String s)
-
setUserName
public void setUserName(java.lang.String s)
-
setMappingName
public void setMappingName(java.lang.String s)
-
setQuadding
public void setQuadding(int v)
-
setUsed
public void setUsed()
Description copied from class:PdfAnnotationSetter for property used.- Overrides:
setUsedin classPdfAnnotation
-
shallowDuplicate
public static PdfAnnotation shallowDuplicate(PdfAnnotation annot)
-
-