Package com.itextpdf.text.pdf
Class PdfFormField
java.lang.Object
com.itextpdf.text.pdf.PdfObject
com.itextpdf.text.pdf.PdfDictionary
com.itextpdf.text.pdf.PdfAnnotation
com.itextpdf.text.pdf.PdfFormField
- All Implemented Interfaces:
IAccessibleElement
,Serializable
Implements form fields.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.itextpdf.text.pdf.PdfAnnotation
PdfAnnotation.PdfImportedLink
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Allows text fields to support rich text.static final PdfName
static final PdfName
static final PdfName
static final PdfName
static final PdfName
static final PdfName
protected ArrayList<PdfFormField>
(package private) static PdfName[]
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final boolean
protected PdfFormField
Holds value of property parent.static final boolean
static final boolean
static final int
static final int
static final int
static final boolean
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, accessibleAttributes, annotation, APPEARANCE_DOWN, APPEARANCE_NORMAL, APPEARANCE_ROLLOVER, FLAGS_HIDDEN, FLAGS_INVISIBLE, FLAGS_LOCKED, FLAGS_LOCKEDCONTENTS, 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, role, templates, used, writer
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PdfFormField
(PdfWriter writer) Creates new PdfFormFieldPdfFormField
(PdfWriter writer, float llx, float lly, float urx, float ury, PdfAction action) Constructs a newPdfAnnotation
of subtype link (Action). -
Method Summary
Modifier and TypeMethodDescriptionvoid
addKid
(PdfFormField field) protected static PdfFormField
createButton
(PdfWriter writer, int flags) static PdfFormField
createCheckBox
(PdfWriter writer) protected static PdfFormField
createChoice
(PdfWriter writer, int flags, PdfArray options, int topIndex) static PdfFormField
createCombo
(PdfWriter writer, boolean edit, String[][] options, int topIndex) static PdfFormField
createCombo
(PdfWriter writer, boolean edit, String[] options, int topIndex) static PdfFormField
createEmpty
(PdfWriter writer) static PdfFormField
createList
(PdfWriter writer, String[][] options, int topIndex) static PdfFormField
createList
(PdfWriter writer, String[] options, int topIndex) static PdfFormField
createPushButton
(PdfWriter writer) static PdfFormField
createRadioButton
(PdfWriter writer, boolean noToggleToOff) static PdfFormField
createSignature
(PdfWriter writer) static PdfFormField
createTextField
(PdfWriter writer, boolean multiline, boolean password, int maxLen) getKids()
Getter for property parent.(package private) static void
mergeResources
(PdfDictionary result, PdfDictionary source) (package private) static void
mergeResources
(PdfDictionary result, PdfDictionary source, PdfStamperImp writer) protected static PdfArray
processOptions
(String[] options) protected static PdfArray
processOptions
(String[][] options) void
setButton
(int flags) void
void
int
setFieldFlags
(int flags) ORs together the given flags with the current /Ff value.void
void
The mapping name is the name this field uses when submitting form data.void
setQuadding
(int v) Sets text alginment for this fieldvoid
setRichValue
(String rv) Sets the rich value for this field.void
setUsed()
Setter for property used.void
The "user name" is the text shown as a tool.void
setValue
(PdfSignature sig) void
void
void
static PdfAnnotation
shallowDuplicate
(PdfAnnotation annot) Methods inherited from class com.itextpdf.text.pdf.PdfAnnotation
applyCTM, createFileAttachment, createFileAttachment, createFreeText, createInk, createLine, createLink, createLink, createLink, createLink, createMarkup, createPolygonPolyline, createPopup, createScreen, createSquareCircle, createStamp, createText, getAccessibleAttribute, getAccessibleAttributes, getId, getIndirectReference, getMK, getMKColor, getPlaceInPage, getRole, getTemplates, isAnnotation, isForm, isInline, isUsed, setAccessibleAttribute, setAction, setAdditionalActions, setAppearance, setAppearance, setAppearanceState, setBorder, setBorderStyle, setColor, setDefaultAppearanceString, setFlags, setHighlighting, setId, setLayer, setMKAlternateCaption, setMKAlternateIcon, setMKBackgroundColor, setMKBorderColor, setMKIconFit, setMKNormalCaption, setMKNormalIcon, setMKRolloverCaption, setMKRolloverIcon, setMKRotation, setMKTextPosition, setName, setPage, setPage, setPlaceInPage, setPopup, setRole, setRotate, setTitle, toPdf
Methods inherited from class com.itextpdf.text.pdf.PdfDictionary
checkType, clear, contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, 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 Details
-
FF_READ_ONLY
public static final int FF_READ_ONLY- See Also:
-
FF_REQUIRED
public static final int FF_REQUIRED- See Also:
-
FF_NO_EXPORT
public static final int FF_NO_EXPORT- See Also:
-
FF_NO_TOGGLE_TO_OFF
public static final int FF_NO_TOGGLE_TO_OFF- See Also:
-
FF_RADIO
public static final int FF_RADIO- See Also:
-
FF_PUSHBUTTON
public static final int FF_PUSHBUTTON- See Also:
-
FF_MULTILINE
public static final int FF_MULTILINE- See Also:
-
FF_PASSWORD
public static final int FF_PASSWORD- See Also:
-
FF_COMBO
public static final int FF_COMBO- See Also:
-
FF_EDIT
public static final int FF_EDIT- See Also:
-
FF_FILESELECT
public static final int FF_FILESELECT- See Also:
-
FF_MULTISELECT
public static final int FF_MULTISELECT- See Also:
-
FF_DONOTSPELLCHECK
public static final int FF_DONOTSPELLCHECK- See Also:
-
FF_DONOTSCROLL
public static final int FF_DONOTSCROLL- See Also:
-
FF_COMB
public static final int FF_COMB- See Also:
-
FF_RADIOSINUNISON
public static final int FF_RADIOSINUNISON- See Also:
-
FF_RICHTEXT
public static final int FF_RICHTEXTAllows text fields to support rich text.- Since:
- 5.0.6
- See Also:
-
Q_LEFT
public static final int Q_LEFT- See Also:
-
Q_CENTER
public static final int Q_CENTER- See Also:
-
Q_RIGHT
public static final int Q_RIGHT- See Also:
-
MK_NO_ICON
public static final int MK_NO_ICON- See Also:
-
MK_NO_CAPTION
public static final int MK_NO_CAPTION- See Also:
-
MK_CAPTION_BELOW
public static final int MK_CAPTION_BELOW- See Also:
-
MK_CAPTION_ABOVE
public static final int MK_CAPTION_ABOVE- See Also:
-
MK_CAPTION_RIGHT
public static final int MK_CAPTION_RIGHT- See Also:
-
MK_CAPTION_LEFT
public static final int MK_CAPTION_LEFT- See Also:
-
MK_CAPTION_OVERLAID
public static final int MK_CAPTION_OVERLAID- See Also:
-
IF_SCALE_ALWAYS
-
IF_SCALE_BIGGER
-
IF_SCALE_SMALLER
-
IF_SCALE_NEVER
-
IF_SCALE_ANAMORPHIC
-
IF_SCALE_PROPORTIONAL
-
MULTILINE
public static final boolean MULTILINE- See Also:
-
SINGLELINE
public static final boolean SINGLELINE- See Also:
-
PLAINTEXT
public static final boolean PLAINTEXT- See Also:
-
PASSWORD
public static final boolean PASSWORD- See Also:
-
mergeTarget
-
parent
Holds value of property parent. -
kids
-
-
Constructor Details
-
PdfFormField
Constructs a newPdfAnnotation
of subtype link (Action). -
PdfFormField
Creates new PdfFormField
-
-
Method Details
-
setWidget
-
createEmpty
-
setButton
public void setButton(int flags) -
createButton
-
createPushButton
-
createCheckBox
-
createRadioButton
-
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
-
createList
-
createCombo
public static PdfFormField createCombo(PdfWriter writer, boolean edit, String[] options, int topIndex) -
createCombo
public static PdfFormField createCombo(PdfWriter writer, boolean edit, String[][] options, int topIndex) -
processOptions
-
processOptions
-
createSignature
-
getParent
Getter for property parent.- Returns:
- Value of property parent.
-
addKid
-
getKids
-
setFieldFlags
public int setFieldFlags(int flags) ORs together the given flags with the current /Ff value.- Parameters:
flags
- flags to be added.- Returns:
- the old flag value
-
setValueAsString
-
setValueAsName
-
setValue
-
setRichValue
Sets the rich value for this field. It is suggested that the regular value of this field be set to an equivalent value. Rich text values are only supported since PDF 1.5, and require that the FF_RV flag be set. See PDF Reference chapter 12.7.3.4 for details.- Parameters:
rv
- HTML markup for the rich value of this field- Since:
- 5.0.6
-
setDefaultValueAsString
-
setDefaultValueAsName
-
setFieldName
-
setUserName
The "user name" is the text shown as a tool.- Parameters:
s
- user name.
-
setMappingName
The mapping name is the name this field uses when submitting form data.- Parameters:
s
-
-
setQuadding
public void setQuadding(int v) Sets text alginment for this field- Parameters:
v
- one of the Q_* contstants
-
mergeResources
-
mergeResources
-
setUsed
public void setUsed()Description copied from class:PdfAnnotation
Setter for property used.- Overrides:
setUsed
in classPdfAnnotation
-
shallowDuplicate
-