|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.itextpdf.text.pdf.XfaForm
public class XfaForm
Processes XFA forms.
Nested Class Summary | |
---|---|
static class |
XfaForm.AcroFieldsSearch
A class to process "classic" fields. |
static class |
XfaForm.InverseStore
A structure to store each part of a SOM name and link it to the next part beginning from the lower hierarchy. |
static class |
XfaForm.Stack2<T>
Another stack implementation. |
static class |
XfaForm.Xml2Som
A class for some basic SOM processing. |
static class |
XfaForm.Xml2SomDatasets
Processes the datasets section in the XFA form. |
static class |
XfaForm.Xml2SomTemplate
Processes the template section in the XFA form. |
Field Summary | |
---|---|
static java.lang.String |
XFA_DATA_SCHEMA
|
Constructor Summary | |
---|---|
XfaForm()
An empty constructor to build on. |
|
XfaForm(PdfReader reader)
A constructor from a PdfReader . |
Method Summary | |
---|---|
static java.util.Map<java.lang.String,org.w3c.dom.Node> |
extractXFANodes(org.w3c.dom.Document domDocument)
|
void |
fillXfaForm(java.io.File file)
|
void |
fillXfaForm(java.io.File file,
boolean readOnly)
|
void |
fillXfaForm(org.xml.sax.InputSource is)
|
void |
fillXfaForm(org.xml.sax.InputSource is,
boolean readOnly)
|
void |
fillXfaForm(java.io.InputStream is)
|
void |
fillXfaForm(java.io.InputStream is,
boolean readOnly)
|
void |
fillXfaForm(org.w3c.dom.Node node)
|
void |
fillXfaForm(org.w3c.dom.Node node,
boolean readOnly)
Replaces the data under datasets/data. |
java.lang.String |
findDatasetsName(java.lang.String name)
Finds the complete SOM name contained in the datasets section from a possibly partial name. |
org.w3c.dom.Node |
findDatasetsNode(java.lang.String name)
Finds the Node contained in the datasets section from a
possibly partial name. |
java.lang.String |
findFieldName(java.lang.String name,
AcroFields af)
Finds the complete field name contained in the "classic" forms from a partial name. |
XfaForm.AcroFieldsSearch |
getAcroFieldsSom()
Gets the class that contains the "classic" fields processing. |
org.w3c.dom.Node |
getDatasetsNode()
Gets the Node that corresponds to the datasets part. |
XfaForm.Xml2SomDatasets |
getDatasetsSom()
Gets the class that contains the datasets processing section of the XFA. |
org.w3c.dom.Document |
getDomDocument()
Gets the top level DOM document. |
static java.lang.String |
getNodeText(org.w3c.dom.Node n)
Gets all the text contained in the child nodes of this node. |
PdfReader |
getReader()
Gets the PdfReader used by this instance. |
XfaForm.Xml2SomTemplate |
getTemplateSom()
Gets the class that contains the template processing section of the XFA. |
static PdfObject |
getXfaObject(PdfReader reader)
Return the XFA Object, could be an array, could be a Stream. |
boolean |
isChanged()
Checks if this XFA form was changed. |
boolean |
isXfaPresent()
Returns true if it is a XFA form. |
static byte[] |
serializeDoc(org.w3c.dom.Node n)
Serializes a XML document to a byte array. |
void |
setAcroFieldsSom(XfaForm.AcroFieldsSearch acroFieldsSom)
Sets the class that contains the "classic" fields processing. |
void |
setChanged(boolean changed)
Sets the changed status of this XFA instance. |
void |
setDatasetsSom(XfaForm.Xml2SomDatasets datasetsSom)
Sets the class that contains the datasets processing section of the XFA. |
void |
setDomDocument(org.w3c.dom.Document domDocument)
Sets the top DOM document. |
void |
setNodeText(org.w3c.dom.Node n,
java.lang.String text)
Sets the text of this node. |
void |
setReader(PdfReader reader)
Sets the PdfReader to be used by this instance. |
void |
setTemplateSom(XfaForm.Xml2SomTemplate templateSom)
Sets the class that contains the template processing section of the XFA |
void |
setXfa(PdfWriter writer)
Sets the XFA key from the instance data. |
static void |
setXfa(XfaForm form,
PdfReader reader,
PdfWriter writer)
Sets the XFA key from a byte array. |
void |
setXfaPresent(boolean xfaPresent)
Sets the XFA form flag signaling that this is a valid XFA form. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String XFA_DATA_SCHEMA
Constructor Detail |
---|
public XfaForm()
public XfaForm(PdfReader reader) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
PdfReader
. It basically does everything
from finding the XFA stream to the XML parsing.
reader
- the reader
java.io.IOException
- on error
javax.xml.parsers.ParserConfigurationException
- on error
org.xml.sax.SAXException
- on errorMethod Detail |
---|
public static PdfObject getXfaObject(PdfReader reader)
reader
- a PdfReader instance
public static java.util.Map<java.lang.String,org.w3c.dom.Node> extractXFANodes(org.w3c.dom.Document domDocument)
public static void setXfa(XfaForm form, PdfReader reader, PdfWriter writer) throws java.io.IOException
form
- the datareader
- the readerwriter
- the writer
java.io.IOException
- on errorpublic void setXfa(PdfWriter writer) throws java.io.IOException
writer
- the writer
java.io.IOException
- on errorpublic static byte[] serializeDoc(org.w3c.dom.Node n) throws java.io.IOException
n
- the XML document
java.io.IOException
- on errorpublic boolean isXfaPresent()
true
if it is a XFA form.
true
if it is a XFA formpublic org.w3c.dom.Document getDomDocument()
public java.lang.String findFieldName(java.lang.String name, AcroFields af)
name
- the complete or partial nameaf
- the fields
null
if not foundpublic java.lang.String findDatasetsName(java.lang.String name)
name
- the complete or partial name
null
if not foundpublic org.w3c.dom.Node findDatasetsNode(java.lang.String name)
Node
contained in the datasets section from a
possibly partial name.
name
- the complete or partial name
Node
or null
if not foundpublic static java.lang.String getNodeText(org.w3c.dom.Node n)
n
- the Node
public void setNodeText(org.w3c.dom.Node n, java.lang.String text)
n
- the Node
to add the text totext
- the text to addpublic void setXfaPresent(boolean xfaPresent)
xfaPresent
- the XFA form flag signaling that this is a valid XFA formpublic void setDomDocument(org.w3c.dom.Document domDocument)
domDocument
- the top DOM documentpublic PdfReader getReader()
PdfReader
used by this instance.
PdfReader
used by this instancepublic void setReader(PdfReader reader)
PdfReader
to be used by this instance.
reader
- the PdfReader
to be used by this instancepublic boolean isChanged()
true
if this XFA form was changedpublic void setChanged(boolean changed)
changed
- the changed status of this XFA instancepublic XfaForm.Xml2SomTemplate getTemplateSom()
public void setTemplateSom(XfaForm.Xml2SomTemplate templateSom)
templateSom
- the class that contains the template processing section of the XFApublic XfaForm.Xml2SomDatasets getDatasetsSom()
public void setDatasetsSom(XfaForm.Xml2SomDatasets datasetsSom)
datasetsSom
- the class that contains the datasets processing section of the XFApublic XfaForm.AcroFieldsSearch getAcroFieldsSom()
public void setAcroFieldsSom(XfaForm.AcroFieldsSearch acroFieldsSom)
acroFieldsSom
- the class that contains the "classic" fields processingpublic org.w3c.dom.Node getDatasetsNode()
Node
that corresponds to the datasets part.
Node
that corresponds to the datasets partpublic void fillXfaForm(java.io.File file) throws java.io.IOException
java.io.IOException
public void fillXfaForm(java.io.File file, boolean readOnly) throws java.io.IOException
java.io.IOException
public void fillXfaForm(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public void fillXfaForm(java.io.InputStream is, boolean readOnly) throws java.io.IOException
java.io.IOException
public void fillXfaForm(org.xml.sax.InputSource is) throws java.io.IOException
java.io.IOException
public void fillXfaForm(org.xml.sax.InputSource is, boolean readOnly) throws java.io.IOException
java.io.IOException
public void fillXfaForm(org.w3c.dom.Node node)
public void fillXfaForm(org.w3c.dom.Node node, boolean readOnly)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |