XfaForm { public Node findDatasetsNode(String name) { if (name == null) return null; name = findDatasetsName(name); if (name == null) return null; return datasetsSom.getName2Node().get(name); } XfaForm();  XfaForm(InputStream inputStream);  XfaForm(Document domDocument);  XfaForm(PdfDictionary acroFormDictionary);  XfaForm(PdfDocument pdfDocument); static void setXfaForm(XfaForm form, PdfDocument pdfDocument); static void setXfaForm(XfaForm form, PdfAcroForm acroForm); static Map<String, Node> extractXFANodes(Document domDocument); void write(PdfDocument document); void write(PdfAcroForm acroForm); void setXfaFieldValue(String name, String value); String getXfaFieldValue(String name); boolean isXfaPresent(); String findFieldName(String name); String findDatasetsName(String name); Node findDatasetsNode(String name); static String getNodeText(Node n); void setNodeText(Node n, String text); Document getDomDocument(); void setDomDocument(org.w3c.dom.Document domDocument); Node getDatasetsNode(); void fillXfaForm(File file); void fillXfaForm(File file, boolean readOnly); void fillXfaForm(InputStream is); void fillXfaForm(InputStream is, boolean readOnly); void fillXfaForm(InputSource is); void fillXfaForm(InputSource is, boolean readOnly); void fillXfaForm(Node node); void fillXfaForm(Node node, boolean readOnly); static final String XFA_DATA_SCHEMA; }
@Test public void extractXFADataTest() throws IOException { String src = sourceFolder + "xfaFormWithDataSet.pdf"; PdfDocument pdfDocument = new PdfDocument(new PdfReader(src)); XfaForm xfa = new XfaForm(pdfDocument); Node node = xfa.findDatasetsNode("Number1"); Assert.assertNotNull(node); Assert.assertEquals("Number1", node.getNodeName()); }