1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

[Annotations] Add support for printing/saving choice list with multiple selections

- it aims to fix issue #12189.
This commit is contained in:
Calixte Denizet 2022-03-26 22:45:50 +01:00
parent 0dd6bc9a85
commit ad3fb71a02
7 changed files with 355 additions and 33 deletions

View file

@ -143,7 +143,11 @@ function writeXFADataForAcroform(str, newRefs) {
}
const node = xml.documentElement.searchNode(parseXFAPath(path), 0);
if (node) {
node.childNodes = [new SimpleDOMNode("#text", value)];
if (Array.isArray(value)) {
node.childNodes = value.map(val => new SimpleDOMNode("value", val));
} else {
node.childNodes = [new SimpleDOMNode("#text", value)];
}
} else {
warn(`Node not found for path: ${path}`);
}