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