From e64086ccf34d95ed76cf47671ed98782ab1132e9 Mon Sep 17 00:00:00 2001 From: Pdf Bot Date: Tue, 13 Sep 2016 15:55:39 +0100 Subject: [PATCH] PDF.js version 1.5.458 - See mozilla/pdf.js@a7c35025fed8beb8f9b93688fff40497c7ad2de0 --- bower.json | 2 +- build/pdf.combined.js | 24 +++++++++++++++++------- build/pdf.js | 9 ++++----- build/pdf.worker.js | 19 +++++++++++++++---- package.json | 2 +- 5 files changed, 38 insertions(+), 18 deletions(-) diff --git a/bower.json b/bower.json index 8d9018b00..a76d945e6 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.5.456", + "version": "1.5.458", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 979572d47..758d4245b 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.5.456'; -var pdfjsBuild = '4d15928'; +var pdfjsVersion = '1.5.458'; +var pdfjsBuild = 'a7c3502'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -24130,7 +24130,6 @@ exports.LZWStream = LZWStream; var AnnotationBorderStyleType = sharedUtil.AnnotationBorderStyleType; var AnnotationType = sharedUtil.AnnotationType; -var isInt = sharedUtil.isInt; var Util = sharedUtil.Util; var addLinkAttributes = displayDOMUtils.addLinkAttributes; var LinkTarget = displayDOMUtils.LinkTarget; @@ -24552,7 +24551,7 @@ var TextWidgetAnnotationElement = ( element.type = 'text'; element.value = this.data.fieldValue; - if (isInt(this.data.maxLen)) { + if (this.data.maxLen !== null) { element.maxLength = this.data.maxLen; } } else { @@ -24568,7 +24567,7 @@ var TextWidgetAnnotationElement = ( this._setTextStyle(element, font); } - if (isInt(this.data.textAlignment)) { + if (this.data.textAlignment !== null) { element.style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment]; } @@ -49656,8 +49655,19 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() { function TextWidgetAnnotation(params) { WidgetAnnotation.call(this, params); - this.data.textAlignment = Util.getInheritableProperty(params.dict, 'Q'); - this.data.maxLen = Util.getInheritableProperty(params.dict, 'MaxLen'); + // Determine the alignment of text in the field. + var alignment = Util.getInheritableProperty(params.dict, 'Q'); + if (!isInt(alignment) || alignment < 0 || alignment > 2) { + alignment = null; + } + this.data.textAlignment = alignment; + + // Determine the maximum length of text in the field. + var maximumLength = Util.getInheritableProperty(params.dict, 'MaxLen'); + if (!isInt(maximumLength) || maximumLength < 0) { + maximumLength = null; + } + this.data.maxLen = maximumLength; } Util.inherit(TextWidgetAnnotation, WidgetAnnotation, { diff --git a/build/pdf.js b/build/pdf.js index 7a9694137..606cc5dd1 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.5.456'; -var pdfjsBuild = '4d15928'; +var pdfjsVersion = '1.5.458'; +var pdfjsBuild = 'a7c3502'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -4325,7 +4325,6 @@ exports.SVGGraphics = SVGGraphics; var AnnotationBorderStyleType = sharedUtil.AnnotationBorderStyleType; var AnnotationType = sharedUtil.AnnotationType; -var isInt = sharedUtil.isInt; var Util = sharedUtil.Util; var addLinkAttributes = displayDOMUtils.addLinkAttributes; var LinkTarget = displayDOMUtils.LinkTarget; @@ -4747,7 +4746,7 @@ var TextWidgetAnnotationElement = ( element.type = 'text'; element.value = this.data.fieldValue; - if (isInt(this.data.maxLen)) { + if (this.data.maxLen !== null) { element.maxLength = this.data.maxLen; } } else { @@ -4763,7 +4762,7 @@ var TextWidgetAnnotationElement = ( this._setTextStyle(element, font); } - if (isInt(this.data.textAlignment)) { + if (this.data.textAlignment !== null) { element.style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment]; } diff --git a/build/pdf.worker.js b/build/pdf.worker.js index ee36ff66d..38cc177d4 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.5.456'; -var pdfjsBuild = '4d15928'; +var pdfjsVersion = '1.5.458'; +var pdfjsBuild = 'a7c3502'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -40800,8 +40800,19 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() { function TextWidgetAnnotation(params) { WidgetAnnotation.call(this, params); - this.data.textAlignment = Util.getInheritableProperty(params.dict, 'Q'); - this.data.maxLen = Util.getInheritableProperty(params.dict, 'MaxLen'); + // Determine the alignment of text in the field. + var alignment = Util.getInheritableProperty(params.dict, 'Q'); + if (!isInt(alignment) || alignment < 0 || alignment > 2) { + alignment = null; + } + this.data.textAlignment = alignment; + + // Determine the maximum length of text in the field. + var maximumLength = Util.getInheritableProperty(params.dict, 'MaxLen'); + if (!isInt(maximumLength) || maximumLength < 0) { + maximumLength = null; + } + this.data.maxLen = maximumLength; } Util.inherit(TextWidgetAnnotation, WidgetAnnotation, { diff --git a/package.json b/package.json index 76021ceb4..d978e5b85 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.5.456", + "version": "1.5.458", "main": "build/pdf.js", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [