1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Implement support for Highlight annotations

This commit is contained in:
Tim van der Meij 2016-01-01 15:31:46 +01:00
parent 8ed369211a
commit 6ef7120a04
6 changed files with 58 additions and 0 deletions

View file

@ -96,6 +96,9 @@ AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ {
case 'Popup':
return new PopupAnnotation(parameters);
case 'Highlight':
return new HighlightAnnotation(parameters);
case 'Underline':
return new UnderlineAnnotation(parameters);
@ -795,6 +798,22 @@ var PopupAnnotation = (function PopupAnnotationClosure() {
return PopupAnnotation;
})();
var HighlightAnnotation = (function HighlightAnnotationClosure() {
function HighlightAnnotation(parameters) {
Annotation.call(this, parameters);
this.data.annotationType = AnnotationType.HIGHLIGHT;
this.data.hasHtml = true;
// PDF viewers completely ignore any border styles.
this.data.borderStyle.setWidth(0);
}
Util.inherit(HighlightAnnotation, Annotation, {});
return HighlightAnnotation;
})();
var UnderlineAnnotation = (function UnderlineAnnotationClosure() {
function UnderlineAnnotation(parameters) {
Annotation.call(this, parameters);