Browse Source

PDF.js version 2.0.489 - See mozilla/pdf.js@7d7bc80eee7ef4486547bec7b3ecba7be7aabc69

master v2.0.489
pdfjsbot 7 years ago
parent
commit
75d0c0c6a5
  1. 2
      bower.json
  2. 12
      build/pdf.js
  3. 2
      build/pdf.js.map
  4. 2
      build/pdf.min.js
  5. 67
      build/pdf.worker.js
  6. 2
      build/pdf.worker.js.map
  7. 2
      build/pdf.worker.min.js
  8. 59
      lib/core/font_renderer.js
  9. 2
      lib/core/worker.js
  10. 6
      lib/display/api.js
  11. 4
      lib/pdf.js
  12. 4
      lib/pdf.worker.js
  13. 4
      lib/web/pdf_viewer.component.js
  14. 2
      package.json
  15. 4
      web/pdf_viewer.js
  16. 2
      web/pdf_viewer.js.map

2
bower.json

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

12
build/pdf.js

@ -1518,7 +1518,7 @@ if (typeof __g == 'number') __g = global; @@ -1518,7 +1518,7 @@ if (typeof __g == 'number') __g = global;
"use strict";
var core = module.exports = { version: '2.5.4' };
var core = module.exports = { version: '2.5.5' };
if (typeof __e == 'number') __e = core;
/***/ }),
@ -3003,8 +3003,8 @@ exports.GlobalWorkerOptions = GlobalWorkerOptions; @@ -3003,8 +3003,8 @@ exports.GlobalWorkerOptions = GlobalWorkerOptions;
"use strict";
var pdfjsVersion = '2.0.487';
var pdfjsBuild = '2275485c';
var pdfjsVersion = '2.0.489';
var pdfjsBuild = '7d7bc80e';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayAPI = __w_pdfjs_require__(117);
var pdfjsDisplayTextLayer = __w_pdfjs_require__(125);
@ -8437,7 +8437,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { @@ -8437,7 +8437,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
}
return worker.messageHandler.sendWithPromise('GetDocRequest', {
docId: docId,
apiVersion: '2.0.487',
apiVersion: '2.0.489',
source: {
data: source.data,
url: source.url,
@ -9855,8 +9855,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -9855,8 +9855,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
}();
var version, build;
{
exports.version = version = '2.0.487';
exports.build = build = '2275485c';
exports.version = version = '2.0.489';
exports.build = build = '7d7bc80e';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;

2
build/pdf.js.map

File diff suppressed because one or more lines are too long

2
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

67
build/pdf.worker.js vendored

@ -2759,7 +2759,7 @@ if (typeof __g == 'number') __g = global; @@ -2759,7 +2759,7 @@ if (typeof __g == 'number') __g = global;
"use strict";
var core = module.exports = { version: '2.5.4' };
var core = module.exports = { version: '2.5.5' };
if (typeof __e == 'number') __e = core;
/***/ }),
@ -22360,8 +22360,8 @@ exports.PostScriptCompiler = PostScriptCompiler; @@ -22360,8 +22360,8 @@ exports.PostScriptCompiler = PostScriptCompiler;
"use strict";
var pdfjsVersion = '2.0.487';
var pdfjsBuild = '2275485c';
var pdfjsVersion = '2.0.489';
var pdfjsBuild = '7d7bc80e';
var pdfjsCoreWorker = __w_pdfjs_require__(74);
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
@ -22574,7 +22574,7 @@ var WorkerMessageHandler = { @@ -22574,7 +22574,7 @@ var WorkerMessageHandler = {
var cancelXHRs = null;
var WorkerTasks = [];
var apiVersion = docParams.apiVersion;
var workerVersion = '2.0.487';
var workerVersion = '2.0.489';
if (apiVersion !== null && apiVersion !== workerVersion) {
throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
}
@ -38934,7 +38934,10 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -38934,7 +38934,10 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
return {
glyphs: cff.charStrings.objects,
subrs: cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && cff.topDict.privateDict.subrsIndex.objects,
gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects
gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects,
isCFFCIDFont: cff.isCIDFont,
fdSelect: cff.fdSelect,
fdArray: cff.fdArray
};
}
function parseGlyfTable(glyf, loca, isGlyphLocationsLong) {
@ -39138,7 +39141,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -39138,7 +39141,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
}
}
}
function compileCharString(code, cmds, font) {
function compileCharString(code, cmds, font, glyphId) {
var stack = [];
var x = 0,
y = 0;
@ -39222,8 +39225,27 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -39222,8 +39225,27 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
}
break;
case 10:
n = stack.pop() + font.subrsBias;
subrCode = font.subrs[n];
n = stack.pop();
subrCode = null;
if (font.isCFFCIDFont) {
var fdIndex = font.fdSelect.getFDIndex(glyphId);
if (fdIndex >= 0 && fdIndex < font.fdArray.length) {
var fontDict = font.fdArray[fdIndex],
subrs = void 0;
if (fontDict.privateDict && fontDict.privateDict.subrsIndex) {
subrs = fontDict.privateDict.subrsIndex.objects;
}
if (subrs) {
var numSubrs = subrs.length;
n += numSubrs < 1240 ? 107 : numSubrs < 33900 ? 1131 : 32768;
subrCode = subrs[n];
}
} else {
(0, _util.warn)('Invalid fd index for glyph index.');
}
} else {
subrCode = font.subrs[n + font.subrsBias];
}
if (subrCode) {
parse(subrCode);
}
@ -39313,10 +39335,10 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -39313,10 +39335,10 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
args: [x, y]
});
var cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[_encodings.StandardEncoding[achar]]));
compileCharString(font.glyphs[cmap.glyphId], cmds, font);
compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId);
cmds.push({ cmd: 'restore' });
cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[_encodings.StandardEncoding[bchar]]));
compileCharString(font.glyphs[cmap.glyphId], cmds, font);
compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId);
}
return;
case 18:
@ -39491,7 +39513,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -39491,7 +39513,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
var cmap = lookupCmap(this.cmap, unicode);
var fn = this.compiledGlyphs[cmap.glyphId];
if (!fn) {
fn = this.compileGlyph(this.glyphs[cmap.glyphId]);
fn = this.compileGlyph(this.glyphs[cmap.glyphId], cmap.glyphId);
this.compiledGlyphs[cmap.glyphId] = fn;
}
if (this.compiledCharCodeToGlyphId[cmap.charCode] === undefined) {
@ -39499,21 +39521,31 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -39499,21 +39521,31 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
}
return fn;
},
compileGlyph: function compileGlyph(code) {
compileGlyph: function compileGlyph(code, glyphId) {
if (!code || code.length === 0 || code[0] === 14) {
return noop;
}
var fontMatrix = this.fontMatrix;
if (this.isCFFCIDFont) {
var fdIndex = this.fdSelect.getFDIndex(glyphId);
if (fdIndex >= 0 && fdIndex < this.fdArray.length) {
var fontDict = this.fdArray[fdIndex];
fontMatrix = fontDict.getByName('FontMatrix') || _util.FONT_IDENTITY_MATRIX;
} else {
(0, _util.warn)('Invalid fd index for glyph index.');
}
}
var cmds = [];
cmds.push({ cmd: 'save' });
cmds.push({
cmd: 'transform',
args: this.fontMatrix.slice()
args: fontMatrix.slice()
});
cmds.push({
cmd: 'scale',
args: ['size', '-size']
});
this.compileGlyphImpl(code, cmds);
this.compileGlyphImpl(code, cmds, glyphId);
cmds.push({ cmd: 'restore' });
return cmds;
},
@ -39546,10 +39578,13 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -39546,10 +39578,13 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
this.glyphNameMap = glyphNameMap || (0, _glyphlist.getGlyphsUnicode)();
this.gsubrsBias = this.gsubrs.length < 1240 ? 107 : this.gsubrs.length < 33900 ? 1131 : 32768;
this.subrsBias = this.subrs.length < 1240 ? 107 : this.subrs.length < 33900 ? 1131 : 32768;
this.isCFFCIDFont = cffInfo.isCFFCIDFont;
this.fdSelect = cffInfo.fdSelect;
this.fdArray = cffInfo.fdArray;
}
_util.Util.inherit(Type2Compiled, CompiledFont, {
compileGlyphImpl: function compileGlyphImpl(code, cmds) {
compileCharString(code, cmds, this);
compileGlyphImpl: function compileGlyphImpl(code, cmds, glyphId) {
compileCharString(code, cmds, this, glyphId);
}
});
return {

2
build/pdf.worker.js.map vendored

File diff suppressed because one or more lines are too long

2
build/pdf.worker.min.js vendored

File diff suppressed because one or more lines are too long

59
lib/core/font_renderer.js

@ -98,7 +98,10 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -98,7 +98,10 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
return {
glyphs: cff.charStrings.objects,
subrs: cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && cff.topDict.privateDict.subrsIndex.objects,
gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects
gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects,
isCFFCIDFont: cff.isCIDFont,
fdSelect: cff.fdSelect,
fdArray: cff.fdArray
};
}
function parseGlyfTable(glyf, loca, isGlyphLocationsLong) {
@ -302,7 +305,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -302,7 +305,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
}
}
}
function compileCharString(code, cmds, font) {
function compileCharString(code, cmds, font, glyphId) {
var stack = [];
var x = 0,
y = 0;
@ -386,8 +389,27 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -386,8 +389,27 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
}
break;
case 10:
n = stack.pop() + font.subrsBias;
subrCode = font.subrs[n];
n = stack.pop();
subrCode = null;
if (font.isCFFCIDFont) {
var fdIndex = font.fdSelect.getFDIndex(glyphId);
if (fdIndex >= 0 && fdIndex < font.fdArray.length) {
var fontDict = font.fdArray[fdIndex],
subrs = void 0;
if (fontDict.privateDict && fontDict.privateDict.subrsIndex) {
subrs = fontDict.privateDict.subrsIndex.objects;
}
if (subrs) {
var numSubrs = subrs.length;
n += numSubrs < 1240 ? 107 : numSubrs < 33900 ? 1131 : 32768;
subrCode = subrs[n];
}
} else {
(0, _util.warn)('Invalid fd index for glyph index.');
}
} else {
subrCode = font.subrs[n + font.subrsBias];
}
if (subrCode) {
parse(subrCode);
}
@ -477,10 +499,10 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -477,10 +499,10 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
args: [x, y]
});
var cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[_encodings.StandardEncoding[achar]]));
compileCharString(font.glyphs[cmap.glyphId], cmds, font);
compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId);
cmds.push({ cmd: 'restore' });
cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[_encodings.StandardEncoding[bchar]]));
compileCharString(font.glyphs[cmap.glyphId], cmds, font);
compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId);
}
return;
case 18:
@ -655,7 +677,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -655,7 +677,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
var cmap = lookupCmap(this.cmap, unicode);
var fn = this.compiledGlyphs[cmap.glyphId];
if (!fn) {
fn = this.compileGlyph(this.glyphs[cmap.glyphId]);
fn = this.compileGlyph(this.glyphs[cmap.glyphId], cmap.glyphId);
this.compiledGlyphs[cmap.glyphId] = fn;
}
if (this.compiledCharCodeToGlyphId[cmap.charCode] === undefined) {
@ -663,21 +685,31 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -663,21 +685,31 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
}
return fn;
},
compileGlyph: function compileGlyph(code) {
compileGlyph: function compileGlyph(code, glyphId) {
if (!code || code.length === 0 || code[0] === 14) {
return noop;
}
var fontMatrix = this.fontMatrix;
if (this.isCFFCIDFont) {
var fdIndex = this.fdSelect.getFDIndex(glyphId);
if (fdIndex >= 0 && fdIndex < this.fdArray.length) {
var fontDict = this.fdArray[fdIndex];
fontMatrix = fontDict.getByName('FontMatrix') || _util.FONT_IDENTITY_MATRIX;
} else {
(0, _util.warn)('Invalid fd index for glyph index.');
}
}
var cmds = [];
cmds.push({ cmd: 'save' });
cmds.push({
cmd: 'transform',
args: this.fontMatrix.slice()
args: fontMatrix.slice()
});
cmds.push({
cmd: 'scale',
args: ['size', '-size']
});
this.compileGlyphImpl(code, cmds);
this.compileGlyphImpl(code, cmds, glyphId);
cmds.push({ cmd: 'restore' });
return cmds;
},
@ -710,10 +742,13 @@ var FontRendererFactory = function FontRendererFactoryClosure() { @@ -710,10 +742,13 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
this.glyphNameMap = glyphNameMap || (0, _glyphlist.getGlyphsUnicode)();
this.gsubrsBias = this.gsubrs.length < 1240 ? 107 : this.gsubrs.length < 33900 ? 1131 : 32768;
this.subrsBias = this.subrs.length < 1240 ? 107 : this.subrs.length < 33900 ? 1131 : 32768;
this.isCFFCIDFont = cffInfo.isCFFCIDFont;
this.fdSelect = cffInfo.fdSelect;
this.fdArray = cffInfo.fdArray;
}
_util.Util.inherit(Type2Compiled, CompiledFont, {
compileGlyphImpl: function compileGlyphImpl(code, cmds) {
compileCharString(code, cmds, this);
compileGlyphImpl: function compileGlyphImpl(code, cmds, glyphId) {
compileCharString(code, cmds, this, glyphId);
}
});
return {

2
lib/core/worker.js

@ -223,7 +223,7 @@ var WorkerMessageHandler = { @@ -223,7 +223,7 @@ var WorkerMessageHandler = {
var cancelXHRs = null;
var WorkerTasks = [];
var apiVersion = docParams.apiVersion;
var workerVersion = '2.0.487';
var workerVersion = '2.0.489';
if (apiVersion !== null && apiVersion !== workerVersion) {
throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
}

6
lib/display/api.js

@ -232,7 +232,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { @@ -232,7 +232,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
}
return worker.messageHandler.sendWithPromise('GetDocRequest', {
docId: docId,
apiVersion: '2.0.487',
apiVersion: '2.0.489',
source: {
data: source.data,
url: source.url,
@ -1650,8 +1650,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -1650,8 +1650,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
}();
var version, build;
{
exports.version = version = '2.0.487';
exports.build = build = '2275485c';
exports.version = version = '2.0.489';
exports.build = build = '7d7bc80e';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;

4
lib/pdf.js

@ -21,8 +21,8 @@ @@ -21,8 +21,8 @@
*/
'use strict';
var pdfjsVersion = '2.0.487';
var pdfjsBuild = '2275485c';
var pdfjsVersion = '2.0.489';
var pdfjsBuild = '7d7bc80e';
var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayAPI = require('./display/api.js');
var pdfjsDisplayTextLayer = require('./display/text_layer.js');

4
lib/pdf.worker.js vendored

@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
*/
'use strict';
var pdfjsVersion = '2.0.487';
var pdfjsBuild = '2275485c';
var pdfjsVersion = '2.0.489';
var pdfjsBuild = '7d7bc80e';
var pdfjsCoreWorker = require('./core/worker.js');
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

4
lib/web/pdf_viewer.component.js

@ -48,8 +48,8 @@ var _pdf_single_page_viewer = require('./pdf_single_page_viewer'); @@ -48,8 +48,8 @@ var _pdf_single_page_viewer = require('./pdf_single_page_viewer');
var _pdf_viewer = require('./pdf_viewer.js');
var pdfjsVersion = '2.0.487';
var pdfjsBuild = '2275485c';
var pdfjsVersion = '2.0.489';
var pdfjsBuild = '7d7bc80e';
exports.PDFViewer = _pdf_viewer.PDFViewer;
exports.PDFSinglePageViewer = _pdf_single_page_viewer.PDFSinglePageViewer;
exports.PDFPageView = _pdf_page_view.PDFPageView;

2
package.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "pdfjs-dist",
"version": "2.0.487",
"version": "2.0.489",
"main": "build/pdf.js",
"description": "Generic build of Mozilla's PDF.js library.",
"keywords": [

4
web/pdf_viewer.js

@ -3204,8 +3204,8 @@ var _pdf_single_page_viewer = __w_pdfjs_require__(16); @@ -3204,8 +3204,8 @@ var _pdf_single_page_viewer = __w_pdfjs_require__(16);
var _pdf_viewer = __w_pdfjs_require__(17);
var pdfjsVersion = '2.0.487';
var pdfjsBuild = '2275485c';
var pdfjsVersion = '2.0.489';
var pdfjsBuild = '7d7bc80e';
exports.PDFViewer = _pdf_viewer.PDFViewer;
exports.PDFSinglePageViewer = _pdf_single_page_viewer.PDFSinglePageViewer;
exports.PDFPageView = _pdf_page_view.PDFPageView;

2
web/pdf_viewer.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save