Forráskód Böngészése

PDF.js version 1.5.458 - See mozilla/pdf.js@a7c35025fed8beb8f9b93688fff40497c7ad2de0

Pdf Bot 8 éve
szülő
commit
e64086ccf3
5 módosított fájl, 38 hozzáadás és 18 törlés
  1. 1 1
      bower.json
  2. 17 7
      build/pdf.combined.js
  3. 4 5
      build/pdf.js
  4. 15 4
      build/pdf.worker.js
  5. 1 1
      package.json

+ 1 - 1
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"

+ 17 - 7
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, {

+ 4 - 5
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];
       }
 

+ 15 - 4
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, {

+ 1 - 1
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": [