How do I list and set/update the input fields in the attached PDF document 
using PDFBox? In the code snippet below form is null. If my PDF does not 
contain a PDAcroForm how do I access the input fields?


try {

pdf = PDDocument.load(new File(fileName));

PDAcroForm form = pdf.getDocumentCatalog().getAcroForm();

if (form == null) {

System.err.println("Error: This PDF does not contain a form.");

} else {

for(PDField pdField : form.getFields()){

    System.out.println(pdField.getValueAsString());

}

}

} finally {

close(fdf);

close(pdf);

}


JR
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to