简体   繁体   中英

Get value of radiobutton group

I use itextsharp lib in my asp.net MVC project and have few radiobutton groups in pdf file. This file was created in Adobe Acrobat software as editable form. When I display name and type ( Get specific types from AcroField ) of all editable fields, unfortunately get only type of radiobutton group as "RADIOBUTTON", but subradiobutton doesn't show.

How Can I display it?

Thank you in advance for your answer.

There is no such thing as a "subradiobutton" type. Please check ISO-32000-1 if you don't believe me.

The hierarchy of the fields is established through the names of the fields. See my answer to the question iTextSharp RenameField bug? The dots in the field names refer to a hierarchy.

For instance: if you have a field named person ; this field can have children such as

  • name , and
  • address .

The fully qualified names of these child fields would then be:

  • person.name , and
  • person.address .

Address can in turn have child fields, such as:

  • street ,
  • city , and
  • country .

This results in fully qualified names such as:

  • person.address.street ,
  • person.address.city , and
  • person.address.country .

If you are looking for "subradiobuttons", you should look at the fully qualified names of the fields, and examine how many dots ( . ) they have.

You are probably also confused about the difference between a radio field and a radio button. A radio field is a field that has a specific name, eg language . The value of that language can be chosen by clicking one of many radio buttons. These buttons are widget annotations with two appearance states (selected and not-selected). If you want to know the possible values of a radio field, you need to get those appearance states.

You've already seen the method that is needed to do this in How to get specific types from AcroFields? Like PushButtonField, RadioCheckField, etc :

form.GetAppearanceStates("language");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM