itext7 - change background color of checked radio button

Viewed 57

I'm using itext7 plugin in Unity (C#) to compile an interactive PDF. My customer want to highlight the fields that are compiled, and I have not problems to do this with text fields using:

PdfDocument pdf = new PdfDocument(new PdfReader(src), new PdfWriter(dest));
Color bg = new DeviceRgb(135, 215, 238);
PdfAcroForm form = PdfAcroForm.GetAcroForm(pdf, false);
Dictionary<String, PdfFormField> fields = form.GetFormFields();
PdfFormField toSet;
fields.TryGetValue("nameofthefield", out toSet);

toSet.SetValue("texttowrite");
toSet.SetBackgroundColor(bg);

But with radio buttons if I do the same thing I color all the radio buttons, not only the checked one. I cannot find a way to retrieve the single value and add the background color to it. Anyone can help me??

I

0 Answers
Related