mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +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
|
@ -72,6 +72,9 @@ AnnotationElementFactory.prototype =
|
|||
case AnnotationType.POPUP:
|
||||
return new PopupAnnotationElement(parameters);
|
||||
|
||||
case AnnotationType.UNDERLINE:
|
||||
return new UnderlineAnnotationElement(parameters);
|
||||
|
||||
default:
|
||||
throw new Error('Unimplemented annotation type "' + subtype + '"');
|
||||
}
|
||||
|
@ -593,6 +596,33 @@ var PopupElement = (function PopupElementClosure() {
|
|||
return PopupElement;
|
||||
})();
|
||||
|
||||
/**
|
||||
* @class
|
||||
* @alias UnderlineAnnotationElement
|
||||
*/
|
||||
var UnderlineAnnotationElement = (
|
||||
function UnderlineAnnotationElementClosure() {
|
||||
function UnderlineAnnotationElement(parameters) {
|
||||
AnnotationElement.call(this, parameters);
|
||||
}
|
||||
|
||||
Util.inherit(UnderlineAnnotationElement, AnnotationElement, {
|
||||
/**
|
||||
* Render the underline annotation's HTML element in the empty container.
|
||||
*
|
||||
* @public
|
||||
* @memberof UnderlineAnnotationElement
|
||||
* @returns {HTMLSectionElement}
|
||||
*/
|
||||
render: function UnderlineAnnotationElement_render() {
|
||||
this.container.className = 'underlineAnnotation';
|
||||
return this.container;
|
||||
}
|
||||
});
|
||||
|
||||
return UnderlineAnnotationElement;
|
||||
})();
|
||||
|
||||
/**
|
||||
* @typedef {Object} AnnotationLayerParameters
|
||||
* @property {PageViewport} viewport
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue