I have a proper pdf document with RadioButtons and TextFields inside. I read
this document and extract all AcroFilds. After that i put same data to this
AcroFields and stored document in a file. My problem is: all Text Fields are
fill in properly but i do not know how put (eg.) 'X' to RadioButton. This
RadioButton has four options. I use this code to put same data in to
AcroFields:
public void putDataToFields(String file_name) {
PdfReader reader = null;
HashMap fields = null;
try {
reader = new PdfReader(acro_in_path + file_name);
AcroFields form = reader.getAcroFields();
fields = form.getFields();
PdfStamper stamper = new PdfStamper(reader, new
FileOutputStream(path + "out_" +file_name));
form = stamper.getAcroFields();
String key;
for (Iterator i = fields.keySet().iterator(); i.hasNext();) {
key = (String) i.next();
if ("radioButton_name".equalsIgnoreCase(key)) {
//this is the place where i want to mark one option
for radio button
}
else form.setField(key, "Some text");
}
stamper.setFormFlattening(true);
stamper.close();
} catch (IOException e) {
e.printStackTrace();
} catch (DocumentException e) {
e.printStackTrace();
}
}
I'd like to mark for egzample second option. Could someone halp me ?
--
View this message in context:
http://www.nabble.com/Problem-with-AcroFields-and-RadioButton-tp17272477p17272477.html
Sent from the iText - General mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar