java.lang.Object
com.lowagie.text.pdf.PdfObject
com.lowagie.text.pdf.PdfDictionary
com.lowagie.text.pdf.PdfAcroForm
Each PDF document can contain maximum 1 AcroForm.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCalculationOrder(PdfFormField formField) Adds an object to the calculationOrder.addCheckBox(String name, String value, boolean status, float llx, float lly, float urx, float ury) addComboBox(String name, String[][] options, String defaultValue, boolean editable, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) addComboBox(String name, String[] options, String defaultValue, boolean editable, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) voidAdds documentFields.voidAdds fieldTemplates.voidaddFormField(PdfFormField formField) Adds a formfield to the AcroForm.addHiddenField(String name, String value) addHtmlPostButton(String name, String caption, String value, String url, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) addMap(String name, String value, String url, PdfContentByte appearance, float llx, float lly, float urx, float ury) addMultiLineTextField(String name, String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) addRadioButton(PdfFormField radiogroup, String value, float llx, float lly, float urx, float ury) voidaddRadioGroup(PdfFormField radiogroup) addResetButton(String name, String caption, String value, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) addSelectList(String name, String[][] options, String defaultValue, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) addSelectList(String name, String[] options, String defaultValue, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) addSignature(String name, float llx, float lly, float urx, float ury) addSingleLinePasswordField(String name, String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) addSingleLineTextField(String name, String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) voiddrawButton(PdfFormField button, String caption, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) voiddrawCheckBoxAppearences(PdfFormField field, String value, float llx, float lly, float urx, float ury) voiddrawMultiLineOfText(PdfFormField field, String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) voiddrawRadioAppearences(PdfFormField field, String value, float llx, float lly, float urx, float ury) voiddrawSignatureAppearences(PdfFormField field, float llx, float lly, float urx, float ury) voiddrawSingleLineOfText(PdfFormField field, String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) getRadioGroup(String name, String defaultValue, boolean noToggleToOff) booleanisValid()Checks if the Acroform is validvoidsetButtonParams(PdfFormField button, int characteristics, String name, String value) voidsetCheckBoxParams(PdfFormField field, String name, String value, boolean status, float llx, float lly, float urx, float ury) voidsetChoiceParams(PdfFormField field, String name, String defaultValue, float llx, float lly, float urx, float ury) voidsetNeedAppearances(boolean value) voidsetSigFlags(int f) Sets the signature flags.voidsetSignatureParams(PdfFormField field, String name, float llx, float lly, float urx, float ury) voidsetTextFieldParams(PdfFormField field, String text, String name, float llx, float lly, float urx, float ury) Methods inherited from class com.lowagie.text.pdf.PdfDictionary
clear, contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, getKeysAndValues, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, toPdf, toStringMethods inherited from class com.lowagie.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
Constructor Details
-
PdfAcroForm
Creates new PdfAcroForm- Parameters:
writer-PdfWriter
-
-
Method Details
-
setNeedAppearances
public void setNeedAppearances(boolean value) -
addFieldTemplates
Adds fieldTemplates.- Parameters:
ft- field templates
-
addDocumentField
Adds documentFields.- Parameters:
ref- an object ofPdfIndirectReference
-
isValid
public boolean isValid()Checks if the Acroform is valid- Returns:
- true if the Acroform is valid
-
addCalculationOrder
Adds an object to the calculationOrder.- Parameters:
formField- an object ofPdfFormField
-
setSigFlags
public void setSigFlags(int f) Sets the signature flags.- Parameters:
f- signature flag
-
addFormField
Adds a formfield to the AcroForm.- Parameters:
formField- an object ofPdfFormField
-
addHtmlPostButton
public PdfFormField addHtmlPostButton(String name, String caption, String value, String url, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) - Parameters:
name- name of the fieldcaption- captionvalue- value of the fieldurl- url for the actionfont- an object ofBaseFontfontSize- font sizellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- a PdfFormField
-
addResetButton
public PdfFormField addResetButton(String name, String caption, String value, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) - Parameters:
name- name of the fieldcaption- captionvalue- value of the fieldfont- an object ofBaseFontfontSize- font sizellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- a PdfFormField
-
addMap
public PdfFormField addMap(String name, String value, String url, PdfContentByte appearance, float llx, float lly, float urx, float ury) - Parameters:
name- name of the fieldvalue- value of the fieldurl- url of the actionappearance- an object ofPdfContentBytellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- a PdfFormField
-
setButtonParams
- Parameters:
button- an object ofPdfFormFieldcharacteristics- characteristicsname- name of the fieldvalue- value of the field
-
drawButton
public void drawButton(PdfFormField button, String caption, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) - Parameters:
button- an object ofPdfFormFieldcaption- captionfont- an object ofBaseFontfontSize- font sizellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y
-
addHiddenField
- Parameters:
name- name of the fieldvalue- value of the field- Returns:
- a PdfFormField
-
addSingleLineTextField
public PdfFormField addSingleLineTextField(String name, String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) - Parameters:
name- name of the fieldtext- value for fieldfont- an object ofBaseFontfontSize- font sizellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- a PdfFormField
-
addMultiLineTextField
public PdfFormField addMultiLineTextField(String name, String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) - Parameters:
name- name of the fieldtext- value for fieldfont- an object ofBaseFontfontSize- font sizellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- a PdfFormField
-
addSingleLinePasswordField
public PdfFormField addSingleLinePasswordField(String name, String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) - Parameters:
name- name of the fieldtext- text for the fieldfont- an object ofBaseFontfontSize- font sizellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- PdfFormField
-
setTextFieldParams
public void setTextFieldParams(PdfFormField field, String text, String name, float llx, float lly, float urx, float ury) - Parameters:
field- an object ofPdfFormFieldtext- text for the fieldname- name of the fieldllx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y
-
drawSingleLineOfText
public void drawSingleLineOfText(PdfFormField field, String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) - Parameters:
field- fieldtext- text for the fieldfont- an object ofBaseFontfontSize- font sizellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y
-
drawMultiLineOfText
public void drawMultiLineOfText(PdfFormField field, String text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) - Parameters:
field- field, an object ofPdfFormFieldtext- text for fieldfont- an object ofBaseFontfontSize- font sizellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y
-
addCheckBox
public PdfFormField addCheckBox(String name, String value, boolean status, float llx, float lly, float urx, float ury) - Parameters:
name- field namevalue- value of the fieldstatus- statusllx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- a PdfFormField
-
setCheckBoxParams
public void setCheckBoxParams(PdfFormField field, String name, String value, boolean status, float llx, float lly, float urx, float ury) - Parameters:
field- field, an object ofPdfFormFieldname- field namevalue- value of the fieldstatus- statusllx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y
-
drawCheckBoxAppearences
public void drawCheckBoxAppearences(PdfFormField field, String value, float llx, float lly, float urx, float ury) - Parameters:
field- field, an object ofPdfFormFieldvalue- value of the fieldllx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y
-
getRadioGroup
- Parameters:
name- name of the fielddefaultValue- default valuenoToggleToOff- noToggleToOff- Returns:
- a PdfFormField
-
addRadioGroup
- Parameters:
radiogroup- field
-
addRadioButton
public PdfFormField addRadioButton(PdfFormField radiogroup, String value, float llx, float lly, float urx, float ury) - Parameters:
radiogroup- radio group fieldvalue- value of the fieldllx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- a PdfFormField
-
drawRadioAppearences
public void drawRadioAppearences(PdfFormField field, String value, float llx, float lly, float urx, float ury) - Parameters:
field- field, an object ofPdfFormFieldvalue- valuellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y
-
addSelectList
public PdfFormField addSelectList(String name, String[] options, String defaultValue, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) - Parameters:
name- name of the fieldoptions- optionsdefaultValue- default valuefont- an object ofBaseFontfontSize- font sizellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- a PdfFormField
-
addSelectList
public PdfFormField addSelectList(String name, String[][] options, String defaultValue, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) - Parameters:
name- name of the fieldoptions- optionsdefaultValue- default valuefont- an object ofBaseFontfontSize- font sizellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- a PdfFormField
-
addComboBox
public PdfFormField addComboBox(String name, String[] options, String defaultValue, boolean editable, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) - Parameters:
name- name of the fieldoptions- optionsdefaultValue- default valueeditable- if field is editable,trueorfalsefont- an object ofBaseFontfontSize- font sizellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- a PdfFormField
-
addComboBox
public PdfFormField addComboBox(String name, String[][] options, String defaultValue, boolean editable, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) - Parameters:
name- name of the fieldoptions- optionsdefaultValue- default valueeditable- if field is editable,trueorfalsefont- an object ofBaseFontfontSize- font sizellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- a PdfFormField
-
setChoiceParams
public void setChoiceParams(PdfFormField field, String name, String defaultValue, float llx, float lly, float urx, float ury) - Parameters:
field- field, an object ofPdfFormFieldname- field namedefaultValue- default caluellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y
-
addSignature
- Parameters:
name- field namellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y- Returns:
- a PdfFormField
-
setSignatureParams
public void setSignatureParams(PdfFormField field, String name, float llx, float lly, float urx, float ury) - Parameters:
field- field, an object ofPdfFormFieldname- field namellx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y
-
drawSignatureAppearences
public void drawSignatureAppearences(PdfFormField field, float llx, float lly, float urx, float ury) - Parameters:
field- field, an object ofPdfFormFieldllx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y
-