Browse Source

PDF.js version 1.1.242

Pdf Bot 9 years ago
parent
commit
a4d9d9c5d6
5 changed files with 20 additions and 12 deletions
  1. 1 1
      bower.json
  2. 8 4
      build/pdf.combined.js
  3. 2 2
      build/pdf.js
  4. 8 4
      build/pdf.worker.js
  5. 1 1
      package.json

+ 1 - 1
bower.json

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

+ 8 - 4
build/pdf.combined.js

@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
 }
 
-PDFJS.version = '1.1.240';
-PDFJS.build = '9bb2908';
+PDFJS.version = '1.1.242';
+PDFJS.build = 'd8e2014';
 
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it
@@ -24912,13 +24912,17 @@ var Font = (function FontClosure() {
 
       var charCodeToGlyphId = [], charCode;
       var toUnicode = properties.toUnicode, widths = properties.widths;
-      var isIdentityUnicode = toUnicode instanceof IdentityToUnicodeMap;
+      var skipToUnicode = (toUnicode instanceof IdentityToUnicodeMap ||
+                           toUnicode.length === 0x10000);
 
+      // Helper function to try to skip mapping of empty glyphs.
+      // Note: In some cases, just relying on the glyph data doesn't work,
+      //       hence we also use a few heuristics to fix various PDF files.
       function hasGlyph(glyphId, charCode, widthCode) {
         if (!missingGlyphs[glyphId]) {
           return true;
         }
-        if (!isIdentityUnicode && charCode >= 0 && toUnicode.has(charCode)) {
+        if (!skipToUnicode && charCode >= 0 && toUnicode.has(charCode)) {
           return true;
         }
         if (widths && widthCode >= 0 && isNum(widths[widthCode])) {

+ 2 - 2
build/pdf.js

@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
 }
 
-PDFJS.version = '1.1.240';
-PDFJS.build = '9bb2908';
+PDFJS.version = '1.1.242';
+PDFJS.build = 'd8e2014';
 
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it

+ 8 - 4
build/pdf.worker.js

@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
 }
 
-PDFJS.version = '1.1.240';
-PDFJS.build = '9bb2908';
+PDFJS.version = '1.1.242';
+PDFJS.build = 'd8e2014';
 
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it
@@ -18513,13 +18513,17 @@ var Font = (function FontClosure() {
 
       var charCodeToGlyphId = [], charCode;
       var toUnicode = properties.toUnicode, widths = properties.widths;
-      var isIdentityUnicode = toUnicode instanceof IdentityToUnicodeMap;
+      var skipToUnicode = (toUnicode instanceof IdentityToUnicodeMap ||
+                           toUnicode.length === 0x10000);
 
+      // Helper function to try to skip mapping of empty glyphs.
+      // Note: In some cases, just relying on the glyph data doesn't work,
+      //       hence we also use a few heuristics to fix various PDF files.
       function hasGlyph(glyphId, charCode, widthCode) {
         if (!missingGlyphs[glyphId]) {
           return true;
         }
-        if (!isIdentityUnicode && charCode >= 0 && toUnicode.has(charCode)) {
+        if (!skipToUnicode && charCode >= 0 && toUnicode.has(charCode)) {
           return true;
         }
         if (widths && widthCode >= 0 && isNum(widths[widthCode])) {

+ 1 - 1
package.json

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