Posted 3 May 2023, 6:02 am EST
Hello,
As per the developers, the widgets in this pdf do not have a Name property.
To get the export value you can use the following code:
string exportValue1 = (doc.AcroForm.Fields[10] as RadioButtonField).GetCheckedAppearanceStreamName(doc.AcroForm.Fields[10].Widgets[0]);
string exportValue2 = (doc.AcroForm.Fields[10] as RadioButtonField).GetCheckedAppearanceStreamName(doc.AcroForm.Fields[10].Widgets[1]);
Console.WriteLine(exportValue1);
Console.WriteLine(exportValue2);
The last radio button, the ‘RadioChoice1AndChoice2’ shown by the viewer is the name of the radio button field. Both widgets associated with that field do not have any names, so null is correctly returned.
The ‘Export Value’ in the viewer’s UI should more correctly be called ‘Choice value’, again we will change the label in the next hotfix. This is what the value of the field would be when the corresponding widget is clicked. Either way, it is not the name of the widget. What the viewer shows is correct.
Regards,
Prabhat Sharma.