Hi,

Probably because they are indeed checkboxes. Seems there is missing
implementation of PdfRadioButton there is only this "// TODO: Dominiks
PdfRadioButton". To add radion button you need to add PdfButton and call
"SetFieldFlag(ePdfButton_Radio, true);". Radio buttons are grouped by using
same parent like this:

30 0 obj

<</FT/Btn

/P 1 0 R

/Kids[29 0 R 31 0 R 32 0 R ]

/T(Radio)

/Ff 49152

/V /Off

/DV /Off

>>

endobj


29 0 obj

<</Type/Annot/Subtype/Widget/F 4

/Rect[244.1 371.1 253.4 380]

/FT/Btn

/P 1 0 R

/Parent 30 0 R

/DR<</Font<</ZaDi 15 0 R>>>>

/DA(0 0 0 rg /ZaDi 0 Tf)

/MK<</CA(l)>>

/AP<<

/N<< /Off 77 0 R /1 78 0 R>>

>>

/AS /Off

>>

endobj


31 0 obj

<</Type/Annot/Subtype/Widget/F 4

/Rect[244.1 350.3 253.4 359.2]

/FT/Btn

/P 1 0 R

/Parent 30 0 R

/DR<</Font<</ZaDi 15 0 R>>>>

/DA(0 0 0 rg /ZaDi 0 Tf)

/MK<</CA(l)>>

/AP<<

/N<< /Off 79 0 R /2 80 0 R>>

>>

/AS /Off

>>

endobj


32 0 obj

<</Type/Annot/Subtype/Widget/F 4

/Rect[244.1 329.6 253.4 338.5]

/FT/Btn

/P 1 0 R

/Parent 30 0 R

/DR<</Font<</ZaDi 15 0 R>>>>

/DA(0 0 0 rg /ZaDi 0 Tf)

/MK<</CA(l)>>

/AP<<

/N<< /3 81 0 R /Off 82 0 R>>

>>

/AS /Off

>>

endobj

I have feeling that there is no direct support for creating nested pdf
fields which are required for radio grouping so probably one must setup
Kids and Parent manually.

On Mon, Mar 18, 2019 at 1:30 AM stefa...@t-online.de <stefa...@t-online.de>
wrote:

> Hello all,
>
>
>
> I start using PoDoFo 0.9.6 and overall I'm really happy with it - Thanks
> for your efforts!
>
>
>
> So far I could not get Radio Buttons in AcroForms to work.
>
>
>
> - Are radio buttons supported already?
>
> - How to I retrieve information about the grouping of particular radio
> buttons?
>
>
>
> Just my little code snippet:
>
>
>
>             [...]
>             PdfField curField = curPage->GetField(i);
>
>
>
>             switch (curField.GetType())
>
>             {
>
>                 case ePdfField_PushButton:
>
>                 case ePdfField_RadioButton:
>
>                 case ePdfField_CheckBox:
>
>                 {
>
>                     PdfButton   bt = static_cast<PdfButton>(curField);
>
>
>
>                     if (bt.IsCheckBox())
>
>                         logMsg += "Type: Checkbox\n";
>
>                     else if (bt.IsRadioButton())
>
>                         logMsg += "Type: Radiobutton\n";
>
>                     else if (bt.IsPushButton())
>
>                         logMsg += "Type: Pushbutton\n";
>
>                 }; break;
>
>
>
> With PoDoFo 0.9.6 and this code all the radio buttons in my PDF document
> are reported as Checkbox. Is this known behavior?
>
>
>
> Thanks,
>
> Stefan
> 
> _______________________________________________
> Podofo-users mailing list
> Podofo-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/podofo-users
>
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to