|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.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
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 | |
---|---|
private XfaForm.AcroFieldsSearch |
acroFieldsSom
|
private boolean |
changed
|
private Node |
datasetsNode
|
private XfaForm.Xml2SomDatasets |
datasetsSom
|
private Document |
domDocument
|
private PdfReader |
reader
|
private Node |
templateNode
|
private XfaForm.Xml2SomTemplate |
templateSom
|
static String |
XFA_DATA_SCHEMA
|
private boolean |
xfaPresent
|
Constructor Summary | |
---|---|
XfaForm()
An empty constructor to build on. |
|
XfaForm(PdfReader reader)
A constructor from a PdfReader . |
Method Summary | |
---|---|
private void |
extractNodes()
Extracts the nodes from the domDocument. |
void |
fillXfaForm(File file)
|
void |
fillXfaForm(InputSource is)
|
void |
fillXfaForm(InputStream is)
|
void |
fillXfaForm(Node node)
Replaces the data under datasets/data. |
String |
findDatasetsName(String name)
Finds the complete SOM name contained in the datasets section from a possibly partial name. |
Node |
findDatasetsNode(String name)
Finds the Node contained in the datasets section from a
possibly partial name. |
String |
findFieldName(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. |
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. |
Document |
getDomDocument()
Gets the top level DOM document. |
static String |
getNodeText(Node n)
Gets all the text contained in the child nodes of this node. |
private static String |
getNodeText(Node n,
String name)
|
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(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(Document domDocument)
Sets the top DOM document. |
void |
setNodeText(Node n,
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 |
---|
private XfaForm.Xml2SomTemplate templateSom
private Node templateNode
private XfaForm.Xml2SomDatasets datasetsSom
private Node datasetsNode
private XfaForm.AcroFieldsSearch acroFieldsSom
private PdfReader reader
private boolean xfaPresent
private Document domDocument
private boolean changed
public static final String XFA_DATA_SCHEMA
Constructor Detail |
---|
public XfaForm()
public XfaForm(PdfReader reader) throws IOException, ParserConfigurationException, SAXException
PdfReader
. It basically does everything
from finding the XFA stream to the XML parsing.
reader
- the reader
IOException
- on error
ParserConfigurationException
- on error
SAXException
- on errorMethod Detail |
---|
public static PdfObject getXfaObject(PdfReader reader)
reader
- a PdfReader instance
private void extractNodes()
public static void setXfa(XfaForm form, PdfReader reader, PdfWriter writer) throws IOException
form
- the datareader
- the readerwriter
- the writer
IOException
- on errorpublic void setXfa(PdfWriter writer) throws IOException
writer
- the writer
IOException
- on errorpublic static byte[] serializeDoc(Node n) throws IOException
n
- the XML document
IOException
- on errorpublic boolean isXfaPresent()
true
if it is a XFA form.
true
if it is a XFA formpublic Document getDomDocument()
public String findFieldName(String name, AcroFields af)
name
- the complete or partial nameaf
- the fields
null
if not foundpublic String findDatasetsName(String name)
name
- the complete or partial name
null
if not foundpublic Node findDatasetsNode(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 String getNodeText(Node n)
n
- the Node
private static String getNodeText(Node n, String name)
public void setNodeText(Node n, 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(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 Node getDatasetsNode()
Node
that corresponds to the datasets part.
Node
that corresponds to the datasets partpublic void fillXfaForm(File file) throws ParserConfigurationException, SAXException, IOException
ParserConfigurationException
SAXException
IOException
public void fillXfaForm(InputStream is) throws ParserConfigurationException, SAXException, IOException
ParserConfigurationException
SAXException
IOException
public void fillXfaForm(InputSource is) throws ParserConfigurationException, SAXException, IOException
ParserConfigurationException
SAXException
IOException
public void fillXfaForm(Node node)
|
Hosted by Hostbasket | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |