1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Interactive forms: make choice widget options inheritable (issue 8094)

Even though the PDF specification does not state that `Opt` fields are
inheritable, in practice there are PDF generators that let annotations
inherit the options from a parent.
This commit is contained in:
Tim van der Meij 2017-02-25 23:34:26 +01:00
parent da08b801a5
commit 8990de8614
No known key found for this signature in database
GPG key ID: 8C3FD2925A5F2762
2 changed files with 32 additions and 1 deletions

View file

@ -845,9 +845,12 @@ var ChoiceWidgetAnnotation = (function ChoiceWidgetAnnotationClosure() {
// the display value. If the array consists of strings, then these
// represent both the export and display value. In this case, we convert
// it to an array of arrays as well for convenience in the display layer.
// Note that the specification does not state that the `Opt` field is
// inheritable, but in practice PDF generators do make annotations
// inherit the options from a parent annotation (issue 8094).
this.data.options = [];
var options = params.dict.get('Opt');
var options = Util.getInheritableProperty(params.dict, 'Opt');
if (isArray(options)) {
var xref = params.xref;
for (var i = 0, ii = options.length; i < ii; i++) {