PDF 表单字段单选按钮语法 Latex3 生成
自从我的PDF 库有问题。它包含我所说的 PDF 规范的特殊解释,因此单选按钮在大多数查看器中无法正常工作。然而,标准可以通过多种方式解释,因此问题是:
这是一个有效的单选按钮组吗?
我看到以下几点 - 请分享您的见解:
- 它模仿“RadiosInUnison”行为,而不使用实际的标志(可能通过引用
Opt
数组中的相同索引) - 选项数组仅包含 4 个小部件引用,而不是 6 个
- 选项数组的 0 索引元素的意图似乎是“备用位置” ” 对于DV 或初始 V(或者可能需要
NoToggleToOff
?) - Bår 的编码?
- ...?
这是“代码”(缩写)
51 0 obj
<</DV /0 /FT/Btn /Ff 32768 /Kids[ 55 0 R 58 0 R 61 0 R 73 0 R 77 0 R 81 0 R ] /Opt [ (B) (Bär) (Sieglinde) (Duck) ] /T (A) /V /0 >>
endobj
55 0 obj
<</Type /Annot /AP <</N <</1 36 0 R/Off 39 0 R>>>> /AS /Off /F 0 /Parent 51 0 R /Rect [ 255 387 301 447 ] /Subtype /Widget>>
endobj
58 0 obj
<</Type /Annot /AP <</N <</2 41 0 R /Off 43 0 R>>>> /AS /Off /F 0 /Parent 51 0 R /Rect [ 313 387 348 447 ] /Subtype /Widget>>
endobj
61 0 obj
<</Type /Annot /AP <</N <</3 45 0 R /Off 47 0 R>>>> /AS /Off /F 0 /Parent 51 0 R /Rect [ 360 387 417 447 ] /Subtype /Widget>>
endobj
73 0 obj
<</Type /Annot /AP 72 0 obj<</D <</1 66 0 R/Off 68 0 R>>/N <</1 62 0 R/Off 64 0 R>>>> /AS /Off /F 0 /Parent 51 0 R /Rect [ 272 367 284 379 ] /Subtype /Widget>>
endobj
77 0 obj
<</Type /Annot /AP <</D <</2 66 0 R/Off 68 0 R>>/N <</2 62 0 R /Off 64 0 R>>>> R /AS /Off /F 0 /Parent 51 0 R /Rect [ 325 367 336 379 ] /Subtype /Widget>>
endobj
81 0 obj
<</Type /Annot /AP <</D <</3 66 0 R/Off 68 0 R>>/N <</3 62 0 R/Off 64 0 R>>>> /AS /Off /F 0 /Parent 51 0 R /Rect [ 383 367 395 379 ] /Subtype /Widget>>
endobj
1. 根据 PDF 规范,Opt
数组为:
一个数组,其中包含单选按钮的 Kids 数组中每个小部件注释的一个条目 [...]
2. 并且
当此条目(=
Opt
)存在时,用于表示每个注释的 AP 字典中的开启状态的名称可以使用该注释在 Kids 中的数字位置(从 0 开始)数组 [...]
这基本上意味着索引必须匹配,对吧?
/Kids[55 0 R 58 0 R 61 0 R 73 0 R 77 0 R 81 0 R ]
| | | | | |
/Opt [(B) (Bär) (Sieglinde) (Duck) ? ? ]
3.
对于单选按钮,仅当设置了 RadiosInUnison 标志时才会发生相同的行为(检查多个小部件)。如果不设置,则一次最多设置一个字段中的单选按钮。
=>要达到示例 PDF 中检查两个单选按钮小部件的结果,必须设置 RadiosInUnison 必须 是否存在
其他违规情况? (背景:收集完所有内容后,我会通知 Latex3 人员,希望我们能改进这一点)
I stumbled over the following PDF since my PDF library has problems with it. It contains what I would call a peculiar interpretation of the PDF specification thus the radiobutton is not working correctly in most viewers. However a standard could be interpreted in many ways so the question is:
Is this a valid radiobutton group?
I see the following points - please share your insights:
- It mimics a 'RadiosInUnison' behavior without using the actual flag (probably by referencing the same index in the
Opt
array) - The option array does only contain 4 widget references instead of 6
- The intent of the 0 index element of the option array seems to be a "standby position" for the DV or the initial V (or maybe a
NoToggleToOff
was desired?) - Encoding of Bär?
- ...?
Here is the "code" (shortened)
51 0 obj
<</DV /0 /FT/Btn /Ff 32768 /Kids[ 55 0 R 58 0 R 61 0 R 73 0 R 77 0 R 81 0 R ] /Opt [ (B) (Bär) (Sieglinde) (Duck) ] /T (A) /V /0 >>
endobj
55 0 obj
<</Type /Annot /AP <</N <</1 36 0 R/Off 39 0 R>>>> /AS /Off /F 0 /Parent 51 0 R /Rect [ 255 387 301 447 ] /Subtype /Widget>>
endobj
58 0 obj
<</Type /Annot /AP <</N <</2 41 0 R /Off 43 0 R>>>> /AS /Off /F 0 /Parent 51 0 R /Rect [ 313 387 348 447 ] /Subtype /Widget>>
endobj
61 0 obj
<</Type /Annot /AP <</N <</3 45 0 R /Off 47 0 R>>>> /AS /Off /F 0 /Parent 51 0 R /Rect [ 360 387 417 447 ] /Subtype /Widget>>
endobj
73 0 obj
<</Type /Annot /AP 72 0 obj<</D <</1 66 0 R/Off 68 0 R>>/N <</1 62 0 R/Off 64 0 R>>>> /AS /Off /F 0 /Parent 51 0 R /Rect [ 272 367 284 379 ] /Subtype /Widget>>
endobj
77 0 obj
<</Type /Annot /AP <</D <</2 66 0 R/Off 68 0 R>>/N <</2 62 0 R /Off 64 0 R>>>> R /AS /Off /F 0 /Parent 51 0 R /Rect [ 325 367 336 379 ] /Subtype /Widget>>
endobj
81 0 obj
<</Type /Annot /AP <</D <</3 66 0 R/Off 68 0 R>>/N <</3 62 0 R/Off 64 0 R>>>> /AS /Off /F 0 /Parent 51 0 R /Rect [ 383 367 395 379 ] /Subtype /Widget>>
endobj
1. According to the PDF spec the Opt
array is:
An array containing one entry for each widget annotation in the Kids array of the radio button [...]
2. And also
When this entry (=
Opt
) 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 [...]
Which basically means that the indices must match, right?
/Kids[55 0 R 58 0 R 61 0 R 73 0 R 77 0 R 81 0 R ]
| | | | | |
/Opt [(B) (Bär) (Sieglinde) (Duck) ? ? ]
3.
For radio buttons, the same behaviour (several widgets are checked) shall occur only if the RadiosInUnison flag is set. If it is not set, at most one radio button in a field shall be set at a time.
=> to reach the result in the example PDF that two radiobutton widgets are checked the RadiosInUnison must be set
Any other violations?
(Background: After everything is collected I'll inform the latex3 guys and hopefully we'll get this improved)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Radiosinunison
行为,你需要设置标志Opt
数组中的元素数量也不应该存在小于Kids
数组中的元素数量:这会弄乱您的导出值,如以下查看器所示:
有几种方法可以正确指定测试文档的场景:
或者
Radiosinunison
behavior you need to set the flagOpt
array be smaller than the number of elements in theKids
array:This messes up your export values as shown in the following viewer:
There are several possibilities to correctly specify the scenario of your test document:
OR