HI,
I am getting the XfaForm from the reader and trying to get the DOM (XML) out
of it. I am getting the XML Document with the fields, but the values stored
in the PDF filelds are not coming in the XML. Is there something i am
missing in the code? Find the attached below code. Infact, i have used this
code from iText Examples.
//Get the PDFStamper from the reader and get the AcroFields
from the
PDFStamper
PdfStamper stamper = new PdfStamper(reader, new
FileOutputStream(RESULT));
PdfWriter writ = stamper.getWriter();
//System.out.println("IndRef\t"+writ.getAcroForm().getIndRef().toString());
AcroFields formFields = stamper.getAcroFields();
//Get the XfaForm from AcroFields and get the DOM document out of it.
Use
the transformer
// and convert it to XML file.
XfaForm xfa = formFields.getXfa();
System.out.println(xfa.isXfaPresent() ? "XFA form" : "AcroForm");
Document doc = xfa.getDomDocument();
FileOutputStream os = new
FileOutputStream("IPC-1752-020-0619-001.xml");
Transformer tf = TransformerFactory.newInstance().newTransformer();
tf.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
tf.setOutputProperty(OutputKeys.INDENT, "yes");
tf.transform(new DOMSource(doc), new StreamResult(os));
Please suggest.
Thanks,
Sudheer
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/Extracted-XML-file-gives-nothing-in-the-value-field-tp3174428p3174428.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php