public class PDAcroForm extends Object implements COSObjectable
Constructor and Description |
---|
PDAcroForm(PDDocument doc)
Constructor.
|
PDAcroForm(PDDocument doc,
COSDictionary form)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
FDFDocument |
exportFDF()
This will export all FDF form data.
|
COSBase |
getCOSObject()
Convert this standard java object to a COS object.
|
PDResources |
getDefaultResources()
This will get the default resources for the acro form.
|
COSDictionary |
getDictionary()
This will get the dictionary that this form wraps.
|
PDDocument |
getDocument()
This will get the document associated with this form.
|
PDField |
getField(String name)
This will get a field by name, possibly using the cache if setCache is true.
|
List |
getFields()
This will return all of the documents root fields.
|
PDXFA |
getXFA()
Get the XFA resource, the XFA resource is only used for PDF 1.5+ forms.
|
void |
importFDF(FDFDocument fdf)
This method will import an entire FDF document into the PDF document
that this acroform is part of.
|
boolean |
isCachingFields()
This will tell if this acro form is caching the fields.
|
void |
setCacheFields(boolean cache)
This will tell this form to cache the fields into a Map structure
for fast access via the getField method.
|
void |
setDefaultResources(PDResources dr)
This will set the default resources for the acroform.
|
void |
setFields(List fields)
Set the documents root fields.
|
void |
setXFA(PDXFA xfa)
Set the XFA resource, this is only used for PDF 1.5+ forms.
|
public PDAcroForm(PDDocument doc)
doc
- The document that this form is part of.public PDAcroForm(PDDocument doc, COSDictionary form)
doc
- The document that this form is part of.form
- The existing acroForm.public PDDocument getDocument()
public COSDictionary getDictionary()
public void importFDF(FDFDocument fdf) throws IOException
fdf
- The FDF document to import.IOException
- If there is an error doing the import.public FDFDocument exportFDF() throws IOException
IOException
- If there is an error when exporting the document.public List getFields() throws IOException
PDFieldTreeNode#getKids()
.IOException
public void setFields(List fields)
fields
- The fields that are part of the documents root fields.public void setCacheFields(boolean cache) throws IOException
cache
- A boolean telling if we should cache the fields.IOException
- If there is an error while caching the fields.public boolean isCachingFields()
public PDField getField(String name) throws IOException
name
- The name of the field to get.IOException
- If there is an error getting the field type.public PDResources getDefaultResources()
public void setDefaultResources(PDResources dr)
dr
- The new default resources.public COSBase getCOSObject()
getCOSObject
in interface COSObjectable
public PDXFA getXFA()
public void setXFA(PDXFA xfa)
xfa
- The xfa resource.Copyright © 2002–2017 The Apache Software Foundation. All rights reserved.