pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruggentaler, JR" <JR.Ruggenta...@experian.com>
Subject Input fields in PDF
Date Wed, 09 Mar 2016 23:23:22 GMT
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

Mime
View raw message