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 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 |
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()
Defines if the object behind this wrapper must be an indirect object in the resultant document.
|
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, unsetForbidRelease
public 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 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 document
protected PdfFormField(PdfWidgetAnnotation widget, PdfDocument pdfDocument)
PdfWidgetAnnotation
.
widget
- The widget which will be a kid of the PdfFormField
pdfDocument
- The document
public 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 in
PdfFormField
public static PdfFormField createEmptyField(PdfDocument doc, PdfAConformanceLevel pdfAConformanceLevel)
doc
- the PdfDocument
to create the field in
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
PdfFormField
public 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 in
rect
- the location on the page for the button
flags
- an int
, containing a set of binary behavioral flags. Do binary OR
on this int
to set the flags you require.
PdfButtonFormField
public 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 in
rect
- the location on the page for the button
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 document
PdfButtonFormField
public static PdfButtonFormField createButton(PdfDocument doc, int flags)
button form field
with custom behavior and layout.
doc
- the PdfDocument
to create the button field in
flags
- an int
, containing a set of binary behavioral flags. Do binary OR
on this int
to set the flags you require.
PdfButtonFormField
public 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 in
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 document
PdfButtonFormField
public static PdfTextFormField createText(PdfDocument doc)
text form field
.
doc
- the PdfDocument
to create the text field in
PdfTextFormField
public static PdfTextFormField createText(PdfDocument doc, PdfAConformanceLevel pdfAConformanceLevel)
text form field
.
doc
- the PdfDocument
to create the text field in
pdfAConformanceLevel
- the desired PdfAConformanceLevel
of the field. Must match the conformance level of the PdfDocument
this field will eventually be added into
PdfTextFormField
public static PdfTextFormField createText(PdfDocument doc, Rectangle rect)
text form field
.
doc
- the PdfDocument
to create the text field in
rect
- the location on the page for the text field
PdfTextFormField
public 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 in
rect
- the location on the page for the text field
name
- the name of the form field
PdfTextFormField
public 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 in
rect
- the location on the page for the text field
name
- the name of the form field
value
- the initial value
PdfTextFormField
public 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 in
rect
- the location on the page for the text field
name
- the name of the form field
value
- the initial value
font
- a PdfFont
fontSize
- the size of the font
PdfTextFormField
public 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 in
rect
- the location on the page for the text field
name
- the name of the form field
value
- the initial value
font
- a PdfFont
fontSize
- the size of the font
multiline
- true for multiline text field
PdfTextFormField
public 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 in
rect
- the location on the page for the text field
name
- the name of the form field
value
- the initial value
font
- a PdfFont
fontSize
- the size of the font
multiline
- true for multiline text field
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
PdfTextFormField
public 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 in
rect
- the location on the page for the text field
name
- the name of the form field
value
- the initial value
font
- a PdfFont
fontSize
- the size of the font
PdfTextFormField
public 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 in
rect
- the location on the page for the text field
name
- the name of the form field
value
- the initial value
PdfTextFormField
public static PdfChoiceFormField createChoice(PdfDocument doc, int flags)
choice form field
.
doc
- the PdfDocument
to create the choice field in
flags
- an int
, containing a set of binary behavioral flags. Do binary OR
on this int
to set the flags you require.
PdfChoiceFormField
public static PdfChoiceFormField createChoice(PdfDocument doc, int flags, PdfAConformanceLevel pdfAConformanceLevel)
choice form field
.
doc
- the PdfDocument
to create the choice field in
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 document
PdfChoiceFormField
public 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 in
rect
- the location on the page for the choice field
flags
- an int
, containing a set of binary behavioral flags. Do binary OR
on this int
to set the flags you require.
PdfChoiceFormField
public 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 in
rect
- the location on the page for the choice field
name
- the name of the form field
value
- the initial value
options
- 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.
PdfChoiceFormField
public 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 in
rect
- the location on the page for the choice field
name
- the name of the form field
value
- the initial value
options
- 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 text
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
PdfChoiceFormField
public 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 in
rect
- the location on the page for the choice field
name
- the name of the form field
value
- the initial value
font
- a PdfFont
fontSize
- the size of the font
options
- 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.
PdfChoiceFormField
public 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 in
rect
- the location on the page for the choice field
name
- the name of the form field
value
- the initial value
font
- a PdfFont
fontSize
- the size of the font
options
- 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 document
PdfChoiceFormField
public static PdfSignatureFormField createSignature(PdfDocument doc)
signature form field
.
doc
- the PdfDocument
to create the signature field in
PdfSignatureFormField
public static PdfSignatureFormField createSignature(PdfDocument doc, PdfAConformanceLevel pdfAConformanceLevel)
signature form field
.
doc
- the PdfDocument
to create the signature field in
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
PdfSignatureFormField
public static PdfSignatureFormField createSignature(PdfDocument doc, Rectangle rect)
signature form field
.
doc
- the PdfDocument
to create the signature field in
rect
- the location on the page for the signature field
PdfSignatureFormField
public static PdfSignatureFormField createSignature(PdfDocument doc, Rectangle rect, PdfAConformanceLevel pdfAConformanceLevel)
signature form field
.
doc
- the PdfDocument
to create the signature field in
rect
- the location on the page for the signature field
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
PdfSignatureFormField
public static PdfButtonFormField createRadioGroup(PdfDocument doc, String name, String value)
radio group form field
.
doc
- the PdfDocument
to create the radio group in
name
- the name of the form field
value
- the initial value
radio group
public static PdfButtonFormField createRadioGroup(PdfDocument doc, String name, String value, PdfAConformanceLevel pdfAConformanceLevel)
radio group form field
.
doc
- the PdfDocument
to create the radio group in
name
- the name of the form field
value
- the initial value
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
radio group
public 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 in
rect
- the location on the page for the field
radioGroup
- the radio button group that this field should belong to
value
- the initial value
PdfFormField
createRadioGroup(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 in
rect
- the location on the page for the field
radioGroup
- the radio button group that this field should belong to
value
- the initial value
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
PdfFormField
createRadioGroup(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 in
rect
- the location on the page for the field
name
- the name of the form field
caption
- the text to display on the button
PdfButtonFormField
public 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 in
rect
- the location on the page for the field
name
- the name of the form field
caption
- the text to display on the button
font
- a PdfFont
fontSize
- the size of the font
PdfButtonFormField
public 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 in
rect
- the location on the page for the field
name
- the name of the form field
caption
- the text to display on the button
font
- a PdfFont
fontSize
- the size of the font
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
PdfButtonFormField
public static PdfButtonFormField createCheckBox(PdfDocument doc, Rectangle rect, String name, String value)
PdfButtonFormField
as a checkbox.
doc
- the PdfDocument
to create the radio group in
rect
- the location on the page for the field
name
- the name of the form field
value
- the initial value
checkbox
public 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 in
rect
- the location on the page for the field
name
- the name of the form field
value
- the initial value
checkType
- the type of checkbox graphic to use.
checkbox
public 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 in
rect
- the location on the page for the field
name
- the name of the form field
value
- the initial value
checkType
- the type of checkbox graphic to use.
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
checkbox
public 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 in
rect
- the location on the page for the combobox
name
- the name of the form field
value
- the initial value
options
- a two-dimensional array of Strings which will be converted to a PdfArray.
PdfChoiceFormField
as a combobox
public 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 in
rect
- the location on the page for the combobox
name
- the name of the form field
value
- the initial value
options
- a two-dimensional array of Strings which will be converted to a PdfArray.
font
- the desired font to be used when displaying the text
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
PdfChoiceFormField
as a combobox
public 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 in
rect
- the location on the page for the combobox
name
- the name of the form field
value
- the initial value
options
- an array of Strings which will be converted to a PdfArray.
PdfChoiceFormField
as a combobox
public 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 in
rect
- the location on the page for the combobox
name
- the name of the form field
value
- the initial value
options
- an array of Strings which will be converted to a PdfArray.
font
- the desired font to be used when displaying the text
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
PdfChoiceFormField
as a combobox
public 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 in
rect
- the location on the page for the choice field
name
- the name of the form field
value
- the initial value
options
- a two-dimensional array of Strings which will be converted to a PdfArray.
PdfChoiceFormField
as a list field
public 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 in
rect
- the location on the page for the choice field
name
- the name of the form field
value
- the initial value
options
- a two-dimensional array of Strings which will be converted to a PdfArray.
font
- the desired font to be used when displaying the text
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
PdfChoiceFormField
as a list field
public 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 in
rect
- the location on the page for the list field
name
- the name of the form field
value
- the initial value
options
- an array of Strings which will be converted to a PdfArray.
PdfChoiceFormField
as a list field
public 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 in
rect
- the location on the page for the list field
name
- the name of the form field
value
- the initial value
options
- an array of Strings which will be converted to a PdfArray.
font
- the desired font to be used when displaying the text
pdfAConformanceLevel
- the PdfAConformanceLevel
of the document. null if it's no PDF/A document
PdfChoiceFormField
as a list field
public 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 PdfDictionary
document
- the PdfDocument
to create the field in
PdfFormField
, or null
if pdfObject
does not contain a FT
entry
public PdfName getFormType()
PdfName
public PdfFormField setValue(String value)
value
- of the field
public PdfFormField setValue(String value, boolean generateAppearance)
value
- of the field
generateAppearance
- if false, appearance won't be regenerated
public PdfFormField setValue(String value, PdfFont font, float fontSize)
value
- text value
font
- a PdfFont
fontSize
- the size of the font
public PdfFormField setValue(String value, String display)
value
- the field value
display
- the string that is used for the appearance. If null
the value
parameter will be used
public PdfFormField setParent(PdfFormField parent)
PdfFormField
for the current object.
parent
- another form field that this field belongs to, usually a group field
public PdfDictionary getParent()
public PdfArray getKids()
Kids
property, as a PdfArray
public 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 property
public 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 property
public PdfFormField setFieldName(String name)
name
- the new field name, as a String
public PdfString getFieldName()
PdfString
public PdfFormField setAlternativeName(String name)
name
- the new alternate name, as a String
public PdfString getAlternativeName()
PdfString
public PdfFormField setMappingName(String name)
name
- the new alternate name, as a String
public PdfString getMappingName()
PdfString
public boolean getFieldFlag(int flag)
flag
- an int
interpreted as a series of a binary flags
public PdfFormField setFieldFlag(int flag)
setFieldFlags(int)
.
flag
- an int
interpreted as a series of a binary flags
public PdfFormField setFieldFlag(int flag, boolean value)
setFieldFlags(int)
.
flag
- an int
interpreted as a series of a binary flags
value
- 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 flags
public int getFieldFlags()
int
public PdfObject getValue()
PdfObject
public String getValueAsString()
String
public PdfFormField setDefaultValue(PdfObject value)
value
- the default value
public PdfObject getDefaultValue()
public PdfFormField setAdditionalAction(PdfName key, PdfAction action)
key
- the dictionary key to use for storing the action
action
- the action
public 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.
PdfWidgetAnnotation
public PdfString getDefaultAppearance()
PdfString
@Deprecated public PdfFormField setDefaultAppearance(String defaultAppearance)
updateDefaultAppearance()
instead.
defaultAppearance
- a valid sequence of PDF content stream syntax
public void updateDefaultAppearance()
public Integer getJustification()
public PdfFormField setJustification(int justification)
justification
- the value to set the justification attribute to
public PdfString getDefaultStyle()
PdfString
public PdfFormField setDefaultStyle(PdfString defaultStyleString)
defaultStyleString
- a new default style for the form field
public PdfObject getRichText()
PdfStream
or PdfString
.
public PdfFormField setRichText(PdfObject richText)
PdfStream
or PdfString
.
richText
- a new rich text value
public float getFontSize()
public Color getColor()
color
public 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 set
public PdfFormField setFontSize(float fontSize)
fontSize
property. Regenerates the field appearance after setting the new value.
fontSize
- The new font size to be set
public 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 set
fontSize
- The new font size to be set
public 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 set
fontSize
- The new font size to be set
public 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 needed
public PdfFormField setRotation(int degRotation)
degRotation
property. Regenerates the field appearance after setting the new value.
degRotation
- The new degRotation to be set
public PdfFormField setAction(PdfAction action)
widgets
of this form field.
action
- The action
public PdfFormField setCheckType(int checkType)
regenerateField
method
checkType
- the new checkbox marker
public PdfFormField setVisibility(int visibility)
visibility
- visibility option
public 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 Color
public PdfFormField setColor(Color color)
color
- the new value for the Color
public 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 forbidden
public boolean isNoExport()
public PdfFormField setPage(int pageNum)
pageNum
- the page number
public 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 PdfStream
public 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 override
value
- the value to associate with the specified key
PdfFormField
instance
public PdfFormField remove(PdfName key)
PdfDictionary
of this field.
key
- key to be removed
PdfFormField
instance
public void release()
PdfObject.release()
if the wrapper is used.
protected boolean isWrappedObjectMustBeIndirect()
PdfObjectWrapper
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 field
font
- a PdfFont
fontSize
- The size of the font
value
- The initial value
appearance
- 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 field
font
- a PdfFont
fontSize
- The size of the font, will be ignored
value
- The initial value
appearance
- The appearance
protected 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 draw
xObject
- The PdfFormXObject
width
- The width of the rectangle to draw
height
- The height of the rectangle to draw
protected 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 draw
height
- the height of the radio button to draw
value
- 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 draw
height
- the height of the radio button to draw
value
- the value of the button
protected void drawRadioField(PdfCanvas canvas, float width, float height, boolean on)
canvas
- the PdfCanvas
on which to draw
width
- the width of the radio button to draw
height
- the height of the radio button to draw
on
- required to be true
for fulfilling the drawing operation
protected void drawCheckAppearance(float width, float height, String onStateName)
width
- the width of the checkbox to draw
height
- the height of the checkbox to draw
onStateName
- the state of the form field that will be drawn
protected void drawPdfA2CheckAppearance(float width, float height, String onStateName, int checkType)
width
- width of the checkbox
height
- height of the checkbox
onStateName
- name that corresponds to the "On" state of the checkbox
checkType
- 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 pushbutton
height
- the width of the pushbutton
text
- the text to display on the button
font
- a PdfFont
fontSize
- the size of the font
PdfFormXObject
@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 pushbutton
height
- the width of the pushbutton
text
- the text to display on the button
font
- a PdfFont
fontName
- will be ignored.
fontSize
- the size of the font
PdfFormXObject
protected 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 0
y
- will be ignored, according to spec it shall be 0
width
- the width of the button
height
- the width of the button
text
- the text to display on the button
font
- a PdfFont
fontSize
- the size of the font
protected 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 button
height
- the width of the button
fontSize
- the size of the font
on
- the boolean value of the checkbox
protected void drawPdfACheckBox(PdfCanvas canvas, float width, float height, boolean on)
Copyright © 1998–2023 iText Group NV. All rights reserved.