Thanks for reply,
actually, i've tried this way with following code:
Item item = form.getFieldItem(key);
for(int ii =0;ii<item.size();ii++){
PdfDictionary dict = item.getMerged(ii);
Object[] dictKeys= dict.getKeys().toArray();
sb.append("==============================================================").append("\n");
sb.append(key+":").append("\n");
for(int j =0;j<dictKeys.length;j++){
sb.append((PdfName)dictKeys[j] + " : " +
dict.get((PdfName)dictKeys[j])).append("\n");
}
sb.append("==============================================================").append("\n");
}
and get the follow result:
==============================================================
Radio Button1:
/Type : /Annot
/P : 8 0 R
/AP : Dictionary
/F : 4
/AS : /Off
/Subtype : /Widget
/Fields : [22 0 R, 30 0 R, 55 0 R, 74 0 R, 181 0 R]
/Parent : 181 0 R
/T : Radio Button1
/BS : Dictionary
/Ff : 49152
/Rect : [232.728, 742.0, 247.728, 757.909]
/Kids : [169 0 R, 175 0 R, 191 0 R]
/DR : Dictionary
/DA : /ZaDb 0 Tf 0 g
/FT : /Btn
/MK : Dictionary
==============================================================
==============================================================
Radio Button1:
/Type : /Annot
/P : 8 0 R
/AP : Dictionary
/F : 4
/AS : /Off
/Subtype : /Widget
/Fields : [22 0 R, 30 0 R, 55 0 R, 74 0 R, 181 0 R]
/Parent : 181 0 R
/T : Radio Button1
/BS : Dictionary
/Ff : 49152
/Rect : [231.818, 697.909, 245.455, 714.727]
/Kids : [169 0 R, 175 0 R, 191 0 R]
/DR : Dictionary
/FT : /Btn
/MK : Dictionary
/DA : /ZaDb 0 Tf 0 g
==============================================================
==============================================================
Radio Button1:
/Type : /Annot
/P : 8 0 R
/AP : Dictionary
/F : 4
/AS : /Off
/Subtype : /Widget
/Fields : [22 0 R, 30 0 R, 55 0 R, 74 0 R, 181 0 R]
/Parent : 181 0 R
/T : Radio Button1
/BS : Dictionary
/Ff : 49152
/Rect : [230.455, 720.636, 247.728, 737.0]
/Kids : [169 0 R, 175 0 R, 191 0 R]
/DR : Dictionary
/FT : /Btn
/MK : Dictionary
/DA : /ZaDb 0 Tf 0 g
==============================================================
i have no idea where the value is, suppose there are 1,2 and 3 for those 3
radio buttons.
please advice.
thanks.
2009/7/22 1T3XT info <[email protected]>
> Eric Lou wrote:
> > Hi all,
> >
> > refer to the book, we can get all possible values for radio button group
> > with the field name, like:
> > String[] states = form.getAppearanceStates(acroFieldName);
> >
> > and also, we can know the positions for all radio buttons with the field
> > name, like:
> > float[] pos= form.getFieldPositions(acroFieldName);
> >
> > pos[0]~pos[4] is the 1st radio button,
> > pos[5]~pos[9] is the 2nd radio button...etc
> >
> > but in fact, it seems there are no relationship between the positions
> > group and the values
> > that means i can get all the positions and all values for a radio group,
> > but i cannot know which value is for which position radio button.
> > and the values and positions might not in the same sequence.
> >
> > am I mssing anything?
> > or i went the wrong way?
>
> getFieldPositions is just a helper method.
> If you want the full information, use getMerged()
> as was done in my previous answer.
>
> Note that getMerged() is new.
> In the terminology of the book, you'd need to iterate
> of item.merged as is done on page 508.
>
> The book example is adapted to the newer API here:
> http://1t3xt.be/?X042
> --
> This answer is provided by 1T3XT BVBA
> http://www.1t3xt.com/ - http://www.1t3xt.info
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.1t3xt.com/docs/book.php
> Check the site with examples before you ask questions:
> http://www.1t3xt.info/examples/
> You can also search the keywords list:
> http://1t3xt.info/tutorials/keywords/
>
------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/