Kenneth
Kenneth

Reputation: 11

Java - Reading RadioButton default value

I create a pdf form with iText java containing a radio group (PdfFormField.createRadioButton) with a default button selected (checked). I open the pdf (new PdfReader) and examine the fields. The radiobutton field value is empty. I open the pdf with acrobat, click the already checked radiobutton and save the pdf. When I reopen the pdf to examine the field values, the radiobutton value is now present. What am I leaving out when I create the original pdf? Thanks, Kenneth

Upvotes: 1

Views: 471

Answers (1)

Kenneth
Kenneth

Reputation: 11

Added a call to "radio_field_name.setValueAsName("SomeRadioValue");". Now I can retrieve default value from the PDF. Thanks

Upvotes: 0

Related Questions