since upgrading the Java version of Aspose-Pdf from 19.2 to 21.5 (and today while testing this bug also to the latest 21.10!) we experience a bug with the importForm functionality of the facades.Form class.
Example source code:
// Aspose initialization... InputStream pdfFormInputStream = getClass().getResourceAsStream("AIA_14_201802_20201130.pdf"); InputStream xmlInputStream = getClass().getResourceAsStream("Filled_SB14_data.xml"); FileOutputStream outputStream = new FileOutputStream("Result_SB14.pdf"); Document document = new Document(pdfFormInputStream); Form form = new Form(document); form.importXml(xmlInputStream); document.saveIncrementally(outputStream);
Always the first form element of some specific kind (couldn’t figure out the pattern) is not correctly filled!
So while the XML data is available for e.g. address1 or postcode of every element, it stays empty for the first set (the person “Acker, Tami”).
It is correctly filled for “Dankenschweil, Beverly” and “Barth, Jost”. (We tested switching the data round - it will always fail for the first set.)
As we use this functionality since years for vital business functionality of our customers, a quick fix (or advice, how to adopt the PDF or XML to prevent the issue) would be really important and extremely helpful for us!
Thanks a lot,
The ZIP with the two inputs (pdf template and xml):
Form.importXML.bug.zip (1.2 MB)
The screenshot of the broken result, marking all the fields where data is not correctly imported (mind that some fields like the name are correctly filled!):
Form.importXml.result.png (51.8 KB)