Skip to content

Commit 170871a

Browse files
committed
Prevent rendering TextWidgetAnnotations in both the core/display layer (issue 7643)
1 parent f062695 commit 170871a

File tree

5 files changed

+58
-2
lines changed

5 files changed

+58
-2
lines changed

src/display/annotation_layer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,9 @@ var TextAnnotationElement = (function TextAnnotationElementClosure() {
401401
*/
402402
var WidgetAnnotationElement = (function WidgetAnnotationElementClosure() {
403403
function WidgetAnnotationElement(parameters) {
404-
AnnotationElement.call(this, parameters, true);
404+
var isRenderable = parameters.renderInteractiveForms ||
405+
(!parameters.data.hasAppearance && !!parameters.data.fieldValue);
406+
AnnotationElement.call(this, parameters, isRenderable);
405407
}
406408

407409
Util.inherit(WidgetAnnotationElement, AnnotationElement, {

test/pdfs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@
204204
!bug946506.pdf
205205
!issue3885.pdf
206206
!bug859204.pdf
207+
!annotation-tx.pdf
208+
!annotation-tx2.pdf
209+
!annotation-tx3.pdf
207210
!coons-allflags-withfunction.pdf
208211
!tensor-allflags-withfunction.pdf
209212
!issue4246.pdf

test/pdfs/annotation-tx2.pdf

20.8 KB
Binary file not shown.

test/pdfs/annotation-tx3.pdf

30.9 KB
Binary file not shown.

test/test_manifest.json

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,14 @@
732732
"rounds": 1,
733733
"type": "load"
734734
},
735+
{ "id": "f1040-annotations",
736+
"file": "pdfs/f1040.pdf",
737+
"md5": "7323b50c6d28d959b8b4b92c469b2469",
738+
"link": true,
739+
"rounds": 1,
740+
"type": "eq",
741+
"annotations": true
742+
},
735743
{ "id": "f1040-forms",
736744
"file": "pdfs/f1040.pdf",
737745
"md5": "7323b50c6d28d959b8b4b92c469b2469",
@@ -2519,7 +2527,43 @@
25192527
"rounds": 1,
25202528
"type": "eq",
25212529
"annotations": true,
2522-
"about": "Text widget annotation witout appearance streams."
2530+
"about": "Text widget annotation without appearance streams."
2531+
},
2532+
{ "id": "annotation-tx-forms",
2533+
"file": "pdfs/annotation-tx.pdf",
2534+
"md5": "56321ea830be9c4f8437ca17ac535b2d",
2535+
"rounds": 1,
2536+
"type": "eq",
2537+
"forms": true,
2538+
"about": "Text widget annotation without appearance streams."
2539+
},
2540+
{ "id": "annotation-tx2-annotations",
2541+
"file": "pdfs/annotation-tx2.pdf",
2542+
"md5": "b7a32a751895d394fc07bb6ddb40c420",
2543+
"rounds": 1,
2544+
"type": "eq",
2545+
"annotations": true
2546+
},
2547+
{ "id": "annotation-tx2-forms",
2548+
"file": "pdfs/annotation-tx2.pdf",
2549+
"md5": "b7a32a751895d394fc07bb6ddb40c420",
2550+
"rounds": 1,
2551+
"type": "eq",
2552+
"forms": true
2553+
},
2554+
{ "id": "annotation-tx3-annotations",
2555+
"file": "pdfs/annotation-tx3.pdf",
2556+
"md5": "3aec45c6465ca4959c25df17c4356a1c",
2557+
"rounds": 1,
2558+
"type": "eq",
2559+
"annotations": true
2560+
},
2561+
{ "id": "annotation-tx3-forms",
2562+
"file": "pdfs/annotation-tx3.pdf",
2563+
"md5": "3aec45c6465ca4959c25df17c4356a1c",
2564+
"rounds": 1,
2565+
"type": "eq",
2566+
"forms": true
25232567
},
25242568
{ "id": "gesamt",
25252569
"file": "pdfs/gesamt.pdf",
@@ -3151,6 +3195,13 @@
31513195
"type": "eq",
31523196
"annotations": true
31533197
},
3198+
{ "id": "annotation-text-widget-annotations",
3199+
"file": "pdfs/annotation-text-widget.pdf",
3200+
"md5": "cc9672539ad5b837152a9c6961e5f106",
3201+
"rounds": 1,
3202+
"type": "eq",
3203+
"annotations": true
3204+
},
31543205
{ "id": "annotation-text-widget-forms",
31553206
"file": "pdfs/annotation-text-widget.pdf",
31563207
"md5": "cc9672539ad5b837152a9c6961e5f106",

0 commit comments

Comments
 (0)