java.lang.Object
com.lowagie.text.pdf.AcroFields
Deprecated.
Query and change fields in existing documents either by method calls or by FDF merging.
- Author:
- Paulo Soares (psoares@consiste.pt)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.The field representations for retrieval and modification. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.static final intDeprecated.static final intDeprecated.static final intDeprecated.A field type.static final intDeprecated.A field type.static final intDeprecated.A field type.static final intDeprecated.A field type invalid or not found.static final intDeprecated.A field type.static final intDeprecated.A field type.static final intDeprecated.A field type.static final intDeprecated.A field type. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubstitutionFont(BaseFont font) Deprecated.Adds a substitution font to the list.voiddecodeGenericDictionary(PdfDictionary merged, BaseField tx) Deprecated.voidexportAsFdf(FdfWriter writer) Deprecated.Export the fields as a FDF.extractRevision(String field) Deprecated.Extracts a revision from the document.Deprecated.Gets all the fields.Deprecated.Gets the list of substitution fonts.String[]getAppearanceNames(String fieldName, int idx) Deprecated.Returns the names of the N-appearance dictionariesString[]getAppearanceStates(String fieldName) Deprecated.Gets the list of appearance names.Deprecated.Gets the field value.Deprecated.Gets the appearances cache.getFieldItem(String name) Deprecated.Gets the field structure.Deprecated.Gets the field names that have blank signatures.float[]getFieldPositions(String name) Deprecated.Gets the field box positions in the document.getFieldProperty(String field, String name, int idx) Deprecated.Gets a field property.intgetFieldType(String fieldName) Deprecated.Gets the field type.String[]getListOptionDisplay(String fieldName) Deprecated.Gets the list of display option values from fields of type list or combo.String[]getListOptionExport(String fieldName) Deprecated.Gets the list of export option values from fields of type list or combo.String[]getListSelection(String name) Deprecated.Gets the field values of a Choice field.getNewPushbuttonFromField(String field) Deprecated.Creates a new pushbutton from an existing field.getNewPushbuttonFromField(String field, int order) Deprecated.Creates a new pushbutton from an existing field.intgetRevision(String field) Deprecated.Gets thisfieldrevision.getSignatureDictionary(String name) Deprecated.Gets the signature dictionary, the one keyed by /V.Deprecated.Method to differentiate the signed signatures types contained in a document.Deprecated.Gets the field names that have signatures and are signed.intDeprecated.Gets the total number of revisions this document has.getTranslatedFieldName(String name) Deprecated.Gets the long XFA translated name.getXfa()Deprecated.Gets the XFA form processor.booleanisAppend()Deprecated.Indicates whether the stamper is in append mode or notbooleanDeprecated.Gets the property generateAppearances.voidDeprecated.Indicate that a PDF object has just been added.voidmergeXfaData(Node n) Deprecated.Merges an XML data structure into this form.static ColorparseColor(PdfArray pdfColor) Deprecated.Parses and converts colors from PDF to standard AWT Colors.booleanregenerateField(String name) Deprecated.Regenerates the field appearance.booleanremoveField(String name) Deprecated.Removes a field from the document.booleanremoveField(String name, int page) Deprecated.Removes a field from the document.booleanremoveFieldsFromPage(int page) Deprecated.Removes all the fields frompage.voidDeprecated.Removes the XFA stream from the documentbooleanrenameField(String oldName, String newName) Deprecated.Renames a field.booleanreplacePushbuttonField(String field, PdfFormField button) Deprecated.Replaces the first field with a new pushbutton.booleanreplacePushbuttonField(String field, PdfFormField button, int order) Deprecated.Replaces the designated field with a new pushbutton.voidsetAllSubstitutionFonts(List<BaseFont> substitutionFonts) Deprecated.Sets a list of substitution fonts.voidsetExtraMargin(float extraMarginLeft, float extraMarginTop) Deprecated.Sets extra margins in text fields to better mimic the Acrobat layout.booleanDeprecated.Sets the field value.booleanDeprecated.Sets the field value and the display string.voidsetFieldCacheMap(Map<String, BaseField> fieldCache) Deprecated.Sets a cache for field appearances.booleansetFieldProperty(AcroFields.Item item, String name, int value, int[] inst) Deprecated.Sets a field property.booleansetFieldProperty(String field, String name, int value, int[] inst) Deprecated.Sets a field property.booleansetFieldProperty(String field, String name, Object value, int[] inst) Deprecated.Sets a field property.voidDeprecated.Sets the fields by FDF merging.voidsetFields(FieldReader fieldReader) Deprecated.Allows merging the fields by a field reader.voidsetFields(XfdfReader fieldReader) Deprecated.Allows merging the fields by a field reader.voidsetGenerateAppearances(boolean generateAppearances) Deprecated.Sets the option to generate appearances.booleansetListOption(String fieldName, String[] exportValues, String[] displayValues) Deprecated.Sets the option list for fields of type list or combo.booleansetListSelection(String name, String[] value) Deprecated.Sets different values in a list selection.booleanDeprecated.Checks is the signature covers the entire document or just part of it.static Object[]Deprecated.verifySignature(String name) Deprecated.Verifies a signature.verifySignature(String name, String provider) Deprecated.Verifies a signature.
-
Field Details
-
DA_FONT
public static final int DA_FONTDeprecated.- See Also:
-
DA_SIZE
public static final int DA_SIZEDeprecated.- See Also:
-
DA_COLOR
public static final int DA_COLORDeprecated.- See Also:
-
FIELD_TYPE_NONE
public static final int FIELD_TYPE_NONEDeprecated.A field type invalid or not found.- See Also:
-
FIELD_TYPE_PUSHBUTTON
public static final int FIELD_TYPE_PUSHBUTTONDeprecated.A field type.- See Also:
-
FIELD_TYPE_CHECKBOX
public static final int FIELD_TYPE_CHECKBOXDeprecated.A field type.- See Also:
-
FIELD_TYPE_RADIOBUTTON
public static final int FIELD_TYPE_RADIOBUTTONDeprecated.A field type.- See Also:
-
FIELD_TYPE_TEXT
public static final int FIELD_TYPE_TEXTDeprecated.A field type.- See Also:
-
FIELD_TYPE_LIST
public static final int FIELD_TYPE_LISTDeprecated.A field type.- See Also:
-
FIELD_TYPE_COMBO
public static final int FIELD_TYPE_COMBODeprecated.A field type.- See Also:
-
FIELD_TYPE_SIGNATURE
public static final int FIELD_TYPE_SIGNATUREDeprecated.A field type.- See Also:
-
-
Method Details
-
splitDAelements
Deprecated. -
parseColor
Deprecated.Parses and converts colors from PDF to standard AWT Colors.- Parameters:
pdfColor- an array of colors- Returns:
- AWT-Color
-
getAppearanceStates
Deprecated.Gets the list of appearance names. Use it to get the names allowed with radio and checkbox fields. If the /Opt key exists the values will also be included. The name 'Off' may also be valid even if not returned in the list.- Parameters:
fieldName- the fully qualified field name- Returns:
- the list of names or
nullif the field does not exist
-
getAppearanceNames
Deprecated.Returns the names of the N-appearance dictionaries- Parameters:
fieldName- name of the form fieldidx- widget index- Returns:
- String[] of appearance names or null if the field can not be found
-
getListOptionExport
Deprecated.Gets the list of export option values from fields of type list or combo. If the field doesn't exist or the field type is not list or combo it will returnnull.- Parameters:
fieldName- the field name- Returns:
- the list of export option values from fields of type list or combo
-
getListOptionDisplay
Deprecated.Gets the list of display option values from fields of type list or combo. If the field doesn't exist or the field type is not list or combo it will returnnull.- Parameters:
fieldName- the field name- Returns:
- the list of export option values from fields of type list or combo
-
setListOption
Deprecated.Sets the option list for fields of type list or combo. One ofexportValuesordisplayValuesmay benullbut not both. This method will only set the list but will not set the value or appearance. For that, callingsetField()is required.An example:
PdfReader pdf = new PdfReader("input.pdf"); PdfStamper stp = new PdfStamper(pdf, new FileOutputStream("output.pdf")); AcroFields af = stp.getAcroFields(); af.setListOption("ComboBox", new String[]{"a", "b", "c"}, new String[]{"first", "second", "third"}); af.setField("ComboBox", "b"); stp.close();- Parameters:
fieldName- the field nameexportValues- the export valuesdisplayValues- the display values- Returns:
trueif the operation succeeded,falseotherwise
-
getFieldType
Deprecated.Gets the field type. The type can be one of:FIELD_TYPE_PUSHBUTTON,FIELD_TYPE_CHECKBOX,FIELD_TYPE_RADIOBUTTON,FIELD_TYPE_TEXT,FIELD_TYPE_LIST,FIELD_TYPE_COMBOorFIELD_TYPE_SIGNATURE.If the field does not exist or is invalid it returns
FIELD_TYPE_NONE.- Parameters:
fieldName- the field name- Returns:
- the field type
-
exportAsFdf
Deprecated.Export the fields as a FDF.- Parameters:
writer- the FDF writer
-
renameField
Deprecated.Renames a field. Only the last part of the name can be renamed. For example, if the original field is "ab.cd.ef" only the "ef" part can be renamed.- Parameters:
oldName- the old field namenewName- the new field name- Returns:
trueif the renaming was successful,falseotherwise
-
decodeGenericDictionary
Deprecated.- Throws:
DocumentException
-
getField
Deprecated.Gets the field value.- Parameters:
name- the fully qualified field name- Returns:
- the field value
-
getListSelection
Deprecated.Gets the field values of a Choice field.- Parameters:
name- the fully qualified field name- Returns:
- the field value
- Since:
- 2.1.3
-
setFieldProperty
Deprecated.Sets a field property. Valid property names are:- textfont - sets the text font. The value for this entry is a
BaseFont.
- textcolor - sets the text color. The value for this entry is a
java.awt.Color.
- textsize - sets the text size. The value for this entry is a
Float. - bgcolor - sets the background color. The value for this entry is a
java.awt.Color. Ifnullremoves the background.
- bordercolor - sets the border color. The value for this entry is a
java.awt.Color. Ifnullremoves the border.
- Parameters:
field- the field namename- the property namevalue- the property valueinst- an array ofintindexing intoAcroField.Item.mergedelements to process. Set tonullto process all- Returns:
trueif the property exists,falseotherwise
- textfont - sets the text font. The value for this entry is a
-
getFieldProperty
Deprecated.Gets a field property. Valid property names are:- textfont - gets the text font. The return value for this entry is a
String.
- textcolor - gets the text color. The return value for this entry is a
java.awt.Color.
- textsize - gets the text size. The return value for this entry is a
Float. - textfontsall - gets all available fonts used in the PDF. The return value for this entry is a
Set<String>with font names. - bgcolor - gets the background color. The return value for this entry is a
java.awt.Color. - bordercolor - gets the border color. The return value for this entry is a
java.awt.Color.
If the property does not exist null is returned.
- Parameters:
field- - the field namename- - the property nameidx- - the index of the widget- Returns:
- the above described object or null if the property is not set
- textfont - gets the text font. The return value for this entry is a
-
setFieldProperty
Deprecated.Sets a field property. Valid property names are:- flags - a set of flags specifying various characteristics of the field's widget annotation.
The value of this entry replaces that of the F entry in the form's corresponding annotation dictionary.
- setflags - a set of flags to be set (turned on) in the F entry of the form's corresponding
widget annotation dictionary. Bits equal to 1 cause the corresponding bits in F to be set to 1.
- clrflags - a set of flags to be cleared (turned off) in the F entry of the form's corresponding
widget annotation dictionary. Bits equal to 1 cause the corresponding bits in F to be set to 0.
- fflags - a set of flags specifying various characteristics of the field. The value
of this entry replaces that of the Ff entry in the form's corresponding field dictionary.
- setfflags - a set of flags to be set (turned on) in the Ff entry of the form's corresponding
field dictionary. Bits equal to 1 cause the corresponding bits in Ff to be set to 1.
- clrfflags - a set of flags to be cleared (turned off) in the Ff entry of the form's corresponding
field dictionary. Bits equal to 1 cause the corresponding bits in Ff to be set to 0.
- Parameters:
field- the field namename- the property namevalue- the property valueinst- an array ofintindexing intoAcroField.Item.mergedelements to process. Set tonullto process all- Returns:
trueif the property exists,falseotherwise
- flags - a set of flags specifying various characteristics of the field's widget annotation.
The value of this entry replaces that of the F entry in the form's corresponding annotation dictionary.
-
setFieldProperty
Deprecated.Sets a field property. Valid property names are:- flags - a set of flags specifying various characteristics of the field's widget annotation.
The value of this entry replaces that of the F entry in the form's corresponding annotation dictionary.
- setflags - a set of flags to be set (turned on) in the F entry of the form's corresponding
widget annotation dictionary. Bits equal to 1 cause the corresponding bits in F to be set to 1.
- clrflags - a set of flags to be cleared (turned off) in the F entry of the form's corresponding
widget annotation dictionary. Bits equal to 1 cause the corresponding bits in F to be set to 0.
- fflags - a set of flags specifying various characteristics of the field. The value
of this entry replaces that of the Ff entry in the form's corresponding field dictionary.
- setfflags - a set of flags to be set (turned on) in the Ff entry of the form's corresponding
field dictionary. Bits equal to 1 cause the corresponding bits in Ff to be set to 1.
- clrfflags - a set of flags to be cleared (turned off) in the Ff entry of the form's corresponding
field dictionary. Bits equal to 1 cause the corresponding bits in Ff to be set to 0.
- Parameters:
item- of the fieldname- the property namevalue- the property valueinst- an array ofintindexing intoAcroField.Item.mergedelements to process. Set tonullto process all- Returns:
trueif the property exists,falseotherwise
- flags - a set of flags specifying various characteristics of the field's widget annotation.
The value of this entry replaces that of the F entry in the form's corresponding annotation dictionary.
-
mergeXfaData
Deprecated.Merges an XML data structure into this form.- Parameters:
n- the top node of the data structure- Throws:
IOException- on errorDocumentException- o error
-
setFields
Deprecated.Sets the fields by FDF merging.- Parameters:
fdf- the FDF form- Throws:
IOException- on errorDocumentException- on error
-
setFields
Deprecated.Allows merging the fields by a field reader. One use would be to set the fields by XFDF merging.- Parameters:
fieldReader- The fields to merge.- Throws:
IOException- on errorDocumentException- on error
-
setFields
Deprecated.Allows merging the fields by a field reader. One use would be to set the fields by XFDF merging.- Parameters:
fieldReader- The fields to merge.- Throws:
IOException- on errorDocumentException- on error
-
regenerateField
Deprecated.Regenerates the field appearance. This is useful when you change a field property, but not its value, for instance form.setFieldProperty("f", "bgcolor", Color.BLUE, null); This won't have any effect, unless you use regenerateField("f") after changing the property.- Parameters:
name- the fully qualified field name or the partial name in the case of XFA forms- Returns:
trueif the field was found and changed,falseotherwise- Throws:
IOException- on errorDocumentException- on error
-
setField
Deprecated.Sets the field value.- Parameters:
name- the fully qualified field name or the partial name in the case of XFA formsvalue- the field value- Returns:
trueif the field was found and changed,falseotherwise- Throws:
IOException- on errorDocumentException- on error
-
setField
public boolean setField(String name, String value, String display) throws IOException, DocumentException Deprecated.Sets the field value and the display string. The display string is used to build the appearance in the cases where the value is modified by Acrobat with JavaScript and the algorithm is known.- Parameters:
name- the fully qualified field name or the partial name in the case of XFA formsvalue- the field valuedisplay- the string that is used for the appearance. Ifnullthevalueparameter will be used- Returns:
trueif the field was found and changed,falseotherwise- Throws:
IOException- on errorDocumentException- on error
-
setListSelection
Deprecated.Sets different values in a list selection. No appearance is generated yet; nor does the code check if multiple select is allowed.- Parameters:
name- the name of the fieldvalue- an array with values that need to be selected- Returns:
- true only if the field value was changed
- Throws:
IOException- on errorDocumentException- on error- Since:
- 2.1.4
-
getAllFields
Deprecated.Gets all the fields. The fields are keyed by the fully qualified field name and the value is an instance ofAcroFields.Item.- Returns:
- all the fields
-
getFieldItem
Deprecated.Gets the field structure.- Parameters:
name- the name of the field- Returns:
- the field structure or
nullif the field does not exist
-
getTranslatedFieldName
Deprecated.Gets the long XFA translated name.- Parameters:
name- the name of the field- Returns:
- the long field name
-
getFieldPositions
Deprecated.Gets the field box positions in the document. The return is an array offloatmultiple of 5. For each of this groups the values are: [page, llx, lly, urx, ury]. The coordinates have the page rotation in consideration.- Parameters:
name- the field name- Returns:
- the positions or
nullif field does not exist
-
removeFieldsFromPage
public boolean removeFieldsFromPage(int page) Deprecated.Removes all the fields frompage.- Parameters:
page- the page to remove the fields from- Returns:
trueif any field was removed,false otherwise
-
removeField
Deprecated.Removes a field from the document. If page equals -1 all the fields with thisnameare removed from the document otherwise only the fields in that particular page are removed.- Parameters:
name- the field namepage- the page to remove the field from or -1 to remove it from all the pages- Returns:
trueif the field exists,false otherwise
-
removeField
Deprecated.Removes a field from the document.- Parameters:
name- the field name- Returns:
trueif the field exists,false otherwise
-
isGenerateAppearances
public boolean isGenerateAppearances()Deprecated.Gets the property generateAppearances.- Returns:
- the property generateAppearances
-
setGenerateAppearances
public void setGenerateAppearances(boolean generateAppearances) Deprecated.Sets the option to generate appearances. Not generating appearances will speed-up form filling but the results can be unexpected in Acrobat. Don't use it unless your environment is well controlled. The default istrue.- Parameters:
generateAppearances- the option to generate appearances
-
getSignedFieldNames
Deprecated.Gets the field names that have signatures and are signed.- Returns:
- the field names that have signatures and are signed
-
getSignatureTypes
Deprecated.Method to differentiate the signed signatures types contained in a document. Currently approval and certification signatures are supported. If a signature is not signed the type 'UNSIGNED' is used.- Returns:
HashMap<String, SignatureType>a list of signature names with its types.
-
getFieldNamesWithBlankSignatures
Deprecated.Gets the field names that have blank signatures.- Returns:
- the field names that have blank signatures
-
getSignatureDictionary
Deprecated.Gets the signature dictionary, the one keyed by /V.- Parameters:
name- the field name- Returns:
- the signature dictionary keyed by /V or
nullif the field is not a signature
-
signatureCoversWholeDocument
Deprecated.Checks is the signature covers the entire document or just part of it.- Parameters:
name- the signature field name- Returns:
trueif the signature covers the entire document,falseotherwise
-
verifySignature
Deprecated.Verifies a signature. An example usage is:KeyStore kall = PdfPKCS7.loadCacertsKeyStore(); PdfReader reader = new PdfReader("my_signed_doc.pdf"); AcroFields af = reader.getAcroFields(); ArrayList names = af.getSignatureNames(); for (int k = 0; k < names.size(); ++k) { String name = (String)names.get(k); System.out.println("Signature name: " + name); System.out.println("Signature covers whole document: " + af.signatureCoversWholeDocument(name)); PdfPKCS7 pk = af.verifySignature(name); Calendar cal = pk.getSignDate(); Certificate pkc[] = pk.getCertificates(); System.out.println("Subject: " + PdfPKCS7.getSubjectFields(pk.getSigningCertificate())); System.out.println("Document modified: " + !pk.verify()); Object fails[] = PdfPKCS7.verifyCertificates(pkc, kall, null, cal); if (fails == null) System.out.println("Certificates verified against the KeyStore"); else System.out.println("Certificate failed: " + fails[1]); }- Parameters:
name- the signature field name- Returns:
- a
PdfPKCS7class to continue the verification
-
verifySignature
Deprecated.Verifies a signature. An example usage is:KeyStore kall = PdfPKCS7.loadCacertsKeyStore(); PdfReader reader = new PdfReader("my_signed_doc.pdf"); AcroFields af = reader.getAcroFields(); ArrayList names = af.getSignatureNames(); for (int k = 0; k < names.size(); ++k) { String name = (String)names.get(k); System.out.println("Signature name: " + name); System.out.println("Signature covers whole document: " + af.signatureCoversWholeDocument(name)); PdfPKCS7 pk = af.verifySignature(name); Calendar cal = pk.getSignDate(); Certificate pkc[] = pk.getCertificates(); System.out.println("Subject: " + PdfPKCS7.getSubjectFields(pk.getSigningCertificate())); System.out.println("Document modified: " + !pk.verify()); Object fails[] = PdfPKCS7.verifyCertificates(pkc, kall, null, cal); if (fails == null) System.out.println("Certificates verified against the KeyStore"); else System.out.println("Certificate failed: " + fails[1]); }- Parameters:
name- the signature field nameprovider- the provider ornullfor the default provider- Returns:
- a
PdfPKCS7class to continue the verification
-
markUsed
Deprecated.Indicate that a PDF object has just been added. If it is not in append mode the object will just be changed. In append mode a new object (with the same id) will be appended (cp. PDF incremental update).- Parameters:
obj- which should be marked as 'used' (=dirty)
-
getTotalRevisions
public int getTotalRevisions()Deprecated.Gets the total number of revisions this document has.- Returns:
- the total number of revisions
-
getRevision
Deprecated.Gets thisfieldrevision.- Parameters:
field- the signature field name- Returns:
- the revision or zero if it's not a signature field
-
extractRevision
Deprecated.Extracts a revision from the document.- Parameters:
field- the signature field name- Returns:
- an
InputStreamcovering the revision. Returnsnullif it's not a signature field - Throws:
IOException- on error
-
isAppend
public boolean isAppend()Deprecated.Indicates whether the stamper is in append mode or not- Returns:
- true when everything is done in the append mode otherwise false
-
getFieldCacheMap
Deprecated.Gets the appearances cache.- Returns:
- the appearances cache
-
setFieldCacheMap
Deprecated.Sets a cache for field appearances. Parsing the existing PDF to create a new TextField is time expensive. For those tasks that repeatedly fill the same PDF with different field values the use of the cache has dramatic speed advantages. An example usage:String pdfFile = ...;// the pdf file used as template ArrayList xfdfFiles = ...;// the xfdf file names ArrayList pdfOutFiles = ...;// the output file names, one for each element in xpdfFiles HashMap cache = new HashMap();// the appearances cache PdfReader originalReader = new PdfReader(pdfFile); for (int k = 0; k < xfdfFiles.size(); ++k) { PdfReader reader = new PdfReader(originalReader); XfdfReader xfdf = new XfdfReader((String)xfdfFiles.get(k)); PdfStamper stp = new PdfStamper(reader, new FileOutputStream((String)pdfOutFiles.get(k))); AcroFields af = stp.getAcroFields(); af.setFieldCache(cache); af.setFields(xfdf); stp.close(); }- Parameters:
fieldCache- a Map that will carry the cached appearances
-
setExtraMargin
public void setExtraMargin(float extraMarginLeft, float extraMarginTop) Deprecated.Sets extra margins in text fields to better mimic the Acrobat layout.- Parameters:
extraMarginLeft- the extra margin leftextraMarginTop- the extra margin top
-
addSubstitutionFont
Deprecated.Adds a substitution font to the list. The fonts in this list will be used if the original font doesn't contain the needed glyphs.- Parameters:
font- the font
-
getAllSubstitutionFonts
Deprecated.Gets the list of substitution fonts. The list is composed ofBaseFontand can benull. The fonts in this list will be used if the original font doesn't contain the needed glyphs.- Returns:
- the list
-
setAllSubstitutionFonts
Deprecated.Sets a list of substitution fonts. The list is composed ofBaseFontand can also benull. The fonts in this list will be used if the original font doesn't contain the needed glyphs.- Parameters:
substitutionFonts- the list
-
getXfa
Deprecated.Gets the XFA form processor.- Returns:
- the XFA form processor
-
removeXfa
public void removeXfa()Deprecated.Removes the XFA stream from the document -
getNewPushbuttonFromField
Deprecated.Creates a new pushbutton from an existing field. If there are several pushbuttons with the same name only the first one is used. This pushbutton can be changed and be used to replace an existing one, with the same name or other name, as long is it is in the same document. To replace an existing pushbutton callreplacePushbuttonField(String, PdfFormField).- Parameters:
field- the field name that should be a pushbutton- Returns:
- a new pushbutton or
nullif the field is not a pushbutton
-
getNewPushbuttonFromField
Deprecated.Creates a new pushbutton from an existing field. This pushbutton can be changed and be used to replace an existing one, with the same name or other name, as long is it is in the same document. To replace an existing pushbutton callreplacePushbuttonField(String, PdfFormField, int).- Parameters:
field- the field name that should be a pushbuttonorder- the field order in fields with same name- Returns:
- a new pushbutton or
nullif the field is not a pushbutton - Since:
- 2.0.7
-
replacePushbuttonField
Deprecated.Replaces the first field with a new pushbutton. The pushbutton can be created withgetNewPushbuttonFromField(String)from the same document or it can be a generic PdfFormField of the type pushbutton.- Parameters:
field- the field namebutton- thePdfFormFieldrepresenting the pushbutton- Returns:
trueif the field was replaced,falseif the field was not a pushbutton
-
replacePushbuttonField
Deprecated.Replaces the designated field with a new pushbutton. The pushbutton can be created withgetNewPushbuttonFromField(String, int)from the same document or it can be a generic PdfFormField of the type pushbutton.- Parameters:
field- the field namebutton- thePdfFormFieldrepresenting the pushbuttonorder- the field order in fields with same name- Returns:
trueif the field was replaced,falseif the field was not a pushbutton- Since:
- 2.0.7
-