Annotation - Some checkboxes have an empty N dictionary

- it aims to fix #14021;
  - the N dict is empty here so just create a default one;
  - it implies that the checked checkbox has no appearance so create a default one too in order to print it;
  - in the pdf in the issue, a checked box is not printed because it has no default appearance so we need to guess its appearance from its state.
This commit is contained in:
Calixte Denizet 2021-09-17 15:31:22 +02:00
parent cc110b8542
commit c0e9108d00
4 changed files with 162 additions and 47 deletions

View file

@ -1013,10 +1013,7 @@ class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {
const data = this.data;
const id = data.id;
let value = storage.getValue(id, {
value:
data.fieldValue &&
((data.exportValue && data.exportValue === data.fieldValue) ||
(!data.exportValue && data.fieldValue !== "Off")),
value: data.exportValue === data.fieldValue,
}).value;
if (typeof value === "string") {
// The value has been changed through js and set in annotationStorage.