License license = new License();
license.setLicense("Aspose.Pdf.lic");
Document document = new Document("test.pdf");
document.getForm().setType(FormType.Standard);
document.save("test2.pdf");
exception :
Exception in thread “main” java.lang.NullPointerException
at com.aspose.pdf.internal.p60.z2.(Unknown Source)
at com.aspose.pdf.internal.p60.z4.m1(Unknown Source)
at com.aspose.pdf.internal.p61.z1.m4(Unknown Source)
at com.aspose.pdf.internal.p63.z38.m1(Unknown Source)
at com.aspose.pdf.internal.p63.z3.m1(Unknown Source)
at com.aspose.pdf.internal.p63.z3.m1(Unknown Source)
at com.aspose.pdf.internal.p63.z3.m1(Unknown Source)
at com.aspose.pdf.internal.p63.z38.m1(Unknown Source)
at com.aspose.pdf.z354.m1(Unknown Source)
at com.aspose.pdf.z354.m1(Unknown Source)
at com.aspose.pdf.z388.m1(Unknown Source)
at com.aspose.pdf.z388.m1(Unknown Source)
at com.aspose.pdf.z388.m1(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z17.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z14.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z11.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z14.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z11.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z14.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z11.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z14.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z11.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z14.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z11.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z14.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z11.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z14.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z11.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z14.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z11.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z14.accept(Unknown Source)
at com.aspose.pdf.internal.foundation.rendering.z31.accept(Unknown Source)
at com.aspose.pdf.ApsToPdfConverter.m1(Unknown Source)
at com.aspose.pdf.Form.m1(Unknown Source)
at com.aspose.pdf.Form.setType(Unknown Source)
We have managed to replicate the same issue, while testing the scenario with Aspose.Pdf for Java 17.8. Hence, we have logged an issue against ticket ID PDFJAVA-37075 in our issue tracking system. We will further investigate the reasons behind this issue and keep you posted with the status of its correction. Please be patient and spare us little time.
and also can you confirmed if the file can be filled with xml
com.aspose.pdf.facades.Form form = new com.aspose.pdf.facades.Form();
form.bindPdf("test.pdf");
java.io.FileInputStream xmlInputStream = new FileInputStream("data35.xml");
form.importXml(xmlInputStream);
// form.importXfdf(xmlInputStream); both not work
xmlInputStream.close();
form.save("result.pdf");
form.dispose();
I have tested the scenario with Aspose.Pdf for Java 17.8 and observed that form fields were filling by importing the XML file. For your reference, I have attached a copy of generated output over our end along with the screenshot, showing a field value before/after of the XML import.
In case if you are experiencing any issue at your end, please share some more details by highlighting the differences between input/output files, so that we can test the scenario again in our environment and address it accordingly.
java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
javac 1.8.0_144
Windows 10
We have managed to replicate the same issue in our environment and for the sake of correction, we have logged it under the ticket ID PDFJAVA-37114 in our issue tracking system. We will further investigate the issue and keep you posted with the status of its correction.
I would like to share with you that our product team has started the investigation against earlier logged issue and as soon as we have some definite updates, regarding its resolution, we will update you within this forum thread. Please be patient and spare us little time.