Lucian Hancu wrote: > > Thank you, > > can you confirm that's in the chapter 8 of the new book (second > edition)? or chapter 16? > i'm about to buy it, but need a more precise answer first
Chapter 8 in the second edition. XFA isn't discussed in the first edition. See http://itextpdf.com/examples/index.php?page=example&id=164 for an example: public void readFieldnames(String src, String dest) throws IOException { PrintStream out = new PrintStream(new FileOutputStream(dest)); PdfReader reader = new PdfReader(src); AcroFields form = reader.getAcroFields(); XfaForm xfa = form.getXfa(); out.println(xfa.isXfaPresent() ? "XFA form" : "AcroForm"); Set<String> fields = form.getFields().keySet(); for (String key : fields) { out.println(key); } out.flush(); out.close(); } The txt file "dest" created in this snippet based on the PDF file "src" can return: AcroForm [fields ...] In this case, you have an AcroForm, except if the list of fields is empty, then you have an ordinary PDF without a form. It can return: XFA form [fields ...] If the list of fields is empty, you (propably) have a dynamic XFA from (or a static XFA form with AcroForm counterpart). If a list of fields is returned, you have a static XFA form with an AcroForm counterpart. iText can fill an AcroForm, a static XFA form, and flatten it if necessary. iText can fill an XFA form, but can't flatten it. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
