Implement support for Squiggly annotations
This commit is contained in:
parent
d956177482
commit
34918a6666
@ -99,6 +99,9 @@ AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ {
|
|||||||
case 'Underline':
|
case 'Underline':
|
||||||
return new UnderlineAnnotation(parameters);
|
return new UnderlineAnnotation(parameters);
|
||||||
|
|
||||||
|
case 'Squiggly':
|
||||||
|
return new SquigglyAnnotation(parameters);
|
||||||
|
|
||||||
case 'StrikeOut':
|
case 'StrikeOut':
|
||||||
return new StrikeOutAnnotation(parameters);
|
return new StrikeOutAnnotation(parameters);
|
||||||
|
|
||||||
@ -808,6 +811,22 @@ var UnderlineAnnotation = (function UnderlineAnnotationClosure() {
|
|||||||
return UnderlineAnnotation;
|
return UnderlineAnnotation;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
var SquigglyAnnotation = (function SquigglyAnnotationClosure() {
|
||||||
|
function SquigglyAnnotation(parameters) {
|
||||||
|
Annotation.call(this, parameters);
|
||||||
|
|
||||||
|
this.data.annotationType = AnnotationType.SQUIGGLY;
|
||||||
|
this.data.hasHtml = true;
|
||||||
|
|
||||||
|
// PDF viewers completely ignore any border styles.
|
||||||
|
this.data.borderStyle.setWidth(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Util.inherit(SquigglyAnnotation, Annotation, {});
|
||||||
|
|
||||||
|
return SquigglyAnnotation;
|
||||||
|
})();
|
||||||
|
|
||||||
var StrikeOutAnnotation = (function StrikeOutAnnotationClosure() {
|
var StrikeOutAnnotation = (function StrikeOutAnnotationClosure() {
|
||||||
function StrikeOutAnnotation(parameters) {
|
function StrikeOutAnnotation(parameters) {
|
||||||
Annotation.call(this, parameters);
|
Annotation.call(this, parameters);
|
||||||
|
@ -75,6 +75,9 @@ AnnotationElementFactory.prototype =
|
|||||||
case AnnotationType.UNDERLINE:
|
case AnnotationType.UNDERLINE:
|
||||||
return new UnderlineAnnotationElement(parameters);
|
return new UnderlineAnnotationElement(parameters);
|
||||||
|
|
||||||
|
case AnnotationType.SQUIGGLY:
|
||||||
|
return new SquigglyAnnotationElement(parameters);
|
||||||
|
|
||||||
case AnnotationType.STRIKEOUT:
|
case AnnotationType.STRIKEOUT:
|
||||||
return new StrikeOutAnnotationElement(parameters);
|
return new StrikeOutAnnotationElement(parameters);
|
||||||
|
|
||||||
@ -633,6 +636,32 @@ var UnderlineAnnotationElement = (
|
|||||||
return UnderlineAnnotationElement;
|
return UnderlineAnnotationElement;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @class
|
||||||
|
* @alias SquigglyAnnotationElement
|
||||||
|
*/
|
||||||
|
var SquigglyAnnotationElement = (function SquigglyAnnotationElementClosure() {
|
||||||
|
function SquigglyAnnotationElement(parameters) {
|
||||||
|
AnnotationElement.call(this, parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
Util.inherit(SquigglyAnnotationElement, AnnotationElement, {
|
||||||
|
/**
|
||||||
|
* Render the squiggly annotation's HTML element in the empty container.
|
||||||
|
*
|
||||||
|
* @public
|
||||||
|
* @memberof SquigglyAnnotationElement
|
||||||
|
* @returns {HTMLSectionElement}
|
||||||
|
*/
|
||||||
|
render: function SquigglyAnnotationElement_render() {
|
||||||
|
this.container.className = 'squigglyAnnotation';
|
||||||
|
return this.container;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return SquigglyAnnotationElement;
|
||||||
|
})();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class
|
* @class
|
||||||
* @alias StrikeOutAnnotationElement
|
* @alias StrikeOutAnnotationElement
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -203,3 +203,4 @@
|
|||||||
!annotation-text-without-popup.pdf
|
!annotation-text-without-popup.pdf
|
||||||
!annotation-underline.pdf
|
!annotation-underline.pdf
|
||||||
!annotation-strikeout.pdf
|
!annotation-strikeout.pdf
|
||||||
|
!annotation-squiggly.pdf
|
||||||
|
BIN
test/pdfs/annotation-squiggly.pdf
Normal file
BIN
test/pdfs/annotation-squiggly.pdf
Normal file
Binary file not shown.
@ -2660,6 +2660,13 @@
|
|||||||
"type": "eq",
|
"type": "eq",
|
||||||
"annotations": true
|
"annotations": true
|
||||||
},
|
},
|
||||||
|
{ "id": "annotation-squiggly",
|
||||||
|
"file": "pdfs/annotation-squiggly.pdf",
|
||||||
|
"md5": "38661e731ac6c525af5894d2d20c6e71",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq",
|
||||||
|
"annotations": true
|
||||||
|
},
|
||||||
{ "id": "issue6108",
|
{ "id": "issue6108",
|
||||||
"file": "pdfs/issue6108.pdf",
|
"file": "pdfs/issue6108.pdf",
|
||||||
"md5": "8961cb55149495989a80bf0487e0f076",
|
"md5": "8961cb55149495989a80bf0487e0f076",
|
||||||
|
@ -69,10 +69,8 @@
|
|||||||
padding-top: 0.2em;
|
padding-top: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.annotationLayer .underlineAnnotation {
|
.annotationLayer .underlineAnnotation,
|
||||||
cursor: pointer;
|
.annotationLayer .squigglyAnnotation,
|
||||||
}
|
|
||||||
|
|
||||||
.annotationLayer .strikeoutAnnotation {
|
.annotationLayer .strikeoutAnnotation {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user