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

Merge pull request #6819 from timvandermeij/strikeout-annotation

Implement support for StrikeOut annotations
This commit is contained in:
Jonas Jenwald 2015-12-30 14:44:50 +01:00
commit d956177482
6 changed files with 61 additions and 0 deletions

View file

@ -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;