Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required non "Off" appearance for checkbox form fields? #510

Open
Lonzak opened this issue Jan 6, 2025 · 2 comments
Open

Required non "Off" appearance for checkbox form fields? #510

Lonzak opened this issue Jan 6, 2025 · 2 comments
Labels
question Further information is requested

Comments

@Lonzak
Copy link

Lonzak commented Jan 6, 2025

Until now I had the following understanding of a checkbox form field:

A checkbox must have at least one (non-off) appearance defined and if there is a second optional "off" appearance it must be stored under the name "Off". Now I got the following PDF with a checkbox like this:

129 0 obj
<<
/Type /Annot /Subtype /Widget /FT /Btn
/AP 531 0 R
/AS /Off /V /Off /DV /Off
/F 4 /Ff 0
/H /P
/MK 530 0 R /P 20 0 R /Rect [ 504 497 513 506 ] /T (checkbox1) /TU (checkbox1)
>>
endobj


531 0 obj
<<
/N 834 0 R
>>
endobj

834 0 obj
<<
/Off 1036 0 R
>>
endobj

It fulfills the following paragraph of the spec:

The appearance for the off state is optional but, if present, shall be stored in the appearance dictionary under the name Off.

And it theoretically also fulfills the PDF 2.0 definition for the AP key (seems to have been changed from optional to required):

Every annotation (including those whose Subtype value is Widget, as used for form fields), [...], shall have at least one appearance dictionary.

Sure, the checkbox above has one appearance dictionary defined .... which is the optional "Off". However in my understanding this was not meant by the spec. If my understanding is wrong what should a compliant reader do when such a checkbox is checked? Create a new on-appearance? But what should it be called then (On, Yes, ...)? And how should it look like (cross, checkmark, etc).

So how does the community sees this?

@Lonzak Lonzak added the bug Something isn't correct label Jan 6, 2025
@petervwyatt
Copy link
Member

And it theoretically also fulfills the PDF 2.0 definition for the AP key (seems to have been changed from optional to required)

Correct. PDF 2.0 now mandates AP appearance streams (like PDF/A) to avoid implementation dependency when missing.

@petervwyatt petervwyatt added question Further information is requested and removed bug Something isn't correct labels Jan 7, 2025
@petervwyatt petervwyatt added this to the Annotation-related milestone Jan 7, 2025
@Lonzak
Copy link
Author

Lonzak commented Jan 7, 2025

Correct. PDF 2.0 now mandates AP appearance streams (like PDF/A) to avoid implementation dependency when missing.

Interesting. I didn't see that appearance streams are necessary. But either way the above mentioned checkbox also doesn't have an appearance stream... (And it is a PDF 1.4 document).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants