Skip to content

Commit

Permalink
Add a container for widget with their own canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
calixteman committed Jun 15, 2023
1 parent 9af50dc commit 752c373
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/display/annotation_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ class AnnotationElementFactory {
return new PushButtonWidgetAnnotationElement(parameters);
case "Ch":
return new ChoiceWidgetAnnotationElement(parameters);
case "Sig":
return new SignatureWidgetAnnotationElement(parameters);
}
return new WidgetAnnotationElement(parameters);

Expand Down Expand Up @@ -1373,6 +1375,12 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
}
}

class SignatureWidgetAnnotationElement extends WidgetAnnotationElement {
constructor(parameters) {
super(parameters, { isRenderable: !!parameters.data.hasOwnCanvas });
}
}

class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {
constructor(parameters) {
super(parameters, { isRenderable: parameters.renderForms });
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -600,3 +600,4 @@
!issue16500.pdf
!issue16538.pdf
!freetexts.pdf
!issue16553.pdf
Binary file added test/pdfs/issue16553.pdf
Binary file not shown.
8 changes: 8 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7806,5 +7806,13 @@
"id": "53R"
}
}
},
{
"id": "issue16553",
"file": "pdfs/issue16553.pdf",
"md5": "9b67d31ccfd21572b10f77c5449ce97d",
"rounds": 1,
"type": "eq",
"annotations": true
}
]

0 comments on commit 752c373

Please sign in to comment.