public final class PDAcroForm extends PDDictionaryWrapper
| Constructor and Description |
|---|
PDAcroForm(PDDocument document) |
PDAcroForm(PDDocument document,
COSDictionary form) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFields(Collection<PDField> toAdd)
Adds the fields to the root fields of the form
|
void |
flatten()
This will flatten all form fields.
|
void |
flatten(List<PDField> fields,
boolean refreshAppearances)
This will flatten the specified form fields.
|
List<PDField> |
getCalculationOrder() |
String |
getDefaultAppearance() |
PDResources |
getDefaultResources()
This will get the default resources for the acro form.
|
PDDocument |
getDocument()
This will get the document associated with this form.
|
PDField |
getField(String fullyQualifiedName)
This will get a field by name, possibly using the cache if setCache is true.
|
Iterator<PDField> |
getFieldIterator()
Returns an iterator which walks all fields in the field tree, post-order.
|
List<PDField> |
getFields()
This will return all of the documents root fields.
|
PDFieldTree |
getFieldTree() |
int |
getQuadding()
This will get the 'quadding' or justification of the text to be displayed.
|
PDXFAResource |
getXFA()
Get the XFA resource, the XFA resource is only used for PDF 1.5+ forms.
|
boolean |
hasXFA()
This will tell if the AcroForm has XFA content.
|
boolean |
isAppendOnly()
Determines if AppendOnly is set.
|
boolean |
isNeedAppearances()
True if the viewing application should construct the appearances of all field widgets.
|
boolean |
isSignaturesExist()
Determines if SignaturesExist is set.
|
void |
refreshAppearances()
Refreshes the appearance streams and appearance dictionaries for the widget annotations of all fields.
|
void |
refreshAppearances(List<PDField> fields)
Refreshes the appearance streams and appearance dictionaries for the widget annotations of the specified fields.
|
COSBase |
removeField(PDField remove)
removes the given field from the root fields of the form
|
void |
setAppendOnly(boolean appendOnly)
Set the AppendOnly bit.
|
void |
setCalculationOrder(COSArray co) |
void |
setDefaultAppearance(String daValue)
Set the default appearance.
|
void |
setDefaultResources(PDResources dr)
This will set the default resources for the acroform.
|
void |
setFields(List<PDField> fields)
Set the documents root fields.
|
void |
setNeedAppearances(Boolean value)
Set the NeedAppearances value.
|
void |
setQuadding(int q)
This will set the quadding/justification of the text.
|
void |
setSignaturesExist(boolean signaturesExist)
Set the SignaturesExist bit.
|
void |
setXFA(PDXFAResource xfa)
Set the XFA resource, this is only used for PDF 1.5+ forms.
|
boolean |
xfaIsDynamic()
This will tell if the AcroForm is a dynamic XFA form.
|
equals, getCOSObject, hashCodepublic PDAcroForm(PDDocument document)
doc - The document that this form is part of.public PDAcroForm(PDDocument document, COSDictionary form)
doc - The document that this form is part of.form - The existing acroForm.public PDDocument getDocument()
public void flatten()
throws IOException
Flattening a form field will take the current appearance and make that part of the pages content stream. All form fields and annotations associated are removed.
The appearances for the form fields widgets will not be generated
IOExceptionpublic void flatten(List<PDField> fields, boolean refreshAppearances) throws IOException
Flattening a form field will take the current appearance and make that part of the pages content stream. All form fields and annotations associated are removed.
refreshAppearances - if set to true the appearances for the form field widgets will be updatedIOExceptionpublic void refreshAppearances()
throws IOException
IOExceptionpublic void refreshAppearances(List<PDField> fields) throws IOException
IOExceptionpublic List<PDField> getFields()
PDNonTerminalField.getChildren().public void addFields(Collection<PDField> toAdd)
fields - public COSBase removeField(PDField remove)
public void setFields(List<PDField> fields)
fields - The fields that are part of the documents root fields.public Iterator<PDField> getFieldIterator()
public PDFieldTree getFieldTree()
public PDField getField(String fullyQualifiedName)
fullyQualifiedName - The name of the field to get.public String getDefaultAppearance()
public void setDefaultAppearance(String daValue)
daValue - a string describing the default appearancepublic void setCalculationOrder(COSArray co)
public boolean isNeedAppearances()
public void setNeedAppearances(Boolean value)
value - the value for NeedAppearancespublic PDResources getDefaultResources()
public void setDefaultResources(PDResources dr)
dr - The new default resources.public boolean hasXFA()
public boolean xfaIsDynamic()
public PDXFAResource getXFA()
public void setXFA(PDXFAResource xfa)
xfa - The xfa resource.public int getQuadding()
PDVariableText.public void setQuadding(int q)
q - The new text justification.public boolean isSignaturesExist()
public void setSignaturesExist(boolean signaturesExist)
signaturesExist - The value for SignaturesExist.public boolean isAppendOnly()
public void setAppendOnly(boolean appendOnly)
appendOnly - The value for AppendOnly.Copyright © 2020 sejda. All rights reserved.