pdf-issues icon indicating copy to clipboard operation
pdf-issues copied to clipboard

Radio button form field and Opt array

Open Lonzak opened this issue 3 years ago • 1 comments

I would like to ask and clarify the radio button behavior in combination with the /Opt array. It is defined as:

An array containing one entry for each widget annotation in the Kids array of the radio button or check box field. Each entry shall be a text string representing the on state of the corresponding widget annotation.

As I understand "one entry for each widget annotation" means that the indices are mapped between Kids and Opt arrays. Is that correct?

4 0 obj
<</FT/Btn/Ff 49152
/Kids[16 0 R 21 0 R 22 0 R]
       |       |       |   
/Opt[(Yes)   (No)  (Maybe)]       
/T(Decision)>>
endobj

So the corresponding appearance is defined like this:

16 0 obj
<</AP<</N<</Yes 17 0 R/Off 18 0 R>>>>/AS/Off/Parent 4 0 R/Subtype/Widget/Type/Annot [...]>>
endobj

My second question is: What if the appearance is defined as /N<</SomethingElseThanYesOrIndex 17 0 R Who wins? Meaning what should be written into the /V and /AS values? The entry of the Opt array (=Yes) or the name of the AP dictionary in the widget (=SomethingElseThanYes )?

Additionally the standard defines:

When this entry is present, the names used to represent the on state in the AP dictionary of each annotation may use numerical position (starting with 0) of the annotation in the Kids array, encoded as a name object (for example: /0, /1). This allows distinguishing between the annotations even if two or more of them have the same value in the Opt array.

This means the name of the appearance could also be /0 (instead of /Yes)

16 0 obj
<</AP<</N<</0 17 0 R/Off 18 0 R>>>>/AS/Off/Parent 4 0 R/Subtype/Widget/Type/Annot [...]>>
endobj

However in the following case:

4 0 obj
<</FT/Btn/Ff 49152
/Kids[16 0 R 21 0 R 22 0 R 23 0 R 24 0 R 29 0 R]
       |       |       |     |     |      |
/Opt[(Yes)   (No)  (Maybe) (Yes)  (1)    (1)]       
/T(Decision)>>
endobj

The "may use" of the standard turns to "must use" in my opinion. Otherwise how can the different yeses be differentiated? Maybe to add some clarifications regarding those two issues would clarify this (e.g.):

If an Opt array is used its values take precedence over the names defined in the widget AP dictionaries.

and

If two or more annotations have the same value in the Opt array, using numerical positioning is required.

Lonzak avatar Nov 03 '22 15:11 Lonzak

@lrosenthol - could you please propose improved wording/clarifications for this and related errata?

petervwyatt avatar Apr 27 '24 02:04 petervwyatt