pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "twopals@juno.com" <twop...@juno.com>
Subject Populating single value radio buttons causes error
Date Fri, 24 Oct 2014 19:43:05 GMT
 Question regarding populating fields with PDFbox (specifically a push button field)is there
an issue/bug populating a single value push button field with PDFbox?  I have a formthat has
fields that are push buttons (single option radio button)my code updates the text fields and
check boxes on the form, however the singlevalue radio type buttons it encounters an error.
 The field has a default "on value" for exampleof "Y", I try to populate that field with a
"Y" using field.setValue(string) and I get an error. ERROR assigning value to field: java.lang.NullPointerException
is there a alternate way to handle these type of fields?  PDDocumentCatalog docCatalog =pd.getDocumentCatalog();PDAcroForm
acroForm = docCatalog.getAcroForm();System.out.println("Try to set field: " + flds[1]);PDField
field = acroForm.getField(flds[1]);if (field != null) { System.out.println(" has field, now
update it");try {field.setValue(flds[2]);System.out.println(" set field: " + flds[1] + " to
value: " + flds[2]);}catch(Exception e) {System.out.println(" ERROR assigning value to field");}
}else {System.out.println(" *No field found with name:" + flds[1]);System.err.println(" *No
field found with name:" + flds[1]);}}

____________________________________________________________
Fast, Secure, NetZero 4G Mobile Broadband. Try it.
http://www.netzero.net/?refcd=NZINTISP0512T4GOUT2

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message