Browse Source

PDF.js version 1.5.339 - See mozilla/pdf.js@3ab68f2e062724104b247963add1517090833a4e

master v1.5.339
Pdf Bot 9 years ago
parent
commit
b8e1f343b7
  1. 2
      bower.json
  2. 40
      build/pdf.combined.js
  3. 16
      build/pdf.js
  4. 36
      build/pdf.worker.js
  5. 2
      package.json
  6. 2
      web/pdf_viewer.js

2
bower.json

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

40
build/pdf.combined.js

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.5.337'; var pdfjsVersion = '1.5.339';
var pdfjsBuild = '11381cd'; var pdfjsBuild = '3ab68f2';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -3142,7 +3142,7 @@ function isSpace(ch) {
* *
* @typedef {Object} PromiseCapability * @typedef {Object} PromiseCapability
* @property {Promise} promise - A promise object. * @property {Promise} promise - A promise object.
* @property {function} resolve - Fullfills the promise. * @property {function} resolve - Fulfills the promise.
* @property {function} reject - Rejects the promise. * @property {function} reject - Rejects the promise.
*/ */
@ -3165,8 +3165,8 @@ function createPromiseCapability() {
/** /**
* Polyfill for Promises: * Polyfill for Promises:
* The following promise implementation tries to generally implement the * The following promise implementation tries to generally implement the
* Promise/A+ spec. Some notable differences from other promise libaries are: * Promise/A+ spec. Some notable differences from other promise libraries are:
* - There currently isn't a seperate deferred and promise object. * - There currently isn't a separate deferred and promise object.
* - Unhandled rejections eventually show an error if they aren't handled. * - Unhandled rejections eventually show an error if they aren't handled.
* *
* Based off of the work in: * Based off of the work in:
@ -3347,7 +3347,7 @@ function createPromiseCapability() {
* Builds a promise that is resolved when all the passed in promises are * Builds a promise that is resolved when all the passed in promises are
* resolved. * resolved.
* @param {array} promises array of data and/or promises to wait for. * @param {array} promises array of data and/or promises to wait for.
* @return {Promise} New dependant promise. * @return {Promise} New dependent promise.
*/ */
Promise.all = function Promise_all(promises) { Promise.all = function Promise_all(promises) {
var resolveAll, rejectAll; var resolveAll, rejectAll;
@ -5215,7 +5215,7 @@ var CFFParser = (function CFFParserClosure() {
break; break;
default: default:
error('Unknow encoding format: ' + format + ' in CFF'); error('Unknown encoding format: ' + format + ' in CFF');
break; break;
} }
var dataEnd = pos; var dataEnd = pos;
@ -5688,7 +5688,7 @@ var CFFCompiler = (function CFFCompilerClosure() {
var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); var globalSubrIndex = this.compileIndex(cff.globalSubrIndex);
output.add(globalSubrIndex); output.add(globalSubrIndex);
// Now start on the other entries that have no specfic order. // Now start on the other entries that have no specific order.
if (cff.encoding && cff.topDict.hasName('Encoding')) { if (cff.encoding && cff.topDict.hasName('Encoding')) {
if (cff.encoding.predefined) { if (cff.encoding.predefined) {
topDictTracker.setEntryLocation('Encoding', [cff.encoding.format], topDictTracker.setEntryLocation('Encoding', [cff.encoding.format],
@ -13450,13 +13450,13 @@ var JpxImage = (function JpxImageClosure() {
var subband = resolution.subbands[j]; var subband = resolution.subbands[j];
var gainLog2 = SubbandsGainLog2[subband.type]; var gainLog2 = SubbandsGainLog2[subband.type];
// calulate quantization coefficient (Section E.1.1.1) // calculate quantization coefficient (Section E.1.1.1)
var delta = (reversible ? 1 : var delta = (reversible ? 1 :
Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048)); Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048));
var mb = (guardBits + epsilon - 1); var mb = (guardBits + epsilon - 1);
// In the first resolution level, copyCoefficients will fill the // In the first resolution level, copyCoefficients will fill the
// whole array with coefficients. In the succeding passes, // whole array with coefficients. In the succeeding passes,
// copyCoefficients will consecutively fill in the values that belong // copyCoefficients will consecutively fill in the values that belong
// to the interleaved positions of the HL, LH, and HH coefficients. // to the interleaved positions of the HL, LH, and HH coefficients.
// The LL coefficients will then be interleaved in Transform.iterate(). // The LL coefficients will then be interleaved in Transform.iterate().
@ -17295,7 +17295,7 @@ exports.getMetrics = getMetrics;
var Uint32ArrayView = sharedUtil.Uint32ArrayView; var Uint32ArrayView = sharedUtil.Uint32ArrayView;
var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) { var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) {
// Workaround for missing math precison in JS. // Workaround for missing math precision in JS.
var MASK_HIGH = 0xffff0000; var MASK_HIGH = 0xffff0000;
var MASK_LOW = 0xffff; var MASK_LOW = 0xffff;
@ -29135,7 +29135,7 @@ var Lexer = (function LexerClosure() {
} else if (ch === 0x2D) { // '-' } else if (ch === 0x2D) { // '-'
// ignore minus signs in the middle of numbers to match // ignore minus signs in the middle of numbers to match
// Adobe's behavior // Adobe's behavior
warn('Badly formated number'); warn('Badly formatted number');
} else if (ch === 0x45 || ch === 0x65) { // 'E', 'e' } else if (ch === 0x45 || ch === 0x65) { // 'E', 'e'
// 'E' can be either a scientific notation or the beginning of a new // 'E' can be either a scientific notation or the beginning of a new
// operator // operator
@ -30357,7 +30357,7 @@ var createMeshCanvas = (function createMeshCanvasClosure() {
// MAX_PATTERN_SIZE is used to avoid OOM situation. // MAX_PATTERN_SIZE is used to avoid OOM situation.
var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough
// We need to keep transparent border around our pattern for fill(): // We need to keep transparent border around our pattern for fill():
// createPattern with 'no-repeat' will bleed edges accross entire area. // createPattern with 'no-repeat' will bleed edges across entire area.
var BORDER_SIZE = 2; var BORDER_SIZE = 2;
var offsetX = Math.floor(bounds[0]); var offsetX = Math.floor(bounds[0]);
@ -34257,7 +34257,7 @@ var Font = (function FontClosure() {
// Naming tables // Naming tables
builder.addTable('name', createNameTable(fontName)); builder.addTable('name', createNameTable(fontName));
// PostScript informations // PostScript information
builder.addTable('post', createPostTable(properties)); builder.addTable('post', createPostTable(properties));
return builder.toArray(); return builder.toArray();
@ -34634,7 +34634,7 @@ var Type1Font = (function Type1FontClosure() {
(pfbHeader[3] << 8) | pfbHeader[2]; (pfbHeader[3] << 8) | pfbHeader[2];
} }
// Get the data block containing glyphs and subrs informations // Get the data block containing glyphs and subrs information
var headerBlock = getHeaderBlock(file, headerBlockLength); var headerBlock = getHeaderBlock(file, headerBlockLength);
headerBlockLength = headerBlock.length; headerBlockLength = headerBlock.length;
var headerBlockParser = new Type1Parser(headerBlock.stream, false, var headerBlockParser = new Type1Parser(headerBlock.stream, false,
@ -36950,7 +36950,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
var currentCtx = this.ctx; var currentCtx = this.ctx;
// TODO non-isolated groups - according to Rik at adobe non-isolated // TODO non-isolated groups - according to Rik at adobe non-isolated
// group results aren't usually that different and they even have tools // group results aren't usually that different and they even have tools
// that ignore this setting. Notes from Rik on implmenting: // that ignore this setting. Notes from Rik on implementing:
// - When you encounter an transparency group, create a new canvas with // - When you encounter an transparency group, create a new canvas with
// the dimensions of the bbox // the dimensions of the bbox
// - copy the content from the previous canvas to the new canvas // - copy the content from the previous canvas to the new canvas
@ -37805,7 +37805,7 @@ var PDFFunction = (function PDFFunctionClosure() {
// clip to domain // clip to domain
var v = clip(src[srcOffset], domain[0], domain[1]); var v = clip(src[srcOffset], domain[0], domain[1]);
// calulate which bound the value is in // calculate which bound the value is in
for (var i = 0, ii = bounds.length; i < ii; ++i) { for (var i = 0, ii = bounds.length; i < ii; ++i) {
if (v < bounds[i]) { if (v < bounds[i]) {
break; break;
@ -42426,7 +42426,7 @@ var PDFImage = (function PDFImageClosure() {
i += 8; i += 8;
} }
// handle remaing bits // handle remaining bits
if (i < loop2End) { if (i < loop2End) {
buf = buffer[bufferPos++]; buf = buffer[bufferPos++];
mask = 128; mask = 128;
@ -42494,7 +42494,7 @@ var PDFImage = (function PDFImageClosure() {
width, height); width, height);
} }
} else if (isArray(mask)) { } else if (isArray(mask)) {
// Color key mask: if any of the compontents are outside the range // Color key mask: if any of the components are outside the range
// then they should be painted. // then they should be painted.
alphaBuf = new Uint8Array(width * height); alphaBuf = new Uint8Array(width * height);
var numComps = this.numComps; var numComps = this.numComps;
@ -47327,7 +47327,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
// According to the spec if 'FontDescriptor' is declared, 'FirstChar', // According to the spec if 'FontDescriptor' is declared, 'FirstChar',
// 'LastChar' and 'Widths' should exist too, but some PDF encoders seem // 'LastChar' and 'Widths' should exist too, but some PDF encoders seem
// to ignore this rule when a variant of a standart font is used. // to ignore this rule when a variant of a standard font is used.
// TODO Fill the width array depending on which of the base font this is // TODO Fill the width array depending on which of the base font this is
// a variant. // a variant.
var firstChar = (dict.get('FirstChar') || 0); var firstChar = (dict.get('FirstChar') || 0);

16
build/pdf.js

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.5.337'; var pdfjsVersion = '1.5.339';
var pdfjsBuild = '11381cd'; var pdfjsBuild = '3ab68f2';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -1121,7 +1121,7 @@ function isSpace(ch) {
* *
* @typedef {Object} PromiseCapability * @typedef {Object} PromiseCapability
* @property {Promise} promise - A promise object. * @property {Promise} promise - A promise object.
* @property {function} resolve - Fullfills the promise. * @property {function} resolve - Fulfills the promise.
* @property {function} reject - Rejects the promise. * @property {function} reject - Rejects the promise.
*/ */
@ -1144,8 +1144,8 @@ function createPromiseCapability() {
/** /**
* Polyfill for Promises: * Polyfill for Promises:
* The following promise implementation tries to generally implement the * The following promise implementation tries to generally implement the
* Promise/A+ spec. Some notable differences from other promise libaries are: * Promise/A+ spec. Some notable differences from other promise libraries are:
* - There currently isn't a seperate deferred and promise object. * - There currently isn't a separate deferred and promise object.
* - Unhandled rejections eventually show an error if they aren't handled. * - Unhandled rejections eventually show an error if they aren't handled.
* *
* Based off of the work in: * Based off of the work in:
@ -1326,7 +1326,7 @@ function createPromiseCapability() {
* Builds a promise that is resolved when all the passed in promises are * Builds a promise that is resolved when all the passed in promises are
* resolved. * resolved.
* @param {array} promises array of data and/or promises to wait for. * @param {array} promises array of data and/or promises to wait for.
* @return {Promise} New dependant promise. * @return {Promise} New dependent promise.
*/ */
Promise.all = function Promise_all(promises) { Promise.all = function Promise_all(promises) {
var resolveAll, rejectAll; var resolveAll, rejectAll;
@ -5964,7 +5964,7 @@ var createMeshCanvas = (function createMeshCanvasClosure() {
// MAX_PATTERN_SIZE is used to avoid OOM situation. // MAX_PATTERN_SIZE is used to avoid OOM situation.
var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough
// We need to keep transparent border around our pattern for fill(): // We need to keep transparent border around our pattern for fill():
// createPattern with 'no-repeat' will bleed edges accross entire area. // createPattern with 'no-repeat' will bleed edges across entire area.
var BORDER_SIZE = 2; var BORDER_SIZE = 2;
var offsetX = Math.floor(bounds[0]); var offsetX = Math.floor(bounds[0]);
@ -8037,7 +8037,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
var currentCtx = this.ctx; var currentCtx = this.ctx;
// TODO non-isolated groups - according to Rik at adobe non-isolated // TODO non-isolated groups - according to Rik at adobe non-isolated
// group results aren't usually that different and they even have tools // group results aren't usually that different and they even have tools
// that ignore this setting. Notes from Rik on implmenting: // that ignore this setting. Notes from Rik on implementing:
// - When you encounter an transparency group, create a new canvas with // - When you encounter an transparency group, create a new canvas with
// the dimensions of the bbox // the dimensions of the bbox
// - copy the content from the previous canvas to the new canvas // - copy the content from the previous canvas to the new canvas

36
build/pdf.worker.js vendored

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.5.337'; var pdfjsVersion = '1.5.339';
var pdfjsBuild = '11381cd'; var pdfjsBuild = '3ab68f2';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -3142,7 +3142,7 @@ function isSpace(ch) {
* *
* @typedef {Object} PromiseCapability * @typedef {Object} PromiseCapability
* @property {Promise} promise - A promise object. * @property {Promise} promise - A promise object.
* @property {function} resolve - Fullfills the promise. * @property {function} resolve - Fulfills the promise.
* @property {function} reject - Rejects the promise. * @property {function} reject - Rejects the promise.
*/ */
@ -3165,8 +3165,8 @@ function createPromiseCapability() {
/** /**
* Polyfill for Promises: * Polyfill for Promises:
* The following promise implementation tries to generally implement the * The following promise implementation tries to generally implement the
* Promise/A+ spec. Some notable differences from other promise libaries are: * Promise/A+ spec. Some notable differences from other promise libraries are:
* - There currently isn't a seperate deferred and promise object. * - There currently isn't a separate deferred and promise object.
* - Unhandled rejections eventually show an error if they aren't handled. * - Unhandled rejections eventually show an error if they aren't handled.
* *
* Based off of the work in: * Based off of the work in:
@ -3347,7 +3347,7 @@ function createPromiseCapability() {
* Builds a promise that is resolved when all the passed in promises are * Builds a promise that is resolved when all the passed in promises are
* resolved. * resolved.
* @param {array} promises array of data and/or promises to wait for. * @param {array} promises array of data and/or promises to wait for.
* @return {Promise} New dependant promise. * @return {Promise} New dependent promise.
*/ */
Promise.all = function Promise_all(promises) { Promise.all = function Promise_all(promises) {
var resolveAll, rejectAll; var resolveAll, rejectAll;
@ -5215,7 +5215,7 @@ var CFFParser = (function CFFParserClosure() {
break; break;
default: default:
error('Unknow encoding format: ' + format + ' in CFF'); error('Unknown encoding format: ' + format + ' in CFF');
break; break;
} }
var dataEnd = pos; var dataEnd = pos;
@ -5688,7 +5688,7 @@ var CFFCompiler = (function CFFCompilerClosure() {
var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); var globalSubrIndex = this.compileIndex(cff.globalSubrIndex);
output.add(globalSubrIndex); output.add(globalSubrIndex);
// Now start on the other entries that have no specfic order. // Now start on the other entries that have no specific order.
if (cff.encoding && cff.topDict.hasName('Encoding')) { if (cff.encoding && cff.topDict.hasName('Encoding')) {
if (cff.encoding.predefined) { if (cff.encoding.predefined) {
topDictTracker.setEntryLocation('Encoding', [cff.encoding.format], topDictTracker.setEntryLocation('Encoding', [cff.encoding.format],
@ -13450,13 +13450,13 @@ var JpxImage = (function JpxImageClosure() {
var subband = resolution.subbands[j]; var subband = resolution.subbands[j];
var gainLog2 = SubbandsGainLog2[subband.type]; var gainLog2 = SubbandsGainLog2[subband.type];
// calulate quantization coefficient (Section E.1.1.1) // calculate quantization coefficient (Section E.1.1.1)
var delta = (reversible ? 1 : var delta = (reversible ? 1 :
Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048)); Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048));
var mb = (guardBits + epsilon - 1); var mb = (guardBits + epsilon - 1);
// In the first resolution level, copyCoefficients will fill the // In the first resolution level, copyCoefficients will fill the
// whole array with coefficients. In the succeding passes, // whole array with coefficients. In the succeeding passes,
// copyCoefficients will consecutively fill in the values that belong // copyCoefficients will consecutively fill in the values that belong
// to the interleaved positions of the HL, LH, and HH coefficients. // to the interleaved positions of the HL, LH, and HH coefficients.
// The LL coefficients will then be interleaved in Transform.iterate(). // The LL coefficients will then be interleaved in Transform.iterate().
@ -17295,7 +17295,7 @@ exports.getMetrics = getMetrics;
var Uint32ArrayView = sharedUtil.Uint32ArrayView; var Uint32ArrayView = sharedUtil.Uint32ArrayView;
var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) { var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) {
// Workaround for missing math precison in JS. // Workaround for missing math precision in JS.
var MASK_HIGH = 0xffff0000; var MASK_HIGH = 0xffff0000;
var MASK_LOW = 0xffff; var MASK_LOW = 0xffff;
@ -25704,7 +25704,7 @@ var Lexer = (function LexerClosure() {
} else if (ch === 0x2D) { // '-' } else if (ch === 0x2D) { // '-'
// ignore minus signs in the middle of numbers to match // ignore minus signs in the middle of numbers to match
// Adobe's behavior // Adobe's behavior
warn('Badly formated number'); warn('Badly formatted number');
} else if (ch === 0x45 || ch === 0x65) { // 'E', 'e' } else if (ch === 0x45 || ch === 0x65) { // 'E', 'e'
// 'E' can be either a scientific notation or the beginning of a new // 'E' can be either a scientific notation or the beginning of a new
// operator // operator
@ -30393,7 +30393,7 @@ var Font = (function FontClosure() {
// Naming tables // Naming tables
builder.addTable('name', createNameTable(fontName)); builder.addTable('name', createNameTable(fontName));
// PostScript informations // PostScript information
builder.addTable('post', createPostTable(properties)); builder.addTable('post', createPostTable(properties));
return builder.toArray(); return builder.toArray();
@ -30770,7 +30770,7 @@ var Type1Font = (function Type1FontClosure() {
(pfbHeader[3] << 8) | pfbHeader[2]; (pfbHeader[3] << 8) | pfbHeader[2];
} }
// Get the data block containing glyphs and subrs informations // Get the data block containing glyphs and subrs information
var headerBlock = getHeaderBlock(file, headerBlockLength); var headerBlock = getHeaderBlock(file, headerBlockLength);
headerBlockLength = headerBlock.length; headerBlockLength = headerBlock.length;
var headerBlockParser = new Type1Parser(headerBlock.stream, false, var headerBlockParser = new Type1Parser(headerBlock.stream, false,
@ -31637,7 +31637,7 @@ var PDFFunction = (function PDFFunctionClosure() {
// clip to domain // clip to domain
var v = clip(src[srcOffset], domain[0], domain[1]); var v = clip(src[srcOffset], domain[0], domain[1]);
// calulate which bound the value is in // calculate which bound the value is in
for (var i = 0, ii = bounds.length; i < ii; ++i) { for (var i = 0, ii = bounds.length; i < ii; ++i) {
if (v < bounds[i]) { if (v < bounds[i]) {
break; break;
@ -34080,7 +34080,7 @@ var PDFImage = (function PDFImageClosure() {
i += 8; i += 8;
} }
// handle remaing bits // handle remaining bits
if (i < loop2End) { if (i < loop2End) {
buf = buffer[bufferPos++]; buf = buffer[bufferPos++];
mask = 128; mask = 128;
@ -34148,7 +34148,7 @@ var PDFImage = (function PDFImageClosure() {
width, height); width, height);
} }
} else if (isArray(mask)) { } else if (isArray(mask)) {
// Color key mask: if any of the compontents are outside the range // Color key mask: if any of the components are outside the range
// then they should be painted. // then they should be painted.
alphaBuf = new Uint8Array(width * height); alphaBuf = new Uint8Array(width * height);
var numComps = this.numComps; var numComps = this.numComps;
@ -38981,7 +38981,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
// According to the spec if 'FontDescriptor' is declared, 'FirstChar', // According to the spec if 'FontDescriptor' is declared, 'FirstChar',
// 'LastChar' and 'Widths' should exist too, but some PDF encoders seem // 'LastChar' and 'Widths' should exist too, but some PDF encoders seem
// to ignore this rule when a variant of a standart font is used. // to ignore this rule when a variant of a standard font is used.
// TODO Fill the width array depending on which of the base font this is // TODO Fill the width array depending on which of the base font this is
// a variant. // a variant.
var firstChar = (dict.get('FirstChar') || 0); var firstChar = (dict.get('FirstChar') || 0);

2
package.json

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

2
web/pdf_viewer.js

@ -2800,7 +2800,7 @@ var PDFPageView = (function PDFPageViewClosure() {
}, function(error) { }, function(error) {
console.error(error); console.error(error);
// Tell the printEngine that rendering this canvas/page has failed. // Tell the printEngine that rendering this canvas/page has failed.
// This will make the print proces stop. // This will make the print process stop.
if ('abort' in obj) { if ('abort' in obj) {
obj.abort(); obj.abort();
} else { } else {

Loading…
Cancel
Save