Hi Ulrike,

On Wed, May 27, 2026 at 10:44 (+0200), Ulrike Fischer wrote:

> Am Mon, 25 May 2026 22:30:42 +0200 schrieb Jean-Pierre Delange via
> ntg-context:

>> Jim,

>> I made a few controlled tests with a minimal ConTeXt example containing 
>> only radio fields.

>> Results:

>>   * the PDF compiles correctly;

>>   * the radio widgets are present;

>>   * Acrobat displays them correctly;

> I compiled that example with a current context in texlive 2026
> (ConTeXt  ver: 2026.04.27) on window 11 and the field doesn't work
> for me.  Adobe refuses to select a button, and in foxit all buttons
> are selected together.

One of the reasons I had an extra button in my original example is because
I discovered that without selecting a default "chosen" button, strange
things (like all buttons being chosen, or two buttons being chosen)
happened.  Of course that is a work-around, not a desired requirement.

I have a prehistoric Acroread 9.5.5 which happily selects exactly one
button in my example code.  And that code seemed to work with various
versions of windows and Adobe readers, according to people I asked.  Things
were mostly good, except for print outs not showing the buttons.

> I looked into the PDF (after using \setupbackend[level=0])
> and one can see that field is missing the values, only /Aaa is
> mentioned, but no /Bbb and /Ccc:

> 3 0 obj
> << /FT /Btn /Ff 33603584 /Kids 2 0 R /T (choice) /V /Aaa >>
> endobj
> 4 0 obj
> << /Type /Annot /BS << /S /I /W 1 >> /F 4 /H /N /Parent 3 0 R
> /Subtype /Widget /Rect [ 97.44189 677.658381 108.408258 688.624749 ]

> endobj
> 5 0 obj
> << /Type /Annot /BS << /S /I /W 1 >> /F 4 /H /N /Parent 3 0 R
> /Subtype /Widget /Rect [ 149.454104 677.658381 160.420472 688.624749
> ] >>
> endobj
> 6 0 obj
> << /Type /Annot /BS << /S /I /W 1 >> /F 4 /H /N /Parent 3 0 R
> /Subtype /Widget /Rect [ 198.957112 677.658381 209.92348 688.624749
> ] >>
> endobj

> There are also no appearances streams but this is only required in
> PDF 2.0. 

> Wenn I do something similar with LaTeX then the field contains an
> /Opt array:

> << /T (choice) /FT /Btn /Opt 5 0 R /V /0 /DV /0 /Kids 7 0 R /Ff
> 33587200  >>

> This array references the values:

> 5 0 obj
> [ (\376\377\000A\000a\000a) (\376\377\000B\000b\000b)
> (\376\377\000C\000c\000c) ]
> endobj

> And the widgets reference the array values by index (we are using
> appearance streams, so the setup is more complicated).

> The radio field correctly prints for me. 

> \RequirePackage{pdfmanagement}
> \SetKeys[document/metadata]{uncompress}
> \documentclass{article}
> \usepackage{l3pdffield}

> \begin{document}

> \ExplSyntaxOn
> \pdffield_setup:n{preset-radiobutton={setannotflags=Print}} %make
> field printable

> \pdffield_radio:n
>  {
> group = choice, 
> value = Aaa, 
>  }\quad
> \pdffield_radio:n
>  {
> group = choice, 
> value = Bbb, 
>  }\quad 
> \pdffield_radio:n
>  {
> group = choice, 
> value = Ccc, 
>  }
> \ExplSyntaxOff

> \end{document}

Thanks very much for the analysis and the example.  (Too bad the example
doesn't work with evince, but I can imagine that is an evince issue.)

Your example works well with my ancient Acroread, and its printout clearly
displays the selected button.

Cheers.
                                Jim
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to