I have a PDF form which have 23 fillable fields,
when i iterate thru all fields i get 23 count and i can see every field name and empty values of these fields, this works OK.
then I enter data by hand and save the file under a different name.
then load the form and try to iterate thru all fields to get the values and names… but I am getting always 0 for fields.lenght
Please help. (my environment, Win10, Eclipet 2019, aspose.total for java)
---------------------------my code ------------------------------------------------------------------------
static Field[] fields = null;
com.aspose.pdf.License license = new com.aspose.pdf.License();
try {
license.setLicense(“Aspose.Total.Java.lic”);
} catch (Exception e) {
e.printStackTrace();
}
// Open a document
String docIn = "C:\temp\myDoc.pdf";
pdfDocument = new Document(docIn.trim());
//Get All field of the input PDF document
fields = pdfDocument.getForm().getFields();
//Note: the code below never runs because fields.length is always zero
for (int i = 0; i < fields.length; i++) {
System.out.println("Form field: " + fields[i].getFullName() + "\n" +
"GetClass: " + fields[i].getClass().getTypeName() + "\n" +
"GetClass: " + fields[i].getClass().getSimpleName() + "\n" +
"value: " + fields[i].getValue());
}
Thank you very much in advance.
Marc