mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Implement support for Underline annotations
This commit is contained in:
parent
f17d6721e7
commit
cd28dd34fe
6 changed files with 61 additions and 0 deletions
|
@ -96,6 +96,9 @@ AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ {
|
|||
case 'Popup':
|
||||
return new PopupAnnotation(parameters);
|
||||
|
||||
case 'Underline':
|
||||
return new UnderlineAnnotation(parameters);
|
||||
|
||||
default:
|
||||
warn('Unimplemented annotation type "' + subtype + '", ' +
|
||||
'falling back to base annotation');
|
||||
|
@ -786,6 +789,22 @@ var PopupAnnotation = (function PopupAnnotationClosure() {
|
|||
return PopupAnnotation;
|
||||
})();
|
||||
|
||||
var UnderlineAnnotation = (function UnderlineAnnotationClosure() {
|
||||
function UnderlineAnnotation(parameters) {
|
||||
Annotation.call(this, parameters);
|
||||
|
||||
this.data.annotationType = AnnotationType.UNDERLINE;
|
||||
this.data.hasHtml = true;
|
||||
|
||||
// PDF viewers completely ignore any border styles.
|
||||
this.data.borderStyle.setWidth(0);
|
||||
}
|
||||
|
||||
Util.inherit(UnderlineAnnotation, Annotation, {});
|
||||
|
||||
return UnderlineAnnotation;
|
||||
})();
|
||||
|
||||
exports.Annotation = Annotation;
|
||||
exports.AnnotationBorderStyle = AnnotationBorderStyle;
|
||||
exports.AnnotationFactory = AnnotationFactory;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue