Dear Aspose Tech i need your help,
I downloaded a new fillable form from the State of Massachusetts,
Am using aspose.pdf for java and tried to iterate thru all input fields, so i can populate them.
However input fields does not exists, i mean the field count is zero. but when i open the empty form by hand the input fields are there and i can enter data into it.
My Environment: aspose.total for java 19.5, win10, eclipse 2019-03, java8.
My code:
public void processDoc() {
com.aspose.pdf.License license = new com.aspose.pdf.License();
// Call setLicense method to set license
try {
license.setLicense("Aspose.Total.Java.lic");
} catch (Exception e) {
e.printStackTrace();
}
// Open a document
String docIn = "Request-for-judgmemnt.pdf";
pdfDocument = new Document(docIn.trim());
//Get All input fields of the PDF document
fields = pdfDocument.getForm().getFields();
System.out.println("Field Count: " + fields.length);
//??? this code never execute because fields.length is zero ????
for (int i = 0; i < fields.length; i++) {
System.out.println("Form field: " + fields[i].getFullName() + " " +
"value: " + fields[i].getValue());
}
// Save the updated document
outName = "out_" + docIn;
pdfDocument.save(outName.trim());
}
Request-for-judgmemnt.pdf (121.7 KB)