Hi
I have created an interactive PDF Form with different controls
radiobutton,checkbox,textbox....
I am able to retrieve data from the all control other than radiobutton using
the below code. Any help regarding the same would be higly appreciated. I have
mentioned the sample code below.
Thanks
Swapna.
AcroFields form = reader.getAcroFields();
HashMap fields = form.getFields();
String fieldName = null;
for (Iterator i = fields.keySet().iterator(); i.hasNext();){
fieldName = (String) i.next();
System.out.println("FieldName****:"+fieldName);
System.out.println("Field Selected*****:"+form.getField(fieldName));
System.out.println("Field Type*****:"+form.getFieldType(fieldName));
}
Radio button is created as stated below:
PdfFormField radio = PdfFormField.createRadioButton(writer,true);
PdfAppearance tpOff = cb.createAppearance(10, 10);
PdfAppearance tpOn = cb.createAppearance(10,10);
tpOff.circle(5,5,4);
tpOff.stroke();
tpOn.circle(5,5,4);
tpOn.stroke();
tpOn.circle(5,5,1);
tpOn.fillStroke();
radio.setFieldName("Test 1");
for(int m=0;m<laQuestionOptions.size();m++){
PdfFormField radioButton = PdfFormField.createEmpty(writer);
radioButton.setValueAsName(laQuestionOptions[m])
radioButton.setAppearanceState("Off");
radioButton.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, "Off", tpOff);
radioButton.setAppearance(PdfAnnotation.APPEARANCE_NORMAL,laQuestionOptions[m],tpOn);
radio.addKid(radioButton);
PdfPCell cell = new PdfPCell();
cell.setCellEvent(new
RadioFormField(writer,questionOptionsVO.getControlLabelText(),radioButton));
radioOptionsTable.addCell(cell);
}
---------------------------------
Get the freedom to save as many mails as you wish. Click here to know how.
-------------------------------------------------------------------------
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
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/