| Modifier and Type | Field and Description |
|---|---|
| private final COSDictionary | |
| private final Map | |
| private final PDDocument | |
| private Map | |
| private static final int | |
| private static final int | |
| private static final Log | |
| private ScriptingHandler |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PDAcroForm(PDDocument
The document that this form is part of. doc, COSDictionary The existing acroForm. form)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| private Map | buildPagesWidgetsMap(List<PDField>
a list of fields to be flattened fields, PDPageTree the page tree pages)Build a map of pages => widgets |
| private Set | createWidgetDictionarySet(List<PDField> fields)
Return a set of all annotation widget dictionaries related to the fields to be flattened. |
| public FDFDocument | |
| private void | fillPagesAnnotationMap(Map<COSDictionary, Set<COSDictionary>> pagesAnnotationsMap, PDPage page, PDAnnotationWidget widget)
|
| public void | |
| public void | |
| public List | Returns: field list. Note these objects may not be identical to PDField objects retrieved from other methods (depending on cache setting). The best strategy is to callgetCOSObject() to check for identity. The list is not backed by the /CO COSArray in
the document.Return the calculation order in which field values should be recalculated when the value of any field changes. |
| public COSDictionary | getCOSObject()
Implements org. Convert this standard java object to a COS object. |
| public String | |
| public PDResources | Returns: The default resources or null if there is none.This will get the default resources for the AcroForm. |
| pack-priv PDDocument | |
| public PDField | |
| public Iterator | Returns: an iterator which walks all fields in the field treeReturns an iterator which walks all fields in the field tree, in order. |
| public List | Returns: A list of the documents root fields, never null. If there are no fields then this method returns an empty list.This will return all of the documents root fields. |
| public PDFieldTree | Returns: the field tree representing all form fieldsReturn the field tree representing all form fields |
| public boolean | Returns: the value of NeedAppearances, false if the value isn't setTrue if the viewing application should construct the appearances of all field widgets. |
| public int | Returns: The justification of the variable text fields.This will get the document-wide default value for the quadding/justification of variable text fields. |
| public ScriptingHandler | Returns: scriptingHandler the handler to support JavaScript actions in the formSet a handler to support JavaScript actions in the form. |
| private Rectangle2D | Returns: the transformed rectangleCalculate the transformed appearance box. |
| public PDXFAResource | Returns: The xfa resource or null if it does not exist.Get the XFA resource, the XFA resource is only used for PDF 1.5+ forms. |
| public boolean | |
| public void | importFDF(FDFDocument
The FDF document to import. fdf)This method will import an entire FDF document into the PDF document that this acroform is part of. |
| public boolean | Returns: true if the document contains signatures that may be invalidated if the file is saved.Determines if AppendOnly is set. |
| public boolean | Returns: true if the fields are being cached.This will tell if this acro form is caching the fields. |
| public boolean | Returns: true if the document contains at least one signature.Determines if SignaturesExist is set. |
| private boolean | |
| public void | refreshAppearances()
Refreshes the appearance streams and appearance dictionaries for the widget annotations of all fields. |
| public void | refreshAppearances(List<PDField>
a list of fields to be refreshed fields)Refreshes the appearance streams and appearance dictionaries for the widget annotations of the specified fields. |
| private void | |
| private Matrix | |
| public void | |
| public void | setCacheFields(boolean
A boolean telling if we should cache the fields. cache)This will tell this form to cache the fields into a Map structure for fast access via the getField method. |
| public void | setCalcOrder(List<PDField>
The field list. fields)Set the calculation order in which field values should be recalculated when the value of any field changes. |
| public void | setDefaultAppearance(String
a string describing the default appearance daValue)Set the default appearance. |
| public void | setDefaultResources(PDResources
The new default resources. dr)This will set the default resources for the acroform. |
| public void | |
| public void | |
| public void | setQ(int
The justification of the variable text fields. q)This will set the document-wide default value for the quadding/justification of variable text fields. |
| public void | setScriptingHandler(ScriptingHandler
a handler to support JavaScript actions in the form scriptingHandler)Set a handler to support JavaScript actions in the form. |
| public void | setSignaturesExist(boolean
The value for SignaturesExist. signaturesExist)Set the SignaturesExist bit. |
| public void | setXFA(PDXFAResource
The xfa resource. xfa)Set the XFA resource, this is only used for PDF 1.5+ forms. |
| public boolean | Returns: true if the AcroForm is a dynamic XFA formThis will tell if the AcroForm is a dynamic XFA form. |
| dictionary | back to summary |
|---|---|
| private final COSDictionary dictionary | |
| directFontCache | back to summary |
|---|---|
| private final Map<COSName, SoftReference<PDFont>> directFontCache | |
| document | back to summary |
|---|---|
| private final PDDocument document | |
| fieldCache | back to summary |
|---|---|
| private Map<String, PDField> fieldCache | |
| FLAG_APPEND_ONLY | back to summary |
|---|---|
| private static final int FLAG_APPEND_ONLY | |
| FLAG_SIGNATURES_EXIST | back to summary |
|---|---|
| private static final int FLAG_SIGNATURES_EXIST | |
| LOG | back to summary |
|---|---|
| private static final Log LOG | |
| scriptingHandler | back to summary |
|---|---|
| private ScriptingHandler scriptingHandler | |
| PDAcroForm | back to summary |
|---|---|
| public PDAcroForm(PDDocument doc) Constructor.
| |
| PDAcroForm | back to summary |
|---|---|
| public PDAcroForm(PDDocument doc, COSDictionary form) Constructor.
| |
| buildPagesWidgetsMap | back to summary |
|---|---|
| private Map Build a map of pages => widgets
| |
| createWidgetDictionarySet | back to summary |
|---|---|
| private Set Return a set of all annotation widget dictionaries related to the fields to be flattened. | |
| exportFDF | back to summary |
|---|---|
| public FDFDocument exportFDF() throws IOException This will export all FDF form data.
| |
| fillPagesAnnotationMap | back to summary |
|---|---|
| private void fillPagesAnnotationMap(Map<COSDictionary, Set<COSDictionary>> pagesAnnotationsMap, PDPage page, PDAnnotationWidget widget) | |
| flatten | back to summary |
|---|---|
| public void flatten() throws IOException This will flatten all form fields. 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. Invisible and hidden fields will be skipped and will not become part of the page content stream The appearances for the form fields widgets will not be generated
| |
| flatten | back to summary |
|---|---|
| public void flatten(List<PDField> fields, boolean refreshAppearances) throws IOException This will flatten the specified form fields. 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. Invisible and hidden fields will be skipped and will not become part of the page content stream
| |
| getCalcOrder | back to summary |
|---|---|
| public List Return the calculation order in which field values should be recalculated when the value of any field changes. (Read about "Trigger Events" in the PDF specification)
| |
| getCOSObject | back to summary |
|---|---|
| public COSDictionary getCOSObject() Implements org. Doc from org. Convert this standard java object to a COS object.
| |
| getDefaultAppearance | back to summary |
|---|---|
| public String getDefaultAppearance() Get the default appearance.
| |
| getDefaultResources | back to summary |
|---|---|
| public PDResources getDefaultResources() This will get the default resources for the AcroForm.
| |
| getDocument | back to summary |
|---|---|
| pack-priv PDDocument getDocument() This will get the document associated with this form.
| |
| getField | back to summary |
|---|---|
| public PDField getField(String fullyQualifiedName) This will get a field by name, possibly using the cache if setCache is true. | |
| getFieldIterator | back to summary |
|---|---|
| public Iterator Returns an iterator which walks all fields in the field tree, in order. | |
| getFields | back to summary |
|---|---|
| public List This will return all of the documents root fields.
A field might have children that are fields (non-terminal field) or does not
have children which are fields (terminal fields).
The fields within an AcroForm are organized in a tree structure. The documents root fields
might either be terminal fields, non-terminal fields or a mixture of both. Non-terminal fields
mark branches which contents can be retrieved using | |
| getFieldTree | back to summary |
|---|---|
| public PDFieldTree getFieldTree() Return the field tree representing all form fields
| |
| getNeedAppearances | back to summary |
|---|---|
| public boolean getNeedAppearances() True if the viewing application should construct the appearances of all field widgets. The default value is false.
| |
| getQ | back to summary |
|---|---|
| public int getQ() This will get the document-wide default value for the quadding/justification of variable text fields.
0 - Left(default)
| |
| getScriptingHandler | back to summary |
|---|---|
| public ScriptingHandler getScriptingHandler() Set a handler to support JavaScript actions in the form.
| |
| getTransformedAppearanceBBox | back to summary |
|---|---|
| private Rectangle2D getTransformedAppearanceBBox(PDAppearanceStream appearanceStream) Calculate the transformed appearance box. Apply the Matrix (or an identity transform) to the BBox of the appearance stream
| |
| getXFA | back to summary |
|---|---|
| public PDXFAResource getXFA() Get the XFA resource, the XFA resource is only used for PDF 1.5+ forms.
| |
| hasXFA | back to summary |
|---|---|
| public boolean hasXFA() This will tell if the AcroForm has XFA content.
| |
| importFDF | back to summary |
|---|---|
| public void importFDF(FDFDocument fdf) throws IOException This method will import an entire FDF document into the PDF document that this acroform is part of.
| |
| isAppendOnly | back to summary |
|---|---|
| public boolean isAppendOnly() Determines if AppendOnly is set.
| |
| isCachingFields | back to summary |
|---|---|
| public boolean isCachingFields() This will tell if this acro form is caching the fields.
| |
| isSignaturesExist | back to summary |
|---|---|
| public boolean isSignaturesExist() Determines if SignaturesExist is set.
| |
| isVisibleAnnotation | back to summary |
|---|---|
| private boolean isVisibleAnnotation(PDAnnotation annotation) | |
| refreshAppearances | back to summary |
|---|---|
| public void refreshAppearances() throws IOException Refreshes the appearance streams and appearance dictionaries for the widget annotations of all fields.
| |
| refreshAppearances | back to summary |
|---|---|
| public void refreshAppearances(List<PDField> fields) throws IOException Refreshes the appearance streams and appearance dictionaries for the widget annotations of the specified fields.
| |
| removeFields | back to summary |
|---|---|
| private void removeFields(List<PDField> fields) | |
| resolveTransformationMatrix | back to summary |
|---|---|
| private Matrix resolveTransformationMatrix(PDAnnotation annotation, PDAppearanceStream appearanceStream) | |
| setAppendOnly | back to summary |
|---|---|
| public void setAppendOnly(boolean appendOnly) Set the AppendOnly bit.
| |
| setCacheFields | back to summary |
|---|---|
| public void setCacheFields(boolean cache) This will tell this form to cache the fields into a Map structure for fast access via the getField method. The default is false. You would want this to be false if you were changing the COSDictionary behind the scenes, otherwise setting this to true is acceptable.
| |
| setCalcOrder | back to summary |
|---|---|
| public void setCalcOrder(List<PDField> fields) Set the calculation order in which field values should be recalculated when the value of any field changes. (Read about "Trigger Events" in the PDF specification) | |
| setDefaultAppearance | back to summary |
|---|---|
| public void setDefaultAppearance(String daValue) Set the default appearance.
| |
| setDefaultResources | back to summary |
|---|---|
| public void setDefaultResources(PDResources dr) This will set the default resources for the acroform.
| |
| setFields | back to summary |
|---|---|
| public void setFields(List<PDField> fields) Set the documents root fields. | |
| setNeedAppearances | back to summary |
|---|---|
| public void setNeedAppearances(Boolean value) Set the NeedAppearances value. If this is false, PDFBox will create appearances for all field widget.
| |
| setQ | back to summary |
|---|---|
| public void setQ(int q) This will set the document-wide default value for the quadding/justification of variable text
fields. See the QUADDING constants of
| |
| setScriptingHandler | back to summary |
|---|---|
| public void setScriptingHandler(ScriptingHandler scriptingHandler) Set a handler to support JavaScript actions in the form.
| |
| setSignaturesExist | back to summary |
|---|---|
| public void setSignaturesExist(boolean signaturesExist) Set the SignaturesExist bit.
| |
| setXFA | back to summary |
|---|---|
| public void setXFA(PDXFAResource xfa) Set the XFA resource, this is only used for PDF 1.5+ forms.
| |
| xfaIsDynamic | back to summary |
|---|---|
| public boolean xfaIsDynamic() This will tell if the AcroForm is a dynamic XFA form.
| |