diff --git a/bower.json b/bower.json index c90590ff7..c3aa08151 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.3.133", + "version": "1.3.135", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 191f581e1..f2ab82b02 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { typeof global !== 'undefined' ? global : this).PDFJS = {}; } -PDFJS.version = '1.3.133'; -PDFJS.build = '8558948'; +PDFJS.version = '1.3.135'; +PDFJS.build = 'b32cdf5'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -1846,6 +1846,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 + '"'); } @@ -2374,6 +2377,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 @@ -46542,6 +46572,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'); @@ -47232,6 +47265,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; diff --git a/build/pdf.js b/build/pdf.js index 40285308d..1b0fc734b 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { typeof global !== 'undefined' ? global : this).PDFJS = {}; } -PDFJS.version = '1.3.133'; -PDFJS.build = '8558948'; +PDFJS.version = '1.3.135'; +PDFJS.build = 'b32cdf5'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -1846,6 +1846,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 + '"'); } @@ -2374,6 +2377,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 diff --git a/build/pdf.worker.js b/build/pdf.worker.js index eee5b5035..d34ae13a0 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { typeof global !== 'undefined' ? global : this).PDFJS = {}; } -PDFJS.version = '1.3.133'; -PDFJS.build = '8558948'; +PDFJS.version = '1.3.135'; +PDFJS.build = 'b32cdf5'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -38853,6 +38853,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'); @@ -39543,6 +39546,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; diff --git a/package.json b/package.json index 459a5e589..fb9600964 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.3.133", + "version": "1.3.135", "main": "build/pdf.js", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ diff --git a/web/pdf_viewer.css b/web/pdf_viewer.css index 2783c1bea..96e09ce08 100644 --- a/web/pdf_viewer.css +++ b/web/pdf_viewer.css @@ -138,6 +138,10 @@ padding-top: 0.2em; } +.annotationLayer .underlineAnnotation { + cursor: pointer; +} + .pdfViewer .canvasWrapper { overflow: hidden; }