Using Adobe form I have created a complex form with almost 50 tags. All the Fields are editable and can be filled in PDF file
While reading form using this snippet only able to read 5 to 6 fields which is strange. I have tried to read the data by providing custom field name which also didn’t work please recommend.
We are evaluating the Aspose PDF licence.
####code - 1( read all forms in the field) which I only get 5 to 6 fields which are in random order
Document pdfDocument = new Document("Form.pdf");
Form forms = pdfDocument.getForm();
//TextBoxField textBoxField = (TextBoxField) pdfDocument.getForm().get_Item("CustomTextBox");
TextBoxField textBoxField = (TextBoxField) pdfDocument.getForm().get("CustomTextBox");
// Get the field name
System.out.printf("PartialName :-" + textBoxField.getPartialName());
System.out.println("\n");
// Get the field value
System.out.printf("Value :-" + textBoxField.getValue());*/
#####code-2(read by providing custom field)
Field[] fields = pdfDocument.getForm().getFields();
for (int i = 0; i < fields.length; i++) {
System.out.println("Form field: " + fields[i].getFullName());
System.out.println("Form field: " + fields[i].getValue());
}