@@ -705,6 +705,11 @@ class Annotation {
705
705
this . data . pageIndex = params . pageIndex ;
706
706
}
707
707
708
+ const it = dict . get ( "IT" ) ;
709
+ if ( it instanceof Name ) {
710
+ this . data . it = it . name ;
711
+ }
712
+
708
713
this . _isOffscreenCanvasSupported =
709
714
params . evaluatorOptions . isOffscreenCanvasSupported ;
710
715
this . _fallbackFontDict = null ;
@@ -1377,6 +1382,7 @@ class Annotation {
1377
1382
class AnnotationBorderStyle {
1378
1383
constructor ( ) {
1379
1384
this . width = 1 ;
1385
+ this . rawWidth = 1 ;
1380
1386
this . style = AnnotationBorderStyleType . SOLID ;
1381
1387
this . dashArray = [ 3 ] ;
1382
1388
this . horizontalCornerRadius = 0 ;
@@ -1407,6 +1413,7 @@ class AnnotationBorderStyle {
1407
1413
}
1408
1414
if ( typeof width === "number" ) {
1409
1415
if ( width > 0 ) {
1416
+ this . rawWidth = width ;
1410
1417
const maxWidth = ( rect [ 2 ] - rect [ 0 ] ) / 2 ;
1411
1418
const maxHeight = ( rect [ 3 ] - rect [ 1 ] ) / 2 ;
1412
1419
@@ -4283,6 +4290,10 @@ class InkAnnotation extends MarkupAnnotation {
4283
4290
const { dict, xref } = params ;
4284
4291
this . data . annotationType = AnnotationType . INK ;
4285
4292
this . data . inkLists = [ ] ;
4293
+ this . data . isEditable = ! this . data . noHTML && this . data . it === "InkHighlight" ;
4294
+ // We want to be able to add mouse listeners to the annotation.
4295
+ this . data . noHTML = false ;
4296
+ this . data . opacity = dict . get ( "CA" ) || 1 ;
4286
4297
4287
4298
const rawInkLists = dict . getArray ( "InkList" ) ;
4288
4299
if ( ! Array . isArray ( rawInkLists ) ) {
@@ -4534,6 +4545,10 @@ class HighlightAnnotation extends MarkupAnnotation {
4534
4545
4535
4546
const { dict, xref } = params ;
4536
4547
this . data . annotationType = AnnotationType . HIGHLIGHT ;
4548
+ this . data . isEditable = ! this . data . noHTML ;
4549
+ // We want to be able to add mouse listeners to the annotation.
4550
+ this . data . noHTML = false ;
4551
+ this . data . opacity = dict . get ( "CA" ) || 1 ;
4537
4552
4538
4553
const quadPoints = ( this . data . quadPoints = getQuadPoints ( dict , null ) ) ;
4539
4554
if ( quadPoints ) {
@@ -4573,11 +4588,15 @@ class HighlightAnnotation extends MarkupAnnotation {
4573
4588
}
4574
4589
}
4575
4590
4576
- static createNewDict ( annotation , xref , { apRef, ap } ) {
4591
+ static createNewDict ( annotation , xref , { apRef, ap, oldAnnotation } ) {
4577
4592
const { color, opacity, rect, rotation, user, quadPoints } = annotation ;
4578
- const highlight = new Dict ( xref ) ;
4593
+ const highlight = oldAnnotation || new Dict ( xref ) ;
4579
4594
highlight . set ( "Type" , Name . get ( "Annot" ) ) ;
4580
4595
highlight . set ( "Subtype" , Name . get ( "Highlight" ) ) ;
4596
+ highlight . set (
4597
+ oldAnnotation ? "M" : "CreationDate" ,
4598
+ `D:${ getModificationDate ( ) } `
4599
+ ) ;
4581
4600
highlight . set ( "CreationDate" , `D:${ getModificationDate ( ) } ` ) ;
4582
4601
highlight . set ( "Rect" , rect ) ;
4583
4602
highlight . set ( "F" , 4 ) ;
0 commit comments