Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] How to Uncheck Radio Button

wang yun

2005-08-13

Replies:

Dear Paulo,

I created a Check box and it is OK for me to uncheck
the check field. But, I want to also uncheck the radio
button, i have tried:

PdfFormField top = bt.getRadioGroup(false, false);
PdfFormField top = bt.getRadioGroup(true, false);
PdfFormField top = bt.getRadioGroup(false, true);
PdfFormField top = bt.getRadioGroup(true, true);

But, I cannot uncheck the radio button

Please give me help.

yun


here is the code:

Document document = new Document(PageSize.A4, 50, 50,
50, 50);
PdfWriter writer = PdfWriter.getInstance(document,
new FileOutputStream("output.pdf"));
document.open();
PdfContentByte cb = writer.getDirectContent();

RadioCheckField bt = new RadioCheckField(writer, new
Rectangle(100, 700, 200, 750), "radio", "v1");
bt.setCheckType(RadioCheckField.TYPE_CIRCLE);
bt.setBackgroundColor(Color.cyan);
bt.setBorderStyle(PdfBorderDictionary.STYLE_SOLID);
bt.setBorderColor(Color.red);
bt.setTextColor(Color.yellow);
bt.setBorderWidth(BaseField.BORDER_WIDTH_THICK);
bt.setChecked(false);
PdfFormField f1 = bt.getRadioField();

PdfFormField top = bt.getRadioGroup(true, false);

top.addKid(f1);
writer.addAnnotation(top);

document.close();




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.