Re: widget woes (input fields)

Jean-Pierre Delange via ntg-context <[email protected]> Wed, 27 May 2026 18:42:53 +0200
Newsgroups gmane.comp.tex.context
Message-ID <[email protected]>
Hi Ursula,

This is consistent with what I observe on Windows 11, with one important 
difference. On my system the radio buttons appear to work correctly on 
screen: Acrobat displays the selected choice properly, and after saving and
reopening the PDF the selected value is still there.

However, the problem appears when printing: the printed output shows 
empty squares instead of the selected radio button. Printing to 
Microsoft Print to PDF gives the same result.

So the issue is not simply “the field never works”. Rather, the PDF 
seems to contain enough information for some viewers to display and 
preserve the interactive state on screen, but not enough robust 
appearance information
for reliable printing.

Your inspection of the PDF structure is therefore very useful: the 
missing or incomplete value information, together with the absence of 
appearance streams, could explain why different PDF viewers behave 
differently, and
why screen display and printed output diverge. The robust solution would 
be for ConTeXt to generate appearance streams (/AP) for the radio button 
widgets.

At the moment, the PDF may contain enough field information for some PDF 
viewers to display the selected value on screen, but not enough explicit 
appearance information for reliable printing.

For printable form fields, each widget should have an appearance 
dictionary describing at least its normal appearances, typically 
something like an “Off” state and one “On” state corresponding to the 
button value. Without
that, a viewer may display the field interactively, but the printed 
output can remain empty.

So the practical conclusion is:

1. the MWE is useful;
2. the issue should probably be reported as a ConTeXt/LMTX backend problem;
3. the expected fix is not merely changing the example syntax, but making
    ConTeXt write proper /AP entries for radio buttons.

Best//JP

Le 27/05/2026 à 10:44, Ulrike Fischer a écrit :
> 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.
>
> 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}
>
>
>
___________________________________________________________________________________
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
___________________________________________________________________________________