Browse Source

PDF.js version 1.1.151

Pdf Bot 10 years ago
parent
commit
de9a1bc7e7
5 changed files with 38 additions and 10 deletions
  1. 1 1
      bower.json
  2. 15 3
      build/pdf.combined.js
  3. 6 2
      build/pdf.js
  4. 15 3
      build/pdf.worker.js
  5. 1 1
      package.json

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "pdfjs-dist",
   "name": "pdfjs-dist",
-  "version": "1.1.149",
+  "version": "1.1.151",
   "main": [
   "main": [
     "build/pdf.js",
     "build/pdf.js",
     "build/pdf.worker.js"
     "build/pdf.worker.js"

+ 15 - 3
build/pdf.combined.js

@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
 }
 }
 
 
-PDFJS.version = '1.1.149';
-PDFJS.build = '3f3fb1e';
+PDFJS.version = '1.1.151';
+PDFJS.build = '07af86c';
 
 
 (function pdfjsWrapper() {
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it
   // Use strict in our context only - users might not want it
@@ -973,6 +973,10 @@ function stringToUTF8String(str) {
   return decodeURIComponent(escape(str));
   return decodeURIComponent(escape(str));
 }
 }
 
 
+function utf8StringToString(str) {
+  return unescape(encodeURIComponent(str));
+}
+
 function isEmptyObj(obj) {
 function isEmptyObj(obj) {
   for (var key in obj) {
   for (var key in obj) {
     return false;
     return false;
@@ -16005,6 +16009,14 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
     var fileIdBytes = stringToBytes(fileId);
     var fileIdBytes = stringToBytes(fileId);
     var passwordBytes;
     var passwordBytes;
     if (password) {
     if (password) {
+      if (revision === 6) {
+        try {
+          password = utf8StringToString(password);
+        } catch (ex) {
+          warn('CipherTransformFactory: ' +
+               'Unable to convert UTF8 encoded password.');
+        }
+      }
       passwordBytes = stringToBytes(password);
       passwordBytes = stringToBytes(password);
     }
     }
 
 
@@ -16109,7 +16121,7 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
 
 
   CipherTransformFactory.prototype = {
   CipherTransformFactory.prototype = {
     createCipherTransform:
     createCipherTransform:
-      function CipherTransformFactory_createCipherTransform(num, gen) {
+        function CipherTransformFactory_createCipherTransform(num, gen) {
       if (this.algorithm === 4 || this.algorithm === 5) {
       if (this.algorithm === 4 || this.algorithm === 5) {
         return new CipherTransform(
         return new CipherTransform(
           buildCipherConstructor(this.cf, this.stmf,
           buildCipherConstructor(this.cf, this.stmf,

+ 6 - 2
build/pdf.js

@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
 }
 }
 
 
-PDFJS.version = '1.1.149';
-PDFJS.build = '3f3fb1e';
+PDFJS.version = '1.1.151';
+PDFJS.build = '07af86c';
 
 
 (function pdfjsWrapper() {
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it
   // Use strict in our context only - users might not want it
@@ -973,6 +973,10 @@ function stringToUTF8String(str) {
   return decodeURIComponent(escape(str));
   return decodeURIComponent(escape(str));
 }
 }
 
 
+function utf8StringToString(str) {
+  return unescape(encodeURIComponent(str));
+}
+
 function isEmptyObj(obj) {
 function isEmptyObj(obj) {
   for (var key in obj) {
   for (var key in obj) {
     return false;
     return false;

+ 15 - 3
build/pdf.worker.js

@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
 }
 }
 
 
-PDFJS.version = '1.1.149';
-PDFJS.build = '3f3fb1e';
+PDFJS.version = '1.1.151';
+PDFJS.build = '07af86c';
 
 
 (function pdfjsWrapper() {
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it
   // Use strict in our context only - users might not want it
@@ -973,6 +973,10 @@ function stringToUTF8String(str) {
   return decodeURIComponent(escape(str));
   return decodeURIComponent(escape(str));
 }
 }
 
 
+function utf8StringToString(str) {
+  return unescape(encodeURIComponent(str));
+}
+
 function isEmptyObj(obj) {
 function isEmptyObj(obj) {
   for (var key in obj) {
   for (var key in obj) {
     return false;
     return false;
@@ -9652,6 +9656,14 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
     var fileIdBytes = stringToBytes(fileId);
     var fileIdBytes = stringToBytes(fileId);
     var passwordBytes;
     var passwordBytes;
     if (password) {
     if (password) {
+      if (revision === 6) {
+        try {
+          password = utf8StringToString(password);
+        } catch (ex) {
+          warn('CipherTransformFactory: ' +
+               'Unable to convert UTF8 encoded password.');
+        }
+      }
       passwordBytes = stringToBytes(password);
       passwordBytes = stringToBytes(password);
     }
     }
 
 
@@ -9756,7 +9768,7 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
 
 
   CipherTransformFactory.prototype = {
   CipherTransformFactory.prototype = {
     createCipherTransform:
     createCipherTransform:
-      function CipherTransformFactory_createCipherTransform(num, gen) {
+        function CipherTransformFactory_createCipherTransform(num, gen) {
       if (this.algorithm === 4 || this.algorithm === 5) {
       if (this.algorithm === 4 || this.algorithm === 5) {
         return new CipherTransform(
         return new CipherTransform(
           buildCipherConstructor(this.cf, this.stmf,
           buildCipherConstructor(this.cf, this.stmf,

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "pdfjs-dist",
   "name": "pdfjs-dist",
-  "version": "1.1.149",
+  "version": "1.1.151",
   "description": "Generic build of Mozilla's PDF.js library.",
   "description": "Generic build of Mozilla's PDF.js library.",
   "keywords": [
   "keywords": [
     "Mozilla",
     "Mozilla",