/AP and then /N has the values you're looking for in the keys. Paulo
> -----Original Message----- > From: Eric Lou [mailto:[email protected]] > Sent: Wednesday, July 22, 2009 10:32 AM > To: Post all your questions about iText here > Subject: Re: [iText-questions] radio button positions and > value mapping > > 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 Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.
------------------------------------------------------------------------------
_______________________________________________ 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/
