Skip to content

Commit

Permalink
Merge pull request #17066 from Snuffleupagus/issue-17064
Browse files Browse the repository at this point in the history
Ensure that readonly TextWidget-annotations are rendered when forms are disabled (issue 17064)
  • Loading branch information
Snuffleupagus authored Oct 3, 2023
2 parents 426209c + f113320 commit 4245d87
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/display/annotation_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,7 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
constructor(parameters) {
const isRenderable =
parameters.renderForms ||
parameters.data.hasOwnCanvas ||
(!parameters.data.hasAppearance && !!parameters.data.fieldValue);
super(parameters, { isRenderable });
}
Expand Down Expand Up @@ -1497,6 +1498,10 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
element.textContent = this.data.fieldValue;
element.style.verticalAlign = "middle";
element.style.display = "table-cell";

if (this.data.hasOwnCanvas) {
element.hidden = true;
}
}

this._setTextStyle(element);
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
!issue7891_bc0.pdf
!issue11242_reduced.pdf
!issue16176.pdf
!issue17064_readonly.pdf
!issue11279.pdf
!issue11362.pdf
!issue13325_reduced.pdf
Expand Down
Binary file added test/pdfs/issue17064_readonly.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3143,6 +3143,13 @@
"link": true,
"type": "eq"
},
{ "id": "issue17064_readonly",
"file": "pdfs/issue17064_readonly.pdf",
"md5": "cb84f8e8301e935a3b9ea8ef320f45bf",
"rounds": 1,
"type": "eq",
"annotations": true
},
{ "id": "issue12714",
"file": "pdfs/issue12714.pdf",
"md5": "f9ee31c74f9e342e95122b0b3bc84fa0",
Expand Down

0 comments on commit 4245d87

Please sign in to comment.