public class PdfFormField extends PdfObjectWrapper<PdfDictionary>
AcroForm.
To be able to be wrapped with this PdfObjectWrapper the PdfObject
must be indirect.
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGN_CENTER |
static int |
ALIGN_LEFT |
static int |
ALIGN_RIGHT |
protected Color |
backgroundColor |
protected Color |
borderColor |
protected float |
borderWidth |
protected int |
checkType |
protected Color |
color |
static int |
DA_COLOR
Deprecated.
Will be made package-private in iText 7.2.
|
static int |
DA_FONT
Deprecated.
Will be made package-private in iText 7.2.
|
static int |
DA_SIZE
Deprecated.
Will be made package-private in iText 7.2.
|
static int |
DEFAULT_FONT_SIZE
Deprecated.
Will be made package-private in iText 7.2.
|
static int |
FF_MULTILINE
Flag that designates, if set, that the field can contain multiple lines
of text.
|
static int |
FF_NO_EXPORT |
static int |
FF_PASSWORD
Flag that designates, if set, that the field's contents must be obfuscated.
|
static int |
FF_READ_ONLY |
static int |
FF_REQUIRED |
protected PdfFont |
font |
protected float |
fontSize |
protected PdfFormXObject |
form |
static int |
HIDDEN |
static int |
HIDDEN_BUT_PRINTABLE |
protected com.itextpdf.io.image.ImageData |
img |
static int |
MIN_FONT_SIZE
Deprecated.
Will be made package-private in iText 7.2.
|
protected PdfAConformanceLevel |
pdfAConformanceLevel |
protected int |
rotation |
protected String |
text |
static int |
TYPE_CHECK
A field with the symbol check
|
static int |
TYPE_CIRCLE
A field with the symbol circle
|
static int |
TYPE_CROSS
A field with the symbol cross
|
static int |
TYPE_DIAMOND
A field with the symbol diamond
|
static int |
TYPE_SQUARE
A field with the symbol square
|
static int |
TYPE_STAR
A field with the symbol star
|
protected static String[] |
typeChars |
static int |
VISIBLE |
static int |
VISIBLE_BUT_DOES_NOT_PRINT |
static float |
X_OFFSET
Deprecated.
Will be made package-private in iText 7.2.
|
| Modifier | Constructor and Description |
|---|---|
|
PdfFormField(PdfDictionary pdfObject)
Creates a form field as a wrapper object around a
PdfDictionary. |
protected |
PdfFormField(PdfDocument pdfDocument)
Creates a minimal
PdfFormField. |
protected |
PdfFormField(PdfWidgetAnnotation widget,
PdfDocument pdfDocument)
Creates a form field as a parent of a
PdfWidgetAnnotation. |
| Modifier and Type | Method and Description |
|---|---|
PdfFormField |
addKid(PdfFormField kid)
Adds a new kid to the
Kids array property from a
PdfFormField. |
PdfFormField |
addKid(PdfWidgetAnnotation kid)
Adds a new kid to the
Kids array property from a
PdfWidgetAnnotation. |
static PdfButtonFormField |
createButton(PdfDocument doc,
int flags)
Creates an empty
button form field with custom
behavior and layout. |
static PdfButtonFormField |
createButton(PdfDocument doc,
int flags,
PdfAConformanceLevel pdfAConformanceLevel)
Creates an empty
button form field with custom
behavior and layout. |
static PdfButtonFormField |
createButton(PdfDocument doc,
Rectangle rect,
int flags)
Creates an empty
button form field with custom
behavior and layout, on a specified location. |
static PdfButtonFormField |
createButton(PdfDocument doc,
Rectangle rect,
int flags,
PdfAConformanceLevel pdfAConformanceLevel)
Creates an empty
button form field with custom
behavior and layout, on a specified location. |
static PdfButtonFormField |
createCheckBox(PdfDocument doc,
Rectangle rect,
String name,
String value)
Creates a
PdfButtonFormField as a checkbox. |
static PdfButtonFormField |
createCheckBox(PdfDocument doc,
Rectangle rect,
String name,
String value,
int checkType)
Creates a
PdfButtonFormField as a checkbox. |
static PdfButtonFormField |
createCheckBox(PdfDocument doc,
Rectangle rect,
String name,
String value,
int checkType,
PdfAConformanceLevel pdfAConformanceLevel)
Creates a
PdfButtonFormField as a checkbox. |
static PdfChoiceFormField |
createChoice(PdfDocument doc,
int flags)
Creates an empty
choice form field. |
static PdfChoiceFormField |
createChoice(PdfDocument doc,
int flags,
PdfAConformanceLevel pdfAConformanceLevel)
Creates an empty
choice form field. |
static PdfChoiceFormField |
createChoice(PdfDocument doc,
Rectangle rect,
int flags)
Creates an empty
choice form field with custom
behavior and layout, on a specified location. |
static PdfChoiceFormField |
createChoice(PdfDocument doc,
Rectangle rect,
String name,
String value,
PdfArray options,
int flags)
Creates a
choice form field with custom
behavior and layout, on a specified location. |
static PdfChoiceFormField |
createChoice(PdfDocument doc,
Rectangle rect,
String name,
String value,
PdfArray options,
int flags,
PdfFont font,
PdfAConformanceLevel pdfAConformanceLevel)
Creates a
choice form field with custom
behavior and layout, on a specified location. |
static PdfChoiceFormField |
createChoice(PdfDocument doc,
Rectangle rect,
String name,
String value,
PdfFont font,
float fontSize,
PdfArray options,
int flags)
Creates a
choice form field with custom
behavior and layout, on a specified location. |
static PdfChoiceFormField |
createChoice(PdfDocument doc,
Rectangle rect,
String name,
String value,
PdfFont font,
float fontSize,
PdfArray options,
int flags,
PdfAConformanceLevel pdfAConformanceLevel)
Creates a
choice form field with custom
behavior and layout, on a specified location. |
static PdfChoiceFormField |
createComboBox(PdfDocument doc,
Rectangle rect,
String name,
String value,
String[] options)
Creates a
combobox with custom
behavior and layout, on a specified location. |
static PdfChoiceFormField |
createComboBox(PdfDocument doc,
Rectangle rect,
String name,
String value,
String[][] options)
Creates a
combobox with custom
behavior and layout, on a specified location. |
static PdfChoiceFormField |
createComboBox(PdfDocument doc,
Rectangle rect,
String name,
String value,
String[][] options,
PdfFont font,
PdfAConformanceLevel pdfAConformanceLevel)
Creates a
combobox with custom
behavior and layout, on a specified location. |
static PdfChoiceFormField |
createComboBox(PdfDocument doc,
Rectangle rect,
String name,
String value,
String[] options,
PdfFont font,
PdfAConformanceLevel pdfAConformanceLevel)
Creates a
combobox with custom
behavior and layout, on a specified location. |
static PdfFormField |
createEmptyField(PdfDocument doc)
Creates an empty form field without a predefined set of layout or
behavior.
|
static PdfFormField |
createEmptyField(PdfDocument doc,
PdfAConformanceLevel pdfAConformanceLevel)
Creates an empty form field without a predefined set of layout or
behavior.
|
static PdfChoiceFormField |
createList(PdfDocument doc,
Rectangle rect,
String name,
String value,
String[] options)
Creates a
list field with custom
behavior and layout, on a specified location. |
static PdfChoiceFormField |
createList(PdfDocument doc,
Rectangle rect,
String name,
String value,
String[][] options)
Creates a
list field with custom
behavior and layout, on a specified location. |
static PdfChoiceFormField |
createList(PdfDocument doc,
Rectangle rect,
String name,
String value,
String[][] options,
PdfFont font,
PdfAConformanceLevel pdfAConformanceLevel)
Creates a
list field with custom
behavior and layout, on a specified location. |
static PdfChoiceFormField |
createList(PdfDocument doc,
Rectangle rect,
String name,
String value,
String[] options,
PdfFont font,
PdfAConformanceLevel pdfAConformanceLevel)
Creates a
list field with custom
behavior and layout, on a specified location. |
static PdfTextFormField |
createMultilineText(PdfDocument doc,
Rectangle rect,
String name,
String value)
Creates a named
multiline text form field with an initial
value, and the form's default font specified in
PdfAcroForm.getDefaultResources(). |
static PdfTextFormField |
createMultilineText(PdfDocument doc,
Rectangle rect,
String name,
String value,
PdfFont font,
float fontSize)
Creates a named
multilined text form field with an initial
value, with a specified font and font size. |
static PdfButtonFormField |
createPushButton(PdfDocument doc,
Rectangle rect,
String name,
String caption)
Creates a
PdfButtonFormField as a push button without data. |
static PdfButtonFormField |
createPushButton(PdfDocument doc,
Rectangle rect,
String name,
String caption,
PdfFont font,
float fontSize)
Creates a
PdfButtonFormField as a push button without data, with
its caption in a custom font. |
static PdfButtonFormField |
createPushButton(PdfDocument doc,
Rectangle rect,
String name,
String caption,
PdfFont font,
float fontSize,
PdfAConformanceLevel pdfAConformanceLevel)
Creates a
PdfButtonFormField as a push button without data, with
its caption in a custom font. |
static PdfFormField |
createRadioButton(PdfDocument doc,
Rectangle rect,
PdfButtonFormField radioGroup,
String value)
Creates a generic
PdfFormField that is added to a radio group. |
static PdfFormField |
createRadioButton(PdfDocument doc,
Rectangle rect,
PdfButtonFormField radioGroup,
String value,
PdfAConformanceLevel pdfAConformanceLevel)
Creates a generic
PdfFormField that is added to a radio group. |
static PdfButtonFormField |
createRadioGroup(PdfDocument doc,
String name,
String value)
Creates a
radio group form field. |
static PdfButtonFormField |
createRadioGroup(PdfDocument doc,
String name,
String value,
PdfAConformanceLevel pdfAConformanceLevel)
Creates a
radio group form field. |
static PdfSignatureFormField |
createSignature(PdfDocument doc)
Creates an empty
signature form field. |
static PdfSignatureFormField |
createSignature(PdfDocument doc,
PdfAConformanceLevel pdfAConformanceLevel)
Creates an empty
signature form field. |
static PdfSignatureFormField |
createSignature(PdfDocument doc,
Rectangle rect)
Creates an empty
signature form field. |
static PdfSignatureFormField |
createSignature(PdfDocument doc,
Rectangle rect,
PdfAConformanceLevel pdfAConformanceLevel)
Creates an empty
signature form field. |
static PdfTextFormField |
createText(PdfDocument doc)
Creates an empty
text form field. |
static PdfTextFormField |
createText(PdfDocument doc,
PdfAConformanceLevel pdfAConformanceLevel)
Creates an empty
text form field. |
static PdfTextFormField |
createText(PdfDocument doc,
Rectangle rect)
Creates an empty
text form field. |
static PdfTextFormField |
createText(PdfDocument doc,
Rectangle rect,
String name)
Creates a named
text form field with an initial
value, and the form's default font specified in
PdfAcroForm.getDefaultResources(). |
static PdfTextFormField |
createText(PdfDocument doc,
Rectangle rect,
String name,
String value)
Creates a named
text form field with an initial
value, and the form's default font specified in
PdfAcroForm.getDefaultResources(). |
static PdfTextFormField |
createText(PdfDocument doc,
Rectangle rect,
String name,
String value,
PdfFont font,
float fontSize)
Creates a named
text form field with an initial
value, with a specified font and font size. |
static PdfTextFormField |
createText(PdfDocument doc,
Rectangle rect,
String name,
String value,
PdfFont font,
float fontSize,
boolean multiline)
Creates a named
text form field with an initial
value, with a specified font and font size. |
static PdfTextFormField |
createText(PdfDocument doc,
Rectangle rect,
String name,
String value,
PdfFont font,
float fontSize,
boolean multiline,
PdfAConformanceLevel pdfAConformanceLevel)
Creates a named
text form field with an initial
value, with a specified font and font size. |
protected void |
drawBorder(PdfCanvas canvas,
PdfFormXObject xObject,
float width,
float height)
Draws a border using the borderWidth and borderColor of the form field.
|
protected void |
drawButton(PdfCanvas canvas,
float x,
float y,
float width,
float height,
String text,
PdfFont font,
float fontSize)
Performs the low-level drawing operations to draw a button object.
|
protected void |
drawCheckAppearance(float width,
float height,
String onStateName)
Draws the appearance of a checkbox with a specified state value.
|
protected void |
drawCheckBox(PdfCanvas canvas,
float width,
float height,
float fontSize,
boolean on)
Performs the low-level drawing operations to draw a checkbox object.
|
protected void |
drawMultiLineTextAppearance(Rectangle rect,
PdfFont font,
float fontSize,
String value,
PdfFormXObject appearance)
Deprecated.
|
protected void |
drawMultiLineTextAppearance(Rectangle rect,
PdfFont font,
String value,
PdfFormXObject appearance) |
protected void |
drawPdfA1CheckAppearance(float width,
float height,
String selectedValue,
int checkType)
Deprecated.
use
drawPdfA2CheckAppearance(float, float, String, int) instead. |
protected void |
drawPdfA1RadioAppearance(float width,
float height,
String value)
Deprecated.
Please, use
drawRadioAppearance(float, float, String) instead. |
protected void |
drawPdfA2CheckAppearance(float width,
float height,
String onStateName,
int checkType)
Draws PDF/A-2 compliant check appearance.
|
protected void |
drawPdfACheckBox(PdfCanvas canvas,
float width,
float height,
boolean on) |
protected PdfFormXObject |
drawPushButtonAppearance(float width,
float height,
String text,
PdfFont font,
float fontSize)
Draws the appearance for a push button.
|
protected PdfFormXObject |
drawPushButtonAppearance(float width,
float height,
String text,
PdfFont font,
PdfName fontName,
float fontSize)
Deprecated.
|
protected void |
drawRadioAppearance(float width,
float height,
String value)
Draws the appearance of a radio button with a specified value.
|
protected void |
drawRadioBorder(PdfCanvas canvas,
PdfFormXObject xObject,
float width,
float height) |
protected void |
drawRadioField(PdfCanvas canvas,
float width,
float height,
boolean on)
Draws a radio button.
|
protected void |
drawTextAppearance(Rectangle rect,
PdfFont font,
float fontSize,
String value,
PdfFormXObject appearance)
Draws the visual appearance of text in a form field.
|
protected String |
generateDefaultAppearanceString(PdfFont font,
float fontSize,
Color color,
PdfResources res)
Deprecated.
use
updateDefaultAppearance() instead. |
PdfDictionary |
getAdditionalAction()
Gets the currently additional action dictionary for the form field.
|
PdfString |
getAlternativeName()
Gets the current alternate name.
|
String[] |
getAppearanceStates()
Gets the appearance state names.
|
float |
getBorderWidth()
Gets the border width for the field.
|
Color |
getColor()
Gets the current color of the form field.
|
PdfString |
getDefaultAppearance()
Gets default appearance string containing a sequence of valid page-content graphics or text state operators that
define such properties as the field's text size and color.
|
PdfString |
getDefaultStyle()
Gets a default style string, as described in "Rich Text Strings" section of Pdf spec.
|
PdfObject |
getDefaultValue()
Gets the default fallback value for the form field.
|
protected PdfDocument |
getDocument() |
boolean |
getFieldFlag(int flag)
Checks whether a certain flag, or any of a combination of flags, is set
for this form field.
|
int |
getFieldFlags()
Gets the current list of PDF form field flags.
|
PdfString |
getFieldName()
Gets the current field name.
|
PdfFont |
getFont()
Gets the current font of the form field.
|
protected Object[] |
getFontAndSize(PdfDictionary asNormal)
Deprecated.
use
getFont() and getFontSize() instead. |
float |
getFontSize()
Gets the current fontSize of the form field.
|
PdfName |
getFormType()
Returns the type of the parent form field, or of the wrapped
<PdfDictionary> object.
|
Integer |
getJustification()
Gets a code specifying the form of quadding (justification) to be used in displaying the text:
0 Left-justified
1 Centered
2 Right-justified
|
PdfArray |
getKids()
Gets the kids of this object.
|
PdfString |
getMappingName()
Gets the current mapping name.
|
PdfArray |
getOptions()
Gets options for the form field.
|
PdfDictionary |
getParent()
Gets the parent dictionary.
|
protected Rectangle |
getRect(PdfDictionary field) |
PdfObject |
getRichText()
Gets a rich text string, as described in "Rich Text Strings" section of Pdf spec.
|
PdfObject |
getValue()
Gets the current value contained in the form field.
|
String |
getValueAsString()
Gets the current value contained in the form field.
|
List<PdfWidgetAnnotation> |
getWidgets()
Gets all
PdfWidgetAnnotation that this form field and its
kids refer to. |
boolean |
isMultiline()
If true, the field can contain multiple lines of text; if false, the field's text is restricted to a single line.
|
boolean |
isNoExport()
Gets the NoExport attribute.
|
boolean |
isPassword()
If true, the field is intended for entering a secure password that should not be echoed visibly to the screen.
|
boolean |
isReadOnly()
Gets the ReadOnly flag, specifying whether or not the field can be changed.
|
boolean |
isRequired()
Gets the Required flag, specifying whether or not the field must be filled in.
|
protected boolean |
isWrappedObjectMustBeIndirect() |
static int |
makeFieldFlag(int bitPosition)
Makes a field flag by bit position.
|
static PdfFormField |
makeFormField(PdfObject pdfObject,
PdfDocument document)
Creates a (subtype of)
PdfFormField object. |
protected static PdfArray |
processOptions(String[] options) |
protected static PdfArray |
processOptions(String[][] options) |
PdfFormField |
put(PdfName key,
PdfObject value)
Inserts the value into the
PdfDictionary of this field and associates it with the specified key. |
boolean |
regenerateField()
This method regenerates appearance stream of the field.
|
void |
release()
Releases underlying pdf object and other pdf entities used by wrapper.
|
PdfFormField |
remove(PdfName key)
Removes the specified key from the
PdfDictionary of this field. |
PdfFormField |
setAction(PdfAction action)
Sets the action on all
widgets of this form field. |
PdfFormField |
setAdditionalAction(PdfName key,
PdfAction action)
Sets an additional action for the form field.
|
PdfFormField |
setAlternativeName(String name)
Changes the alternate name of the field to the specified value.
|
PdfFormField |
setAppearance(PdfName appearanceType,
String appearanceState,
PdfStream appearanceStream)
Sets an appearance for (the widgets related to) the form field.
|
PdfFormField |
setBackgroundColor(Color backgroundColor)
Basic setter for the
backgroundColor property. |
PdfFormField |
setBorderColor(Color color)
Sets the Border Color.
|
PdfFormField |
setBorderStyle(PdfDictionary style) |
PdfFormField |
setBorderWidth(float borderWidth)
Sets the border width for the field.
|
PdfFormField |
setCheckType(int checkType)
Changes the type of graphical marker used to mark a checkbox as 'on'.
|
PdfFormField |
setColor(Color color)
Sets the text color.
|
PdfFormField |
setDefaultAppearance(String defaultAppearance)
Deprecated.
use
updateDefaultAppearance() instead. |
PdfFormField |
setDefaultStyle(PdfString defaultStyleString)
Sets a default style string, as described in "Rich Text Strings" section of Pdf spec.
|
PdfFormField |
setDefaultValue(PdfObject value)
Sets the default fallback value for the form field.
|
PdfFormField |
setFieldFlag(int flag)
Adds a flag, or combination of flags, for the form field.
|
PdfFormField |
setFieldFlag(int flag,
boolean value)
Adds or removes a flag, or combination of flags, for the form field.
|
PdfFormField |
setFieldFlags(int flags)
Sets a flag, or combination of flags, for the form field.
|
PdfFormField |
setFieldName(String name)
Changes the name of the field to the specified value.
|
PdfFormField |
setFont(PdfFont font)
Basic setter for the
font property. |
PdfFormField |
setFontAndSize(PdfFont font,
float fontSize)
Combined setter for the
font and fontSize
properties. |
PdfFormField |
setFontAndSize(PdfFont font,
int fontSize)
Deprecated.
use
setFontAndSize(PdfFont, float) instead. |
PdfFormField |
setFontSize(float fontSize)
Basic setter for the
fontSize property. |
PdfFormField |
setFontSize(int fontSize)
Basic setter for the
fontSize property. |
PdfFormField |
setFontSizeAutoScale()
Sets zero font size which will be interpreted as auto-size according to ISO 32000-1, 12.7.3.3.
|
PdfFormField |
setJustification(int justification)
Sets a code specifying the form of quadding (justification) to be used in displaying the text:
0 Left-justified
1 Centered
2 Right-justified
|
PdfFormField |
setMappingName(String name)
Changes the mapping name of the field to the specified value.
|
PdfFormField |
setNoExport(boolean noExport)
Sets the NoExport flag, specifying whether or not exporting is forbidden.
|
PdfFormField |
setOptions(PdfArray options)
Sets options for the form field.
|
PdfFormField |
setPage(int pageNum)
Specifies on which page the form field's widget must be shown.
|
PdfFormField |
setParent(PdfFormField parent)
Sets a parent
PdfFormField for the current object. |
PdfFormField |
setReadOnly(boolean readOnly)
Sets the ReadOnly flag, specifying whether or not the field can be changed.
|
PdfFormField |
setRequired(boolean required)
Sets the Required flag, specifying whether or not the field must be filled in.
|
PdfFormField |
setRichText(PdfObject richText)
Sets a rich text string, as described in "Rich Text Strings" section of Pdf spec.
|
PdfFormField |
setRotation(int degRotation)
Basic setter for the
degRotation property. |
PdfFormField |
setValue(String value)
Sets a value to the field and generating field appearance if needed.
|
PdfFormField |
setValue(String value,
boolean generateAppearance)
Sets a value to the field and generates field appearance if needed.
|
PdfFormField |
setValue(String value,
PdfFont font,
float fontSize)
Set text field value with given font and size
|
PdfFormField |
setValue(String value,
String display)
Sets the field value and the display string.
|
PdfFormField |
setVisibility(int visibility)
Set the visibility flags of the form field annotation
Options are: HIDDEN, HIDDEN_BUT_PRINTABLE, VISIBLE, VISIBLE_BUT_DOES_NOT_PRINT
|
protected static Object[] |
splitDAelements(String da) |
void |
updateDefaultAppearance()
Updates DA for Variable text, Push button and choice form fields.
|
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidReleasepublic static final int FF_MULTILINE
public static final int FF_PASSWORD
@Deprecated public static final int DEFAULT_FONT_SIZE
@Deprecated public static final int MIN_FONT_SIZE
@Deprecated public static final int DA_FONT
@Deprecated public static final int DA_SIZE
@Deprecated public static final int DA_COLOR
public static final int ALIGN_LEFT
public static final int ALIGN_CENTER
public static final int ALIGN_RIGHT
public static final int TYPE_CHECK
public static final int TYPE_CIRCLE
public static final int TYPE_CROSS
public static final int TYPE_DIAMOND
public static final int TYPE_SQUARE
public static final int TYPE_STAR
public static final int HIDDEN
public static final int VISIBLE_BUT_DOES_NOT_PRINT
public static final int HIDDEN_BUT_PRINTABLE
public static final int VISIBLE
public static final int FF_READ_ONLY
public static final int FF_REQUIRED
public static final int FF_NO_EXPORT
@Deprecated public static final float X_OFFSET
protected static String[] typeChars
protected String text
protected com.itextpdf.io.image.ImageData img
protected PdfFont font
protected float fontSize
protected Color color
protected int checkType
protected float borderWidth
protected Color backgroundColor
protected Color borderColor
protected int rotation
protected PdfFormXObject form
protected PdfAConformanceLevel pdfAConformanceLevel
public PdfFormField(PdfDictionary pdfObject)
PdfDictionary.
This PdfDictionary must be an indirect object.pdfObject - the dictionary to be wrapped, must have an indirect reference.protected PdfFormField(PdfDocument pdfDocument)
PdfFormField.pdfDocument - The documentprotected PdfFormField(PdfWidgetAnnotation widget, PdfDocument pdfDocument)
PdfWidgetAnnotation.widget - The widget which will be a kid of the PdfFormFieldpdfDocument - The documentpublic static int makeFieldFlag(int bitPosition)
bitPosition - bit position of a flag in range 1 to 32 from the pdf specification.public static PdfFormField createEmptyField(PdfDocument doc)
doc - the PdfDocument to create the field inPdfFormFieldpublic static PdfFormField createEmptyField(PdfDocument doc, PdfAConformanceLevel pdfAConformanceLevel)
doc - the PdfDocument to create the field inpdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfFormFieldpublic static PdfButtonFormField createButton(PdfDocument doc, Rectangle rect, int flags)
button form field with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the button field inrect - the location on the page for the buttonflags - an int, containing a set of binary behavioral
flags. Do binary OR on this int to set the
flags you require.PdfButtonFormFieldpublic static PdfButtonFormField createButton(PdfDocument doc, Rectangle rect, int flags, PdfAConformanceLevel pdfAConformanceLevel)
button form field with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the button field inrect - the location on the page for the buttonflags - an int, containing a set of binary behavioral
flags. Do binary OR on this int to set the
flags you require.pdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfButtonFormFieldpublic static PdfButtonFormField createButton(PdfDocument doc, int flags)
button form field with custom
behavior and layout.doc - the PdfDocument to create the button field inflags - an int, containing a set of binary behavioral
flags. Do binary OR on this int to set the
flags you require.PdfButtonFormFieldpublic static PdfButtonFormField createButton(PdfDocument doc, int flags, PdfAConformanceLevel pdfAConformanceLevel)
button form field with custom
behavior and layout.doc - the PdfDocument to create the button field inflags - an int, containing a set of binary behavioral
flags. Do binary OR on this int to set the
flags you require.pdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfButtonFormFieldpublic static PdfTextFormField createText(PdfDocument doc)
text form field.doc - the PdfDocument to create the text field inPdfTextFormFieldpublic static PdfTextFormField createText(PdfDocument doc, PdfAConformanceLevel pdfAConformanceLevel)
text form field.doc - the PdfDocument to create the text field inpdfAConformanceLevel - the desired PdfAConformanceLevel of the field. Must match the conformance
level of the PdfDocument this field will eventually be added intoPdfTextFormFieldpublic static PdfTextFormField createText(PdfDocument doc, Rectangle rect)
text form field.doc - the PdfDocument to create the text field inrect - the location on the page for the text fieldPdfTextFormFieldpublic static PdfTextFormField createText(PdfDocument doc, Rectangle rect, String name)
text form field with an initial
value, and the form's default font specified in
PdfAcroForm.getDefaultResources().doc - the PdfDocument to create the text field inrect - the location on the page for the text fieldname - the name of the form fieldPdfTextFormFieldpublic static PdfTextFormField createText(PdfDocument doc, Rectangle rect, String name, String value)
text form field with an initial
value, and the form's default font specified in
PdfAcroForm.getDefaultResources().doc - the PdfDocument to create the text field inrect - the location on the page for the text fieldname - the name of the form fieldvalue - the initial valuePdfTextFormFieldpublic static PdfTextFormField createText(PdfDocument doc, Rectangle rect, String name, String value, PdfFont font, float fontSize)
text form field with an initial
value, with a specified font and font size.doc - the PdfDocument to create the text field inrect - the location on the page for the text fieldname - the name of the form fieldvalue - the initial valuefont - a PdfFontfontSize - the size of the fontPdfTextFormFieldpublic static PdfTextFormField createText(PdfDocument doc, Rectangle rect, String name, String value, PdfFont font, float fontSize, boolean multiline)
text form field with an initial
value, with a specified font and font size.doc - the PdfDocument to create the text field inrect - the location on the page for the text fieldname - the name of the form fieldvalue - the initial valuefont - a PdfFontfontSize - the size of the fontmultiline - true for multiline text fieldPdfTextFormFieldpublic static PdfTextFormField createText(PdfDocument doc, Rectangle rect, String name, String value, PdfFont font, float fontSize, boolean multiline, PdfAConformanceLevel pdfAConformanceLevel)
text form field with an initial
value, with a specified font and font size.doc - the PdfDocument to create the text field inrect - the location on the page for the text fieldname - the name of the form fieldvalue - the initial valuefont - a PdfFontfontSize - the size of the fontmultiline - true for multiline text fieldpdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfTextFormFieldpublic static PdfTextFormField createMultilineText(PdfDocument doc, Rectangle rect, String name, String value, PdfFont font, float fontSize)
multilined text form field with an initial
value, with a specified font and font size.doc - the PdfDocument to create the text field inrect - the location on the page for the text fieldname - the name of the form fieldvalue - the initial valuefont - a PdfFontfontSize - the size of the fontPdfTextFormFieldpublic static PdfTextFormField createMultilineText(PdfDocument doc, Rectangle rect, String name, String value)
multiline text form field with an initial
value, and the form's default font specified in
PdfAcroForm.getDefaultResources().doc - the PdfDocument to create the text field inrect - the location on the page for the text fieldname - the name of the form fieldvalue - the initial valuePdfTextFormFieldpublic static PdfChoiceFormField createChoice(PdfDocument doc, int flags)
choice form field.doc - the PdfDocument to create the choice field inflags - an int, containing a set of binary behavioral
flags. Do binary OR on this int to set the
flags you require.PdfChoiceFormFieldpublic static PdfChoiceFormField createChoice(PdfDocument doc, int flags, PdfAConformanceLevel pdfAConformanceLevel)
choice form field.doc - the PdfDocument to create the choice field inflags - an int, containing a set of binary behavioral
flags. Do binary OR on this int to set the
flags you require.pdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfChoiceFormFieldpublic static PdfChoiceFormField createChoice(PdfDocument doc, Rectangle rect, int flags)
choice form field with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the choice field inrect - the location on the page for the choice fieldflags - an int, containing a set of binary behavioral
flags. Do binary OR on this int to set the
flags you require.PdfChoiceFormFieldpublic static PdfChoiceFormField createChoice(PdfDocument doc, Rectangle rect, String name, String value, PdfArray options, int flags)
choice form field with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the choice field inrect - the location on the page for the choice fieldname - the name of the form fieldvalue - the initial valueoptions - an array of PdfString objects that each represent
the 'on' state of one of the choices.flags - an int, containing a set of binary behavioral
flags. Do binary OR on this int to set the
flags you require.PdfChoiceFormFieldpublic static PdfChoiceFormField createChoice(PdfDocument doc, Rectangle rect, String name, String value, PdfArray options, int flags, PdfFont font, PdfAConformanceLevel pdfAConformanceLevel)
choice form field with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the choice field inrect - the location on the page for the choice fieldname - the name of the form fieldvalue - the initial valueoptions - an array of PdfString objects that each represent
the 'on' state of one of the choices.flags - an int, containing a set of binary behavioral
flags. Do binary OR on this int to set the
flags you require.font - the desired font to be used when displaying the textpdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfChoiceFormFieldpublic static PdfChoiceFormField createChoice(PdfDocument doc, Rectangle rect, String name, String value, PdfFont font, float fontSize, PdfArray options, int flags)
choice form field with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the choice field inrect - the location on the page for the choice fieldname - the name of the form fieldvalue - the initial valuefont - a PdfFontfontSize - the size of the fontoptions - an array of PdfString objects that each represent
the 'on' state of one of the choices.flags - an int, containing a set of binary behavioral
flags. Do binary OR on this int to set the
flags you require.PdfChoiceFormFieldpublic static PdfChoiceFormField createChoice(PdfDocument doc, Rectangle rect, String name, String value, PdfFont font, float fontSize, PdfArray options, int flags, PdfAConformanceLevel pdfAConformanceLevel)
choice form field with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the choice field inrect - the location on the page for the choice fieldname - the name of the form fieldvalue - the initial valuefont - a PdfFontfontSize - the size of the fontoptions - an array of PdfString objects that each represent
the 'on' state of one of the choices.flags - an int, containing a set of binary behavioral
flags. Do binary OR on this int to set the
flags you require.pdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfChoiceFormFieldpublic static PdfSignatureFormField createSignature(PdfDocument doc)
signature form field.doc - the PdfDocument to create the signature field inPdfSignatureFormFieldpublic static PdfSignatureFormField createSignature(PdfDocument doc, PdfAConformanceLevel pdfAConformanceLevel)
signature form field.doc - the PdfDocument to create the signature field inpdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfSignatureFormFieldpublic static PdfSignatureFormField createSignature(PdfDocument doc, Rectangle rect)
signature form field.doc - the PdfDocument to create the signature field inrect - the location on the page for the signature fieldPdfSignatureFormFieldpublic static PdfSignatureFormField createSignature(PdfDocument doc, Rectangle rect, PdfAConformanceLevel pdfAConformanceLevel)
signature form field.doc - the PdfDocument to create the signature field inrect - the location on the page for the signature fieldpdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfSignatureFormFieldpublic static PdfButtonFormField createRadioGroup(PdfDocument doc, String name, String value)
radio group form field.doc - the PdfDocument to create the radio group inname - the name of the form fieldvalue - the initial valueradio grouppublic static PdfButtonFormField createRadioGroup(PdfDocument doc, String name, String value, PdfAConformanceLevel pdfAConformanceLevel)
radio group form field.doc - the PdfDocument to create the radio group inname - the name of the form fieldvalue - the initial valuepdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentradio grouppublic static PdfFormField createRadioButton(PdfDocument doc, Rectangle rect, PdfButtonFormField radioGroup, String value)
PdfFormField that is added to a radio group.doc - the PdfDocument to create the radio group inrect - the location on the page for the fieldradioGroup - the radio button group that this field should belong tovalue - the initial valuePdfFormFieldcreateRadioGroup(PdfDocument, java.lang.String, java.lang.String)public static PdfFormField createRadioButton(PdfDocument doc, Rectangle rect, PdfButtonFormField radioGroup, String value, PdfAConformanceLevel pdfAConformanceLevel)
PdfFormField that is added to a radio group.doc - the PdfDocument to create the radio group inrect - the location on the page for the fieldradioGroup - the radio button group that this field should belong tovalue - the initial valuepdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfFormFieldcreateRadioGroup(PdfDocument, java.lang.String, java.lang.String)public static PdfButtonFormField createPushButton(PdfDocument doc, Rectangle rect, String name, String caption)
PdfButtonFormField as a push button without data.doc - the PdfDocument to create the radio group inrect - the location on the page for the fieldname - the name of the form fieldcaption - the text to display on the buttonPdfButtonFormFieldpublic static PdfButtonFormField createPushButton(PdfDocument doc, Rectangle rect, String name, String caption, PdfFont font, float fontSize)
PdfButtonFormField as a push button without data, with
its caption in a custom font.doc - the PdfDocument to create the radio group inrect - the location on the page for the fieldname - the name of the form fieldcaption - the text to display on the buttonfont - a PdfFontfontSize - the size of the fontPdfButtonFormFieldpublic static PdfButtonFormField createPushButton(PdfDocument doc, Rectangle rect, String name, String caption, PdfFont font, float fontSize, PdfAConformanceLevel pdfAConformanceLevel)
PdfButtonFormField as a push button without data, with
its caption in a custom font.doc - the PdfDocument to create the radio group inrect - the location on the page for the fieldname - the name of the form fieldcaption - the text to display on the buttonfont - a PdfFontfontSize - the size of the fontpdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfButtonFormFieldpublic static PdfButtonFormField createCheckBox(PdfDocument doc, Rectangle rect, String name, String value)
PdfButtonFormField as a checkbox.doc - the PdfDocument to create the radio group inrect - the location on the page for the fieldname - the name of the form fieldvalue - the initial valuecheckboxpublic static PdfButtonFormField createCheckBox(PdfDocument doc, Rectangle rect, String name, String value, int checkType)
PdfButtonFormField as a checkbox.doc - the PdfDocument to create the radio group inrect - the location on the page for the fieldname - the name of the form fieldvalue - the initial valuecheckType - the type of checkbox graphic to use.checkboxpublic static PdfButtonFormField createCheckBox(PdfDocument doc, Rectangle rect, String name, String value, int checkType, PdfAConformanceLevel pdfAConformanceLevel)
PdfButtonFormField as a checkbox. Check symbol will fit rectangle.
You may set font and font size after creation.doc - the PdfDocument to create the radio group inrect - the location on the page for the fieldname - the name of the form fieldvalue - the initial valuecheckType - the type of checkbox graphic to use.pdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentcheckboxpublic static PdfChoiceFormField createComboBox(PdfDocument doc, Rectangle rect, String name, String value, String[][] options)
combobox with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the combobox inrect - the location on the page for the comboboxname - the name of the form fieldvalue - the initial valueoptions - a two-dimensional array of Strings which will be converted
to a PdfArray.PdfChoiceFormField as a comboboxpublic static PdfChoiceFormField createComboBox(PdfDocument doc, Rectangle rect, String name, String value, String[][] options, PdfFont font, PdfAConformanceLevel pdfAConformanceLevel)
combobox with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the combobox inrect - the location on the page for the comboboxname - the name of the form fieldvalue - the initial valueoptions - a two-dimensional array of Strings which will be converted
to a PdfArray.font - the desired font to be used when displaying the textpdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfChoiceFormField as a comboboxpublic static PdfChoiceFormField createComboBox(PdfDocument doc, Rectangle rect, String name, String value, String[] options)
combobox with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the combobox inrect - the location on the page for the comboboxname - the name of the form fieldvalue - the initial valueoptions - an array of Strings which will be converted to a PdfArray.PdfChoiceFormField as a comboboxpublic static PdfChoiceFormField createComboBox(PdfDocument doc, Rectangle rect, String name, String value, String[] options, PdfFont font, PdfAConformanceLevel pdfAConformanceLevel)
combobox with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the combobox inrect - the location on the page for the comboboxname - the name of the form fieldvalue - the initial valueoptions - an array of Strings which will be converted to a PdfArray.font - the desired font to be used when displaying the textpdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfChoiceFormField as a comboboxpublic static PdfChoiceFormField createList(PdfDocument doc, Rectangle rect, String name, String value, String[][] options)
list field with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the choice field inrect - the location on the page for the choice fieldname - the name of the form fieldvalue - the initial valueoptions - a two-dimensional array of Strings which will be converted
to a PdfArray.PdfChoiceFormField as a list fieldpublic static PdfChoiceFormField createList(PdfDocument doc, Rectangle rect, String name, String value, String[][] options, PdfFont font, PdfAConformanceLevel pdfAConformanceLevel)
list field with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the choice field inrect - the location on the page for the choice fieldname - the name of the form fieldvalue - the initial valueoptions - a two-dimensional array of Strings which will be converted
to a PdfArray.font - the desired font to be used when displaying the textpdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfChoiceFormField as a list fieldpublic static PdfChoiceFormField createList(PdfDocument doc, Rectangle rect, String name, String value, String[] options)
list field with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the list field inrect - the location on the page for the list fieldname - the name of the form fieldvalue - the initial valueoptions - an array of Strings which will be converted to a PdfArray.PdfChoiceFormField as a list fieldpublic static PdfChoiceFormField createList(PdfDocument doc, Rectangle rect, String name, String value, String[] options, PdfFont font, PdfAConformanceLevel pdfAConformanceLevel)
list field with custom
behavior and layout, on a specified location.doc - the PdfDocument to create the list field inrect - the location on the page for the list fieldname - the name of the form fieldvalue - the initial valueoptions - an array of Strings which will be converted to a PdfArray.font - the desired font to be used when displaying the textpdfAConformanceLevel - the PdfAConformanceLevel of the document. null if it's no PDF/A documentPdfChoiceFormField as a list fieldpublic static PdfFormField makeFormField(PdfObject pdfObject, PdfDocument document)
PdfFormField object. The type of the object
depends on the FT entry in the pdfObject parameter.pdfObject - assumed to be either a PdfDictionary, or a
PdfIndirectReference to a PdfDictionarydocument - the PdfDocument to create the field inPdfFormField, or null if
pdfObject does not contain a FT entrypublic PdfName getFormType()
PdfNamepublic PdfFormField setValue(String value)
value - of the fieldpublic PdfFormField setValue(String value, boolean generateAppearance)
value - of the fieldgenerateAppearance - if false, appearance won't be regeneratedpublic PdfFormField setValue(String value, PdfFont font, float fontSize)
value - text valuefont - a PdfFontfontSize - the size of the fontpublic PdfFormField setValue(String value, String display)
value - the field valuedisplay - the string that is used for the appearance. If null
the value parameter will be usedpublic PdfFormField setParent(PdfFormField parent)
PdfFormField for the current object.parent - another form field that this field belongs to, usually a group fieldpublic PdfDictionary getParent()
public PdfArray getKids()
Kids property, as a PdfArraypublic PdfFormField addKid(PdfFormField kid)
Kids array property from a
PdfFormField. Also sets the kid's Parent property to this object.kid - a new PdfFormField entry for the field's Kids array propertypublic PdfFormField addKid(PdfWidgetAnnotation kid)
Kids array property from a
PdfWidgetAnnotation. Also sets the kid's Parent property to this object.kid - a new PdfWidgetAnnotation entry for the field's Kids array propertypublic PdfFormField setFieldName(String name)
name - the new field name, as a Stringpublic PdfString getFieldName()
PdfStringpublic PdfFormField setAlternativeName(String name)
name - the new alternate name, as a Stringpublic PdfString getAlternativeName()
PdfStringpublic PdfFormField setMappingName(String name)
name - the new alternate name, as a Stringpublic PdfString getMappingName()
PdfStringpublic boolean getFieldFlag(int flag)
flag - an int interpreted as a series of a binary flagspublic PdfFormField setFieldFlag(int flag)
setFieldFlags(int).flag - an int interpreted as a series of a binary flagspublic PdfFormField setFieldFlag(int flag, boolean value)
setFieldFlags(int).flag - an int interpreted as a series of a binary flagsvalue - if true, adds the flag(s). if false,
removes the flag(s).public boolean isMultiline()
public boolean isPassword()
public PdfFormField setFieldFlags(int flags)
setFieldFlag(int)
which adds a flag to the existing flags.flags - an int interpreted as a series of a binary flagspublic int getFieldFlags()
intpublic PdfObject getValue()
PdfObjectpublic String getValueAsString()
Stringpublic PdfFormField setDefaultValue(PdfObject value)
value - the default valuepublic PdfObject getDefaultValue()
public PdfFormField setAdditionalAction(PdfName key, PdfAction action)
key - the dictionary key to use for storing the actionaction - the actionpublic PdfDictionary getAdditionalAction()
public PdfFormField setOptions(PdfArray options)
options - an array of PdfString objects that each represent
the 'on' state of one of the choices.public PdfArray getOptions()
public List<PdfWidgetAnnotation> getWidgets()
PdfWidgetAnnotation that this form field and its
kids refer to.PdfWidgetAnnotationpublic PdfString getDefaultAppearance()
PdfString@Deprecated public PdfFormField setDefaultAppearance(String defaultAppearance)
updateDefaultAppearance() instead.defaultAppearance - a valid sequence of PDF content stream syntaxpublic void updateDefaultAppearance()
public Integer getJustification()
public PdfFormField setJustification(int justification)
justification - the value to set the justification attribute topublic PdfString getDefaultStyle()
PdfStringpublic PdfFormField setDefaultStyle(PdfString defaultStyleString)
defaultStyleString - a new default style for the form fieldpublic PdfObject getRichText()
PdfStream or PdfString.public PdfFormField setRichText(PdfObject richText)
PdfStream or PdfString.richText - a new rich text valuepublic float getFontSize()
public Color getColor()
colorpublic PdfFormField setFont(PdfFont font)
font property. Regenerates the field
appearance after setting the new value.
Note that the font will be added to the document so ensure that the font is embedded
if it's a pdf/a document.font - The new font to be setpublic PdfFormField setFontSize(float fontSize)
fontSize property. Regenerates the
field appearance after setting the new value.fontSize - The new font size to be setpublic PdfFormField setFontSize(int fontSize)
fontSize property. Regenerates the
field appearance after setting the new value.fontSize - The new font size to be set@Deprecated public PdfFormField setFontAndSize(PdfFont font, int fontSize)
setFontAndSize(PdfFont, float) instead.font and fontSize
properties. Regenerates the field appearance after setting the new value.font - The new font to be setfontSize - The new font size to be setpublic PdfFormField setFontAndSize(PdfFont font, float fontSize)
font and fontSize
properties. Regenerates the field appearance after setting the new value.font - The new font to be setfontSize - The new font size to be setpublic PdfFormField setBackgroundColor(Color backgroundColor)
backgroundColor property. Regenerates
the field appearance after setting the new value.backgroundColor - The new color to be set or null if no background neededpublic PdfFormField setRotation(int degRotation)
degRotation property. Regenerates
the field appearance after setting the new value.degRotation - The new degRotation to be setpublic PdfFormField setAction(PdfAction action)
widgets of this form field.action - The actionpublic PdfFormField setCheckType(int checkType)
regenerateField methodcheckType - the new checkbox markerpublic PdfFormField setVisibility(int visibility)
visibility - visibility optionpublic boolean regenerateField()
public float getBorderWidth()
public PdfFormField setBorderWidth(float borderWidth)
borderWidth - The new border width.public PdfFormField setBorderStyle(PdfDictionary style)
public PdfFormField setBorderColor(Color color)
color - the new value for the Border Colorpublic PdfFormField setColor(Color color)
color - the new value for the Colorpublic PdfFormField setReadOnly(boolean readOnly)
readOnly - if true, then the field cannot be changed.public boolean isReadOnly()
true if the field cannot be changed.public PdfFormField setRequired(boolean required)
required - if true, then the field must be filled in.public boolean isRequired()
true if the field must be filled in.public PdfFormField setNoExport(boolean noExport)
noExport - if true, then exporting is forbiddenpublic boolean isNoExport()
public PdfFormField setPage(int pageNum)
pageNum - the page numberpublic String[] getAppearanceStates()
public PdfFormField setAppearance(PdfName appearanceType, String appearanceState, PdfStream appearanceStream)
appearanceType - the type of appearance stream to be added
appearanceState - the state of the form field that needs to be true
for the appearance to be used. Differentiates between several streams
of the same type.appearanceStream - the appearance instructions, as a PdfStreampublic PdfFormField setFontSizeAutoScale()
public PdfFormField put(PdfName key, PdfObject value)
PdfDictionary of this field and associates it with the specified key.
If the key is already present in this field dictionary,
this method will override the old value with the specified one.key - key to insert or to overridevalue - the value to associate with the specified keyPdfFormField instancepublic PdfFormField remove(PdfName key)
PdfDictionary of this field.key - key to be removedPdfFormField instancepublic void release()
PdfObject.release() if the wrapper is used.protected boolean isWrappedObjectMustBeIndirect()
isWrappedObjectMustBeIndirect in class PdfObjectWrapper<PdfDictionary>protected PdfDocument getDocument()
protected Rectangle getRect(PdfDictionary field)
@Deprecated protected String generateDefaultAppearanceString(PdfFont font, float fontSize, Color color, PdfResources res)
updateDefaultAppearance() instead.@Deprecated protected Object[] getFontAndSize(PdfDictionary asNormal) throws IOException
getFont() and getFontSize() instead.asNormal - normal appearance, will be ignored.IOException - never happens.protected void drawTextAppearance(Rectangle rect, PdfFont font, float fontSize, String value, PdfFormXObject appearance)
rect - The location on the page for the list fieldfont - a PdfFontfontSize - The size of the fontvalue - The initial valueappearance - The appearance@Deprecated protected void drawMultiLineTextAppearance(Rectangle rect, PdfFont font, float fontSize, String value, PdfFormXObject appearance)
drawMultiLineTextAppearance(Rectangle, PdfFont, String, PdfFormXObject) instead.rect - The location on the page for the list fieldfont - a PdfFontfontSize - The size of the font, will be ignoredvalue - The initial valueappearance - The appearanceprotected void drawMultiLineTextAppearance(Rectangle rect, PdfFont font, String value, PdfFormXObject appearance)
protected void drawBorder(PdfCanvas canvas, PdfFormXObject xObject, float width, float height)
canvas - The PdfCanvas on which to drawxObject - The PdfFormXObjectwidth - The width of the rectangle to drawheight - The height of the rectangle to drawprotected void drawRadioBorder(PdfCanvas canvas, PdfFormXObject xObject, float width, float height)
protected void drawRadioAppearance(float width,
float height,
String value)
width - the width of the radio button to drawheight - the height of the radio button to drawvalue - the value of the button@Deprecated protected void drawPdfA1RadioAppearance(float width, float height, String value)
drawRadioAppearance(float, float, String) instead.width - the width of the radio button to drawheight - the height of the radio button to drawvalue - the value of the buttonprotected void drawRadioField(PdfCanvas canvas, float width, float height, boolean on)
canvas - the PdfCanvas on which to drawwidth - the width of the radio button to drawheight - the height of the radio button to drawon - required to be true for fulfilling the drawing operationprotected void drawCheckAppearance(float width,
float height,
String onStateName)
width - the width of the checkbox to drawheight - the height of the checkbox to drawonStateName - the state of the form field that will be drawnprotected void drawPdfA2CheckAppearance(float width,
float height,
String onStateName,
int checkType)
width - width of the checkboxheight - height of the checkboxonStateName - name that corresponds to the "On" state of the checkboxcheckType - the type that determines how the checkbox will look like. Allowed values are TYPE_CHECK,
TYPE_CIRCLE, TYPE_CROSS, TYPE_DIAMOND,
TYPE_SQUARE, TYPE_STAR@Deprecated protected void drawPdfA1CheckAppearance(float width, float height, String selectedValue, int checkType)
drawPdfA2CheckAppearance(float, float, String, int) instead.protected PdfFormXObject drawPushButtonAppearance(float width, float height, String text, PdfFont font, float fontSize)
width - the width of the pushbuttonheight - the width of the pushbuttontext - the text to display on the buttonfont - a PdfFontfontSize - the size of the fontPdfFormXObject@Deprecated protected PdfFormXObject drawPushButtonAppearance(float width, float height, String text, PdfFont font, PdfName fontName, float fontSize)
drawPushButtonAppearance(float, float, String, PdfFont, float) instead.width - the width of the pushbuttonheight - the width of the pushbuttontext - the text to display on the buttonfont - a PdfFontfontName - will be ignored.fontSize - the size of the fontPdfFormXObjectprotected void drawButton(PdfCanvas canvas, float x, float y, float width, float height, String text, PdfFont font, float fontSize)
canvas - the PdfCanvas of the page to draw on.x - will be ignored, according to spec it shall be 0y - will be ignored, according to spec it shall be 0width - the width of the buttonheight - the width of the buttontext - the text to display on the buttonfont - a PdfFontfontSize - the size of the fontprotected void drawCheckBox(PdfCanvas canvas, float width, float height, float fontSize, boolean on)
canvas - the PdfCanvas of the page to draw on.width - the width of the buttonheight - the width of the buttonfontSize - the size of the fonton - the boolean value of the checkboxprotected void drawPdfACheckBox(PdfCanvas canvas, float width, float height, boolean on)
Copyright © 1998–2021 iText Group NV. All rights reserved.