@@ -2845,6 +2845,7 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
2845
2845
this . _processRadioButton ( params ) ;
2846
2846
} else if ( this . data . pushButton ) {
2847
2847
this . data . hasOwnCanvas = true ;
2848
+ this . data . noHTML = false ;
2848
2849
this . _processPushButton ( params ) ;
2849
2850
} else {
2850
2851
warn ( "Invalid field flags for button widget annotation" ) ;
@@ -3570,6 +3571,7 @@ class SignatureWidgetAnnotation extends WidgetAnnotation {
3570
3571
// to the main-thread (issue 10347).
3571
3572
this . data . fieldValue = null ;
3572
3573
this . data . hasOwnCanvas = this . data . noRotate ;
3574
+ this . data . noHTML = ! this . data . hasOwnCanvas ;
3573
3575
}
3574
3576
3575
3577
getFieldObject ( ) {
@@ -3591,6 +3593,7 @@ class TextAnnotation extends MarkupAnnotation {
3591
3593
// No rotation for Text (see 12.5.6.4).
3592
3594
this . data . noRotate = true ;
3593
3595
this . data . hasOwnCanvas = this . data . noRotate ;
3596
+ this . data . noHTML = false ;
3594
3597
3595
3598
const { dict } = params ;
3596
3599
this . data . annotationType = AnnotationType . TEXT ;
@@ -3643,6 +3646,11 @@ class PopupAnnotation extends Annotation {
3643
3646
3644
3647
const { dict } = params ;
3645
3648
this . data . annotationType = AnnotationType . POPUP ;
3649
+
3650
+ // A pop-up is never rendered on the main canvas so we must render its HTML
3651
+ // version.
3652
+ this . data . noHTML = false ;
3653
+
3646
3654
if (
3647
3655
this . data . rect [ 0 ] === this . data . rect [ 2 ] ||
3648
3656
this . data . rect [ 1 ] === this . data . rect [ 3 ]
@@ -3712,7 +3720,10 @@ class FreeTextAnnotation extends MarkupAnnotation {
3712
3720
constructor ( params ) {
3713
3721
super ( params ) ;
3714
3722
3715
- this . data . hasOwnCanvas = true ;
3723
+ // It uses its own canvas in order to be hidden if edited.
3724
+ // But if it has the noHTML flag, it means that we don't want to be able
3725
+ // to modify it so we can just draw it on the main canvas.
3726
+ this . data . hasOwnCanvas = ! this . data . noHTML ;
3716
3727
3717
3728
const { evaluatorOptions, xref } = params ;
3718
3729
this . data . annotationType = AnnotationType . FREETEXT ;
@@ -3926,6 +3937,7 @@ class LineAnnotation extends MarkupAnnotation {
3926
3937
const { dict, xref } = params ;
3927
3938
this . data . annotationType = AnnotationType . LINE ;
3928
3939
this . data . hasOwnCanvas = this . data . noRotate ;
3940
+ this . data . noHTML = ! this . data . hasOwnCanvas ;
3929
3941
3930
3942
const lineCoordinates = dict . getArray ( "L" ) ;
3931
3943
this . data . lineCoordinates = Util . normalizeRect ( lineCoordinates ) ;
@@ -3993,6 +4005,7 @@ class SquareAnnotation extends MarkupAnnotation {
3993
4005
const { dict, xref } = params ;
3994
4006
this . data . annotationType = AnnotationType . SQUARE ;
3995
4007
this . data . hasOwnCanvas = this . data . noRotate ;
4008
+ this . data . noHTML = ! this . data . hasOwnCanvas ;
3996
4009
3997
4010
if ( ! this . appearance ) {
3998
4011
// The default stroke color is black.
@@ -4105,6 +4118,7 @@ class PolylineAnnotation extends MarkupAnnotation {
4105
4118
const { dict, xref } = params ;
4106
4119
this . data . annotationType = AnnotationType . POLYLINE ;
4107
4120
this . data . hasOwnCanvas = this . data . noRotate ;
4121
+ this . data . noHTML = ! this . data . hasOwnCanvas ;
4108
4122
this . data . vertices = [ ] ;
4109
4123
4110
4124
if (
@@ -4193,6 +4207,7 @@ class InkAnnotation extends MarkupAnnotation {
4193
4207
super ( params ) ;
4194
4208
4195
4209
this . data . hasOwnCanvas = this . data . noRotate ;
4210
+ this . data . noHTML = ! this . data . hasOwnCanvas ;
4196
4211
4197
4212
const { dict, xref } = params ;
4198
4213
this . data . annotationType = AnnotationType . INK ;
@@ -4531,6 +4546,7 @@ class StampAnnotation extends MarkupAnnotation {
4531
4546
4532
4547
this . data . annotationType = AnnotationType . STAMP ;
4533
4548
this . data . hasOwnCanvas = this . data . noRotate ;
4549
+ this . data . noHTML = ! this . data . hasOwnCanvas ;
4534
4550
}
4535
4551
4536
4552
static async createImage ( bitmap , xref ) {
@@ -4680,6 +4696,7 @@ class FileAttachmentAnnotation extends MarkupAnnotation {
4680
4696
4681
4697
this . data . annotationType = AnnotationType . FILEATTACHMENT ;
4682
4698
this . data . hasOwnCanvas = this . data . noRotate ;
4699
+ this . data . noHTML = ! this . data . hasOwnCanvas ;
4683
4700
this . data . file = file . serializable ;
4684
4701
4685
4702
const name = dict . get ( "Name" ) ;
0 commit comments