Browse Source

PDF.js version 1.9.514 - See mozilla/pdf.js@22ade754cc97cf354f3fa7b578260117fae4e699

master v1.9.514
pdfjsbot 7 years ago
parent
commit
2a88dc5311
  1. 2
      bower.json
  2. 97
      build/pdf.combined.js
  3. 2
      build/pdf.combined.js.map
  4. 27
      build/pdf.js
  5. 2
      build/pdf.js.map
  6. 2
      build/pdf.min.js
  7. 82
      build/pdf.worker.js
  8. 2
      build/pdf.worker.js.map
  9. 2
      build/pdf.worker.min.js
  10. 8
      lib/core/annotation.js
  11. 2
      lib/core/chunked_stream.js
  12. 14
      lib/core/cmap.js
  13. 4
      lib/core/crypto.js
  14. 2
      lib/core/fonts.js
  15. 26
      lib/core/obj.js
  16. 12
      lib/core/parser.js
  17. 2
      lib/core/stream.js
  18. 6
      lib/display/api.js
  19. 4
      lib/display/global.js
  20. 5
      lib/display/network_utils.js
  21. 4
      lib/pdf.js
  22. 4
      lib/pdf.worker.js
  23. 8
      lib/shared/util.js
  24. 4
      lib/test/unit/fonts_spec.js
  25. 2
      package.json

2
bower.json

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

97
build/pdf.combined.js

@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap @@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isNodeJS = exports.isSpace = exports.isString = exports.isNum = exports.isInt = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.isArray = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.StatTimer = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isNodeJS = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.isArray = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.StatTimer = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
@ -713,7 +713,7 @@ var Util = function UtilClosure() { @@ -713,7 +713,7 @@ var Util = function UtilClosure() {
};
var ROMAN_NUMBER_MAP = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];
Util.toRoman = function Util_toRoman(number, lowerCase) {
assert(isInt(number) && number > 0, 'The number should be a positive integer.');
assert(Number.isInteger(number) && number > 0, 'The number should be a positive integer.');
var pos,
romanBuf = [];
while (number >= 1000) {
@ -886,9 +886,6 @@ function isEmptyObj(obj) { @@ -886,9 +886,6 @@ function isEmptyObj(obj) {
function isBool(v) {
return typeof v === 'boolean';
}
function isInt(v) {
return typeof v === 'number' && (v | 0) === v;
}
function isNum(v) {
return typeof v === 'number';
}
@ -1459,7 +1456,6 @@ exports.isArray = isArray; @@ -1459,7 +1456,6 @@ exports.isArray = isArray;
exports.isArrayBuffer = isArrayBuffer;
exports.isBool = isBool;
exports.isEmptyObj = isEmptyObj;
exports.isInt = isInt;
exports.isNum = isNum;
exports.isString = isString;
exports.isSpace = isSpace;
@ -2465,7 +2461,7 @@ var JpegStream = function JpegStreamClosure() { @@ -2465,7 +2461,7 @@ var JpegStream = function JpegStreamClosure() {
}
if ((0, _primitives.isDict)(this.params)) {
var colorTransform = this.params.get('ColorTransform');
if ((0, _util.isInt)(colorTransform)) {
if (Number.isInteger(colorTransform)) {
jpegImage.colorTransform = colorTransform;
}
}
@ -5044,9 +5040,9 @@ var Parser = function ParserClosure() { @@ -5044,9 +5040,9 @@ var Parser = function ParserClosure() {
return buf1;
}
}
if ((0, _util.isInt)(buf1)) {
if (Number.isInteger(buf1)) {
var num = buf1;
if ((0, _util.isInt)(this.buf1) && (0, _primitives.isCmd)(this.buf2, 'R')) {
if (Number.isInteger(this.buf1) && (0, _primitives.isCmd)(this.buf2, 'R')) {
var ref = new _primitives.Ref(num, this.buf1);
this.shift();
this.shift();
@ -5323,7 +5319,7 @@ var Parser = function ParserClosure() { @@ -5323,7 +5319,7 @@ var Parser = function ParserClosure() {
lexer.skipToNextLine();
var pos = stream.pos - 1;
var length = dict.get('Length');
if (!(0, _util.isInt)(length)) {
if (!Number.isInteger(length)) {
(0, _util.info)('Bad ' + length + ' attribute in stream');
length = 0;
}
@ -5863,7 +5859,7 @@ var Linearization = { @@ -5863,7 +5859,7 @@ var Linearization = {
create: function LinearizationCreate(stream) {
function getInt(name, allowZeroValue) {
var obj = linDict.get(name);
if ((0, _util.isInt)(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) {
if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) {
return obj;
}
throw new Error('The "' + name + '" parameter in the linearization ' + 'dictionary is invalid.');
@ -5874,7 +5870,7 @@ var Linearization = { @@ -5874,7 +5870,7 @@ var Linearization = {
item;
if ((0, _util.isArray)(hints) && ((hintsLength = hints.length) === 2 || hintsLength === 4)) {
for (var index = 0; index < hintsLength; index++) {
if (!((0, _util.isInt)(item = hints[index]) && item > 0)) {
if (!(Number.isInteger(item = hints[index]) && item > 0)) {
throw new Error('Hint (' + index + ') in the linearization dictionary is invalid.');
}
}
@ -5888,7 +5884,7 @@ var Linearization = { @@ -5888,7 +5884,7 @@ var Linearization = {
var obj3 = parser.getObj();
var linDict = parser.getObj();
var obj, length;
if (!((0, _util.isInt)(obj1) && (0, _util.isInt)(obj2) && (0, _primitives.isCmd)(obj3, 'obj') && (0, _primitives.isDict)(linDict) && (0, _util.isNum)(obj = linDict.get('Linearized')) && obj > 0)) {
if (!(Number.isInteger(obj1) && Number.isInteger(obj2) && (0, _primitives.isCmd)(obj3, 'obj') && (0, _primitives.isDict)(linDict) && (0, _util.isNum)(obj = linDict.get('Linearized')) && obj > 0)) {
return null;
} else if ((length = getInt('L')) !== stream.length) {
throw new Error('The "L" parameter in the linearization dictionary ' + 'does not equal the stream length.');
@ -11598,9 +11594,8 @@ function validateRangeRequestCapabilities(_ref) { @@ -11598,9 +11594,8 @@ function validateRangeRequestCapabilities(_ref) {
if (contentEncoding !== 'identity') {
return returnValues;
}
var length = getResponseHeader('Content-Length');
length = parseInt(length, 10);
if (!(0, _util.isInt)(length)) {
var length = parseInt(getResponseHeader('Content-Length'), 10);
if (!Number.isInteger(length)) {
return returnValues;
}
returnValues.suggestedLength = length;
@ -13171,7 +13166,7 @@ var WorkerTransport = function WorkerTransportClosure() { @@ -13171,7 +13166,7 @@ var WorkerTransport = function WorkerTransportClosure() {
getPage: function WorkerTransport_getPage(pageNumber, capability) {
var _this12 = this;
if (!(0, _util.isInt)(pageNumber) || pageNumber <= 0 || pageNumber > this.numPages) {
if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this.numPages) {
return Promise.reject(new Error('Invalid page request'));
}
var pageIndex = pageNumber - 1;
@ -13458,8 +13453,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -13458,8 +13453,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.9.512';
exports.build = build = '066fea9c';
exports.version = version = '1.9.514';
exports.build = build = '22ade754';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -14347,7 +14342,7 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() { @@ -14347,7 +14342,7 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() {
} else {
nextEmptyChunk = this.stream.nextEmptyChunk(endChunk);
}
if ((0, _util.isInt)(nextEmptyChunk)) {
if (Number.isInteger(nextEmptyChunk)) {
this._requestChunks([nextEmptyChunk]);
}
}
@ -14552,7 +14547,7 @@ var Catalog = function CatalogClosure() { @@ -14552,7 +14547,7 @@ var Catalog = function CatalogClosure() {
},
get numPages() {
var obj = this.toplevelPagesDict.get('Count');
if (!(0, _util.isInt)(obj)) {
if (!Number.isInteger(obj)) {
throw new _util.FormatError('page count in top level pages object is not an integer');
}
return (0, _util.shadow)(this, 'numPages', obj);
@ -14660,7 +14655,7 @@ var Catalog = function CatalogClosure() { @@ -14660,7 +14655,7 @@ var Catalog = function CatalogClosure() {
}
prefix = p ? (0, _util.stringToPDFString)(p) : '';
var st = labelDict.get('St');
if (st && !((0, _util.isInt)(st) && st >= 1)) {
if (st && !(Number.isInteger(st) && st >= 1)) {
throw new _util.FormatError('Invalid start in PageLabel dictionary.');
}
currentIndex = st || 1;
@ -15146,7 +15141,7 @@ var XRef = function XRefClosure() { @@ -15146,7 +15141,7 @@ var XRef = function XRefClosure() {
}
var first = tableState.firstEntryNum;
var count = tableState.entryCount;
if (!(0, _util.isInt)(first) || !(0, _util.isInt)(count)) {
if (!Number.isInteger(first) || !Number.isInteger(count)) {
throw new _util.FormatError('Invalid XRef table: wrong types in subsection header');
}
for (var i = tableState.entryNum; i < count; i++) {
@ -15163,7 +15158,7 @@ var XRef = function XRefClosure() { @@ -15163,7 +15158,7 @@ var XRef = function XRefClosure() {
} else if ((0, _primitives.isCmd)(type, 'n')) {
entry.uncompressed = true;
}
if (!(0, _util.isInt)(entry.offset) || !(0, _util.isInt)(entry.gen) || !(entry.free || entry.uncompressed)) {
if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) {
throw new _util.FormatError('Invalid entry in XRef subsection: ' + first + ', ' + count);
}
if (i === 0 && entry.free && first === 1) {
@ -15216,10 +15211,10 @@ var XRef = function XRefClosure() { @@ -15216,10 +15211,10 @@ var XRef = function XRefClosure() {
while (entryRanges.length > 0) {
var first = entryRanges[0];
var n = entryRanges[1];
if (!(0, _util.isInt)(first) || !(0, _util.isInt)(n)) {
if (!Number.isInteger(first) || !Number.isInteger(n)) {
throw new _util.FormatError('Invalid XRef range fields: ' + first + ', ' + n);
}
if (!(0, _util.isInt)(typeFieldWidth) || !(0, _util.isInt)(offsetFieldWidth) || !(0, _util.isInt)(generationFieldWidth)) {
if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) {
throw new _util.FormatError('Invalid XRef entry fields length: ' + first + ', ' + n);
}
for (i = streamState.entryNum; i < n; ++i) {
@ -15406,15 +15401,15 @@ var XRef = function XRefClosure() { @@ -15406,15 +15401,15 @@ var XRef = function XRefClosure() {
this.topDict = dict;
}
obj = dict.get('XRefStm');
if ((0, _util.isInt)(obj)) {
if (Number.isInteger(obj)) {
var pos = obj;
if (!(pos in this.xrefstms)) {
this.xrefstms[pos] = 1;
this.startXRefQueue.push(pos);
}
}
} else if ((0, _util.isInt)(obj)) {
if (!(0, _util.isInt)(parser.getObj()) || !(0, _primitives.isCmd)(parser.getObj(), 'obj') || !(0, _primitives.isStream)(obj = parser.getObj())) {
} else if (Number.isInteger(obj)) {
if (!Number.isInteger(parser.getObj()) || !(0, _primitives.isCmd)(parser.getObj(), 'obj') || !(0, _primitives.isStream)(obj = parser.getObj())) {
throw new _util.FormatError('Invalid XRef stream');
}
dict = this.processXRefStream(obj);
@ -15428,7 +15423,7 @@ var XRef = function XRefClosure() { @@ -15428,7 +15423,7 @@ var XRef = function XRefClosure() {
throw new _util.FormatError('Invalid XRef stream header');
}
obj = dict.get('Prev');
if ((0, _util.isInt)(obj)) {
if (Number.isInteger(obj)) {
this.startXRefQueue.push(obj);
} else if ((0, _primitives.isRef)(obj)) {
this.startXRefQueue.push(obj.num);
@ -15535,7 +15530,7 @@ var XRef = function XRefClosure() { @@ -15535,7 +15530,7 @@ var XRef = function XRefClosure() {
}
var first = stream.dict.get('First');
var n = stream.dict.get('N');
if (!(0, _util.isInt)(first) || !(0, _util.isInt)(n)) {
if (!Number.isInteger(first) || !Number.isInteger(n)) {
throw new _util.FormatError('invalid first and n parameters for ObjStm stream');
}
var parser = new _parser.Parser(new _parser.Lexer(stream), false, this);
@ -15546,12 +15541,12 @@ var XRef = function XRefClosure() { @@ -15546,12 +15541,12 @@ var XRef = function XRefClosure() {
nums = [];
for (i = 0; i < n; ++i) {
num = parser.getObj();
if (!(0, _util.isInt)(num)) {
if (!Number.isInteger(num)) {
throw new _util.FormatError('invalid object number in the ObjStm stream: ' + num);
}
nums.push(num);
var offset = parser.getObj();
if (!(0, _util.isInt)(offset)) {
if (!Number.isInteger(offset)) {
throw new _util.FormatError('invalid object offset in the ObjStm stream: ' + offset);
}
}
@ -19614,7 +19609,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() { @@ -19614,7 +19609,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
}
this.dict = dict;
var algorithm = dict.get('V');
if (!(0, _util.isInt)(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) {
if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) {
throw new _util.FormatError('unsupported encryption algorithm');
}
this.algorithm = algorithm;
@ -19635,7 +19630,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() { @@ -19635,7 +19630,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
}
}
}
if (!(0, _util.isInt)(keyLength) || keyLength < 40 || keyLength % 8 !== 0) {
if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) {
throw new _util.FormatError('invalid key length');
}
var ownerPassword = (0, _util.stringToBytes)(dict.get('O')).subarray(0, 32);
@ -29222,8 +29217,8 @@ exports.SVGGraphics = SVGGraphics; @@ -29222,8 +29217,8 @@ exports.SVGGraphics = SVGGraphics;
"use strict";
var pdfjsVersion = '1.9.512';
var pdfjsBuild = '066fea9c';
var pdfjsVersion = '1.9.514';
var pdfjsBuild = '22ade754';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(98);
var pdfjsDisplayAPI = __w_pdfjs_require__(55);
@ -35085,8 +35080,8 @@ if (!_global_scope2.default.PDFJS) { @@ -35085,8 +35080,8 @@ if (!_global_scope2.default.PDFJS) {
}
var PDFJS = _global_scope2.default.PDFJS;
{
PDFJS.version = '1.9.512';
PDFJS.build = '066fea9c';
PDFJS.version = '1.9.514';
PDFJS.build = '22ade754';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
@ -41671,10 +41666,10 @@ var IdentityCMap = function IdentityCMapClosure() { @@ -41671,10 +41666,10 @@ var IdentityCMap = function IdentityCMapClosure() {
throw new Error('should not call mapCidOne');
},
lookup: function lookup(code) {
return (0, _util.isInt)(code) && code <= 0xffff ? code : undefined;
return Number.isInteger(code) && code <= 0xffff ? code : undefined;
},
contains: function contains(code) {
return (0, _util.isInt)(code) && code <= 0xffff;
return Number.isInteger(code) && code <= 0xffff;
},
forEach: function forEach(callback) {
for (var i = 0; i <= 0xffff; i++) {
@ -41682,7 +41677,7 @@ var IdentityCMap = function IdentityCMapClosure() { @@ -41682,7 +41677,7 @@ var IdentityCMap = function IdentityCMapClosure() {
}
},
charCodeOf: function charCodeOf(value) {
return (0, _util.isInt)(value) && value <= 0xffff ? value : -1;
return Number.isInteger(value) && value <= 0xffff ? value : -1;
},
getMap: function getMap() {
var map = new Array(0x10000);
@ -41978,7 +41973,7 @@ var CMapFactory = function CMapFactoryClosure() { @@ -41978,7 +41973,7 @@ var CMapFactory = function CMapFactoryClosure() {
}
}
function expectInt(obj) {
if (!(0, _util.isInt)(obj)) {
if (!Number.isInteger(obj)) {
throw new _util.FormatError('Malformed CMap: expected int.');
}
}
@ -42014,8 +42009,8 @@ var CMapFactory = function CMapFactoryClosure() { @@ -42014,8 +42009,8 @@ var CMapFactory = function CMapFactoryClosure() {
expectString(obj);
var high = strToInt(obj);
obj = lexer.getObj();
if ((0, _util.isInt)(obj) || (0, _util.isString)(obj)) {
var dstLow = (0, _util.isInt)(obj) ? String.fromCharCode(obj) : obj;
if (Number.isInteger(obj) || (0, _util.isString)(obj)) {
var dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj;
cMap.mapBfRange(low, high, dstLow);
} else if ((0, _primitives.isCmd)(obj, '[')) {
obj = lexer.getObj();
@ -42092,7 +42087,7 @@ var CMapFactory = function CMapFactoryClosure() { @@ -42092,7 +42087,7 @@ var CMapFactory = function CMapFactoryClosure() {
}
function parseWMode(cMap, lexer) {
var obj = lexer.getObj();
if ((0, _util.isInt)(obj)) {
if (Number.isInteger(obj)) {
cMap.vertical = !!obj;
}
}
@ -42429,7 +42424,7 @@ var IdentityToUnicodeMap = function IdentityToUnicodeMapClosure() { @@ -42429,7 +42424,7 @@ var IdentityToUnicodeMap = function IdentityToUnicodeMapClosure() {
return undefined;
},
charCodeOf: function charCodeOf(v) {
return (0, _util.isInt)(v) && v >= this.firstChar && v <= this.lastChar ? v : -1;
return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar ? v : -1;
},
amend: function amend(map) {
throw new Error('Should not call amend()');
@ -50747,7 +50742,7 @@ var Annotation = function () { @@ -50747,7 +50742,7 @@ var Annotation = function () {
}, {
key: 'setFlags',
value: function setFlags(flags) {
this.flags = (0, _util.isInt)(flags) && flags > 0 ? flags : 0;
this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0;
}
}, {
key: 'hasFlag',
@ -51023,7 +51018,7 @@ var WidgetAnnotation = function (_Annotation) { @@ -51023,7 +51018,7 @@ var WidgetAnnotation = function (_Annotation) {
data.fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null;
_this2.fieldResources = _util.Util.getInheritableProperty(dict, 'DR') || _primitives.Dict.empty;
data.fieldFlags = _util.Util.getInheritableProperty(dict, 'Ff');
if (!(0, _util.isInt)(data.fieldFlags) || data.fieldFlags < 0) {
if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) {
data.fieldFlags = 0;
}
data.readOnly = _this2.hasFieldFlag(_util.AnnotationFieldFlag.READONLY);
@ -51087,12 +51082,12 @@ var TextWidgetAnnotation = function (_WidgetAnnotation) { @@ -51087,12 +51082,12 @@ var TextWidgetAnnotation = function (_WidgetAnnotation) {
_this3.data.fieldValue = (0, _util.stringToPDFString)(_this3.data.fieldValue || '');
var alignment = _util.Util.getInheritableProperty(params.dict, 'Q');
if (!(0, _util.isInt)(alignment) || alignment < 0 || alignment > 2) {
if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) {
alignment = null;
}
_this3.data.textAlignment = alignment;
var maximumLength = _util.Util.getInheritableProperty(params.dict, 'MaxLen');
if (!(0, _util.isInt)(maximumLength) || maximumLength < 0) {
if (!Number.isInteger(maximumLength) || maximumLength < 0) {
maximumLength = null;
}
_this3.data.maxLen = maximumLength;

2
build/pdf.combined.js.map

File diff suppressed because one or more lines are too long

27
build/pdf.js

@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap @@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isNodeJS = exports.isSpace = exports.isString = exports.isNum = exports.isInt = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.isArray = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.StatTimer = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isNodeJS = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.isArray = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.StatTimer = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
@ -713,7 +713,7 @@ var Util = function UtilClosure() { @@ -713,7 +713,7 @@ var Util = function UtilClosure() {
};
var ROMAN_NUMBER_MAP = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];
Util.toRoman = function Util_toRoman(number, lowerCase) {
assert(isInt(number) && number > 0, 'The number should be a positive integer.');
assert(Number.isInteger(number) && number > 0, 'The number should be a positive integer.');
var pos,
romanBuf = [];
while (number >= 1000) {
@ -886,9 +886,6 @@ function isEmptyObj(obj) { @@ -886,9 +886,6 @@ function isEmptyObj(obj) {
function isBool(v) {
return typeof v === 'boolean';
}
function isInt(v) {
return typeof v === 'number' && (v | 0) === v;
}
function isNum(v) {
return typeof v === 'number';
}
@ -1459,7 +1456,6 @@ exports.isArray = isArray; @@ -1459,7 +1456,6 @@ exports.isArray = isArray;
exports.isArrayBuffer = isArrayBuffer;
exports.isBool = isBool;
exports.isEmptyObj = isEmptyObj;
exports.isInt = isInt;
exports.isNum = isNum;
exports.isString = isString;
exports.isSpace = isSpace;
@ -2213,9 +2209,8 @@ function validateRangeRequestCapabilities(_ref) { @@ -2213,9 +2209,8 @@ function validateRangeRequestCapabilities(_ref) {
if (contentEncoding !== 'identity') {
return returnValues;
}
var length = getResponseHeader('Content-Length');
length = parseInt(length, 10);
if (!(0, _util.isInt)(length)) {
var length = parseInt(getResponseHeader('Content-Length'), 10);
if (!Number.isInteger(length)) {
return returnValues;
}
returnValues.suggestedLength = length;
@ -3898,7 +3893,7 @@ var WorkerTransport = function WorkerTransportClosure() { @@ -3898,7 +3893,7 @@ var WorkerTransport = function WorkerTransportClosure() {
getPage: function WorkerTransport_getPage(pageNumber, capability) {
var _this13 = this;
if (!(0, _util.isInt)(pageNumber) || pageNumber <= 0 || pageNumber > this.numPages) {
if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this.numPages) {
return Promise.reject(new Error('Invalid page request'));
}
var pageIndex = pageNumber - 1;
@ -4185,8 +4180,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -4185,8 +4180,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.9.512';
exports.build = build = '066fea9c';
exports.version = version = '1.9.514';
exports.build = build = '22ade754';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -7064,8 +7059,8 @@ exports.SVGGraphics = SVGGraphics; @@ -7064,8 +7059,8 @@ exports.SVGGraphics = SVGGraphics;
"use strict";
var pdfjsVersion = '1.9.512';
var pdfjsBuild = '066fea9c';
var pdfjsVersion = '1.9.514';
var pdfjsBuild = '22ade754';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(82);
var pdfjsDisplayAPI = __w_pdfjs_require__(48);
@ -12927,8 +12922,8 @@ if (!_global_scope2.default.PDFJS) { @@ -12927,8 +12922,8 @@ if (!_global_scope2.default.PDFJS) {
}
var PDFJS = _global_scope2.default.PDFJS;
{
PDFJS.version = '1.9.512';
PDFJS.build = '066fea9c';
PDFJS.version = '1.9.514';
PDFJS.build = '22ade754';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {

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

82
build/pdf.worker.js vendored

@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap @@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isNodeJS = exports.isSpace = exports.isString = exports.isNum = exports.isInt = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.isArray = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.StatTimer = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isNodeJS = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.isArray = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.StatTimer = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
@ -713,7 +713,7 @@ var Util = function UtilClosure() { @@ -713,7 +713,7 @@ var Util = function UtilClosure() {
};
var ROMAN_NUMBER_MAP = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];
Util.toRoman = function Util_toRoman(number, lowerCase) {
assert(isInt(number) && number > 0, 'The number should be a positive integer.');
assert(Number.isInteger(number) && number > 0, 'The number should be a positive integer.');
var pos,
romanBuf = [];
while (number >= 1000) {
@ -886,9 +886,6 @@ function isEmptyObj(obj) { @@ -886,9 +886,6 @@ function isEmptyObj(obj) {
function isBool(v) {
return typeof v === 'boolean';
}
function isInt(v) {
return typeof v === 'number' && (v | 0) === v;
}
function isNum(v) {
return typeof v === 'number';
}
@ -1459,7 +1456,6 @@ exports.isArray = isArray; @@ -1459,7 +1456,6 @@ exports.isArray = isArray;
exports.isArrayBuffer = isArrayBuffer;
exports.isBool = isBool;
exports.isEmptyObj = isEmptyObj;
exports.isInt = isInt;
exports.isNum = isNum;
exports.isString = isString;
exports.isSpace = isSpace;
@ -2465,7 +2461,7 @@ var JpegStream = function JpegStreamClosure() { @@ -2465,7 +2461,7 @@ var JpegStream = function JpegStreamClosure() {
}
if ((0, _primitives.isDict)(this.params)) {
var colorTransform = this.params.get('ColorTransform');
if ((0, _util.isInt)(colorTransform)) {
if (Number.isInteger(colorTransform)) {
jpegImage.colorTransform = colorTransform;
}
}
@ -4741,9 +4737,9 @@ var Parser = function ParserClosure() { @@ -4741,9 +4737,9 @@ var Parser = function ParserClosure() {
return buf1;
}
}
if ((0, _util.isInt)(buf1)) {
if (Number.isInteger(buf1)) {
var num = buf1;
if ((0, _util.isInt)(this.buf1) && (0, _primitives.isCmd)(this.buf2, 'R')) {
if (Number.isInteger(this.buf1) && (0, _primitives.isCmd)(this.buf2, 'R')) {
var ref = new _primitives.Ref(num, this.buf1);
this.shift();
this.shift();
@ -5020,7 +5016,7 @@ var Parser = function ParserClosure() { @@ -5020,7 +5016,7 @@ var Parser = function ParserClosure() {
lexer.skipToNextLine();
var pos = stream.pos - 1;
var length = dict.get('Length');
if (!(0, _util.isInt)(length)) {
if (!Number.isInteger(length)) {
(0, _util.info)('Bad ' + length + ' attribute in stream');
length = 0;
}
@ -5560,7 +5556,7 @@ var Linearization = { @@ -5560,7 +5556,7 @@ var Linearization = {
create: function LinearizationCreate(stream) {
function getInt(name, allowZeroValue) {
var obj = linDict.get(name);
if ((0, _util.isInt)(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) {
if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) {
return obj;
}
throw new Error('The "' + name + '" parameter in the linearization ' + 'dictionary is invalid.');
@ -5571,7 +5567,7 @@ var Linearization = { @@ -5571,7 +5567,7 @@ var Linearization = {
item;
if ((0, _util.isArray)(hints) && ((hintsLength = hints.length) === 2 || hintsLength === 4)) {
for (var index = 0; index < hintsLength; index++) {
if (!((0, _util.isInt)(item = hints[index]) && item > 0)) {
if (!(Number.isInteger(item = hints[index]) && item > 0)) {
throw new Error('Hint (' + index + ') in the linearization dictionary is invalid.');
}
}
@ -5585,7 +5581,7 @@ var Linearization = { @@ -5585,7 +5581,7 @@ var Linearization = {
var obj3 = parser.getObj();
var linDict = parser.getObj();
var obj, length;
if (!((0, _util.isInt)(obj1) && (0, _util.isInt)(obj2) && (0, _primitives.isCmd)(obj3, 'obj') && (0, _primitives.isDict)(linDict) && (0, _util.isNum)(obj = linDict.get('Linearized')) && obj > 0)) {
if (!(Number.isInteger(obj1) && Number.isInteger(obj2) && (0, _primitives.isCmd)(obj3, 'obj') && (0, _primitives.isDict)(linDict) && (0, _util.isNum)(obj = linDict.get('Linearized')) && obj > 0)) {
return null;
} else if ((length = getInt('L')) !== stream.length) {
throw new Error('The "L" parameter in the linearization dictionary ' + 'does not equal the stream length.');
@ -12058,7 +12054,7 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() { @@ -12058,7 +12054,7 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() {
} else {
nextEmptyChunk = this.stream.nextEmptyChunk(endChunk);
}
if ((0, _util.isInt)(nextEmptyChunk)) {
if (Number.isInteger(nextEmptyChunk)) {
this._requestChunks([nextEmptyChunk]);
}
}
@ -12263,7 +12259,7 @@ var Catalog = function CatalogClosure() { @@ -12263,7 +12259,7 @@ var Catalog = function CatalogClosure() {
},
get numPages() {
var obj = this.toplevelPagesDict.get('Count');
if (!(0, _util.isInt)(obj)) {
if (!Number.isInteger(obj)) {
throw new _util.FormatError('page count in top level pages object is not an integer');
}
return (0, _util.shadow)(this, 'numPages', obj);
@ -12371,7 +12367,7 @@ var Catalog = function CatalogClosure() { @@ -12371,7 +12367,7 @@ var Catalog = function CatalogClosure() {
}
prefix = p ? (0, _util.stringToPDFString)(p) : '';
var st = labelDict.get('St');
if (st && !((0, _util.isInt)(st) && st >= 1)) {
if (st && !(Number.isInteger(st) && st >= 1)) {
throw new _util.FormatError('Invalid start in PageLabel dictionary.');
}
currentIndex = st || 1;
@ -12857,7 +12853,7 @@ var XRef = function XRefClosure() { @@ -12857,7 +12853,7 @@ var XRef = function XRefClosure() {
}
var first = tableState.firstEntryNum;
var count = tableState.entryCount;
if (!(0, _util.isInt)(first) || !(0, _util.isInt)(count)) {
if (!Number.isInteger(first) || !Number.isInteger(count)) {
throw new _util.FormatError('Invalid XRef table: wrong types in subsection header');
}
for (var i = tableState.entryNum; i < count; i++) {
@ -12874,7 +12870,7 @@ var XRef = function XRefClosure() { @@ -12874,7 +12870,7 @@ var XRef = function XRefClosure() {
} else if ((0, _primitives.isCmd)(type, 'n')) {
entry.uncompressed = true;
}
if (!(0, _util.isInt)(entry.offset) || !(0, _util.isInt)(entry.gen) || !(entry.free || entry.uncompressed)) {
if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) {
throw new _util.FormatError('Invalid entry in XRef subsection: ' + first + ', ' + count);
}
if (i === 0 && entry.free && first === 1) {
@ -12927,10 +12923,10 @@ var XRef = function XRefClosure() { @@ -12927,10 +12923,10 @@ var XRef = function XRefClosure() {
while (entryRanges.length > 0) {
var first = entryRanges[0];
var n = entryRanges[1];
if (!(0, _util.isInt)(first) || !(0, _util.isInt)(n)) {
if (!Number.isInteger(first) || !Number.isInteger(n)) {
throw new _util.FormatError('Invalid XRef range fields: ' + first + ', ' + n);
}
if (!(0, _util.isInt)(typeFieldWidth) || !(0, _util.isInt)(offsetFieldWidth) || !(0, _util.isInt)(generationFieldWidth)) {
if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) {
throw new _util.FormatError('Invalid XRef entry fields length: ' + first + ', ' + n);
}
for (i = streamState.entryNum; i < n; ++i) {
@ -13117,15 +13113,15 @@ var XRef = function XRefClosure() { @@ -13117,15 +13113,15 @@ var XRef = function XRefClosure() {
this.topDict = dict;
}
obj = dict.get('XRefStm');
if ((0, _util.isInt)(obj)) {
if (Number.isInteger(obj)) {
var pos = obj;
if (!(pos in this.xrefstms)) {
this.xrefstms[pos] = 1;
this.startXRefQueue.push(pos);
}
}
} else if ((0, _util.isInt)(obj)) {
if (!(0, _util.isInt)(parser.getObj()) || !(0, _primitives.isCmd)(parser.getObj(), 'obj') || !(0, _primitives.isStream)(obj = parser.getObj())) {
} else if (Number.isInteger(obj)) {
if (!Number.isInteger(parser.getObj()) || !(0, _primitives.isCmd)(parser.getObj(), 'obj') || !(0, _primitives.isStream)(obj = parser.getObj())) {
throw new _util.FormatError('Invalid XRef stream');
}
dict = this.processXRefStream(obj);
@ -13139,7 +13135,7 @@ var XRef = function XRefClosure() { @@ -13139,7 +13135,7 @@ var XRef = function XRefClosure() {
throw new _util.FormatError('Invalid XRef stream header');
}
obj = dict.get('Prev');
if ((0, _util.isInt)(obj)) {
if (Number.isInteger(obj)) {
this.startXRefQueue.push(obj);
} else if ((0, _primitives.isRef)(obj)) {
this.startXRefQueue.push(obj.num);
@ -13246,7 +13242,7 @@ var XRef = function XRefClosure() { @@ -13246,7 +13242,7 @@ var XRef = function XRefClosure() {
}
var first = stream.dict.get('First');
var n = stream.dict.get('N');
if (!(0, _util.isInt)(first) || !(0, _util.isInt)(n)) {
if (!Number.isInteger(first) || !Number.isInteger(n)) {
throw new _util.FormatError('invalid first and n parameters for ObjStm stream');
}
var parser = new _parser.Parser(new _parser.Lexer(stream), false, this);
@ -13257,12 +13253,12 @@ var XRef = function XRefClosure() { @@ -13257,12 +13253,12 @@ var XRef = function XRefClosure() {
nums = [];
for (i = 0; i < n; ++i) {
num = parser.getObj();
if (!(0, _util.isInt)(num)) {
if (!Number.isInteger(num)) {
throw new _util.FormatError('invalid object number in the ObjStm stream: ' + num);
}
nums.push(num);
var offset = parser.getObj();
if (!(0, _util.isInt)(offset)) {
if (!Number.isInteger(offset)) {
throw new _util.FormatError('invalid object offset in the ObjStm stream: ' + offset);
}
}
@ -17325,7 +17321,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() { @@ -17325,7 +17321,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
}
this.dict = dict;
var algorithm = dict.get('V');
if (!(0, _util.isInt)(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) {
if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) {
throw new _util.FormatError('unsupported encryption algorithm');
}
this.algorithm = algorithm;
@ -17346,7 +17342,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() { @@ -17346,7 +17342,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
}
}
}
if (!(0, _util.isInt)(keyLength) || keyLength < 40 || keyLength % 8 !== 0) {
if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) {
throw new _util.FormatError('invalid key length');
}
var ownerPassword = (0, _util.stringToBytes)(dict.get('O')).subarray(0, 32);
@ -24523,8 +24519,8 @@ exports.getUnicodeForGlyph = getUnicodeForGlyph; @@ -24523,8 +24519,8 @@ exports.getUnicodeForGlyph = getUnicodeForGlyph;
"use strict";
var pdfjsVersion = '1.9.512';
var pdfjsBuild = '066fea9c';
var pdfjsVersion = '1.9.514';
var pdfjsBuild = '22ade754';
var pdfjsCoreWorker = __w_pdfjs_require__(62);
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
@ -34145,10 +34141,10 @@ var IdentityCMap = function IdentityCMapClosure() { @@ -34145,10 +34141,10 @@ var IdentityCMap = function IdentityCMapClosure() {
throw new Error('should not call mapCidOne');
},
lookup: function lookup(code) {
return (0, _util.isInt)(code) && code <= 0xffff ? code : undefined;
return Number.isInteger(code) && code <= 0xffff ? code : undefined;
},
contains: function contains(code) {
return (0, _util.isInt)(code) && code <= 0xffff;
return Number.isInteger(code) && code <= 0xffff;
},
forEach: function forEach(callback) {
for (var i = 0; i <= 0xffff; i++) {
@ -34156,7 +34152,7 @@ var IdentityCMap = function IdentityCMapClosure() { @@ -34156,7 +34152,7 @@ var IdentityCMap = function IdentityCMapClosure() {
}
},
charCodeOf: function charCodeOf(value) {
return (0, _util.isInt)(value) && value <= 0xffff ? value : -1;
return Number.isInteger(value) && value <= 0xffff ? value : -1;
},
getMap: function getMap() {
var map = new Array(0x10000);
@ -34452,7 +34448,7 @@ var CMapFactory = function CMapFactoryClosure() { @@ -34452,7 +34448,7 @@ var CMapFactory = function CMapFactoryClosure() {
}
}
function expectInt(obj) {
if (!(0, _util.isInt)(obj)) {
if (!Number.isInteger(obj)) {
throw new _util.FormatError('Malformed CMap: expected int.');
}
}
@ -34488,8 +34484,8 @@ var CMapFactory = function CMapFactoryClosure() { @@ -34488,8 +34484,8 @@ var CMapFactory = function CMapFactoryClosure() {
expectString(obj);
var high = strToInt(obj);
obj = lexer.getObj();
if ((0, _util.isInt)(obj) || (0, _util.isString)(obj)) {
var dstLow = (0, _util.isInt)(obj) ? String.fromCharCode(obj) : obj;
if (Number.isInteger(obj) || (0, _util.isString)(obj)) {
var dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj;
cMap.mapBfRange(low, high, dstLow);
} else if ((0, _primitives.isCmd)(obj, '[')) {
obj = lexer.getObj();
@ -34566,7 +34562,7 @@ var CMapFactory = function CMapFactoryClosure() { @@ -34566,7 +34562,7 @@ var CMapFactory = function CMapFactoryClosure() {
}
function parseWMode(cMap, lexer) {
var obj = lexer.getObj();
if ((0, _util.isInt)(obj)) {
if (Number.isInteger(obj)) {
cMap.vertical = !!obj;
}
}
@ -34903,7 +34899,7 @@ var IdentityToUnicodeMap = function IdentityToUnicodeMapClosure() { @@ -34903,7 +34899,7 @@ var IdentityToUnicodeMap = function IdentityToUnicodeMapClosure() {
return undefined;
},
charCodeOf: function charCodeOf(v) {
return (0, _util.isInt)(v) && v >= this.firstChar && v <= this.lastChar ? v : -1;
return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar ? v : -1;
},
amend: function amend(map) {
throw new Error('Should not call amend()');
@ -43221,7 +43217,7 @@ var Annotation = function () { @@ -43221,7 +43217,7 @@ var Annotation = function () {
}, {
key: 'setFlags',
value: function setFlags(flags) {
this.flags = (0, _util.isInt)(flags) && flags > 0 ? flags : 0;
this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0;
}
}, {
key: 'hasFlag',
@ -43497,7 +43493,7 @@ var WidgetAnnotation = function (_Annotation) { @@ -43497,7 +43493,7 @@ var WidgetAnnotation = function (_Annotation) {
data.fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null;
_this2.fieldResources = _util.Util.getInheritableProperty(dict, 'DR') || _primitives.Dict.empty;
data.fieldFlags = _util.Util.getInheritableProperty(dict, 'Ff');
if (!(0, _util.isInt)(data.fieldFlags) || data.fieldFlags < 0) {
if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) {
data.fieldFlags = 0;
}
data.readOnly = _this2.hasFieldFlag(_util.AnnotationFieldFlag.READONLY);
@ -43561,12 +43557,12 @@ var TextWidgetAnnotation = function (_WidgetAnnotation) { @@ -43561,12 +43557,12 @@ var TextWidgetAnnotation = function (_WidgetAnnotation) {
_this3.data.fieldValue = (0, _util.stringToPDFString)(_this3.data.fieldValue || '');
var alignment = _util.Util.getInheritableProperty(params.dict, 'Q');
if (!(0, _util.isInt)(alignment) || alignment < 0 || alignment > 2) {
if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) {
alignment = null;
}
_this3.data.textAlignment = alignment;
var maximumLength = _util.Util.getInheritableProperty(params.dict, 'MaxLen');
if (!(0, _util.isInt)(maximumLength) || maximumLength < 0) {
if (!Number.isInteger(maximumLength) || maximumLength < 0) {
maximumLength = null;
}
_this3.data.maxLen = maximumLength;

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

8
lib/core/annotation.js

@ -163,7 +163,7 @@ var Annotation = function () { @@ -163,7 +163,7 @@ var Annotation = function () {
}, {
key: 'setFlags',
value: function setFlags(flags) {
this.flags = (0, _util.isInt)(flags) && flags > 0 ? flags : 0;
this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0;
}
}, {
key: 'hasFlag',
@ -439,7 +439,7 @@ var WidgetAnnotation = function (_Annotation) { @@ -439,7 +439,7 @@ var WidgetAnnotation = function (_Annotation) {
data.fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null;
_this2.fieldResources = _util.Util.getInheritableProperty(dict, 'DR') || _primitives.Dict.empty;
data.fieldFlags = _util.Util.getInheritableProperty(dict, 'Ff');
if (!(0, _util.isInt)(data.fieldFlags) || data.fieldFlags < 0) {
if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) {
data.fieldFlags = 0;
}
data.readOnly = _this2.hasFieldFlag(_util.AnnotationFieldFlag.READONLY);
@ -503,12 +503,12 @@ var TextWidgetAnnotation = function (_WidgetAnnotation) { @@ -503,12 +503,12 @@ var TextWidgetAnnotation = function (_WidgetAnnotation) {
_this3.data.fieldValue = (0, _util.stringToPDFString)(_this3.data.fieldValue || '');
var alignment = _util.Util.getInheritableProperty(params.dict, 'Q');
if (!(0, _util.isInt)(alignment) || alignment < 0 || alignment > 2) {
if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) {
alignment = null;
}
_this3.data.textAlignment = alignment;
var maximumLength = _util.Util.getInheritableProperty(params.dict, 'MaxLen');
if (!(0, _util.isInt)(maximumLength) || maximumLength < 0) {
if (!Number.isInteger(maximumLength) || maximumLength < 0) {
maximumLength = null;
}
_this3.data.maxLen = maximumLength;

2
lib/core/chunked_stream.js

@ -435,7 +435,7 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() { @@ -435,7 +435,7 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() {
} else {
nextEmptyChunk = this.stream.nextEmptyChunk(endChunk);
}
if ((0, _util.isInt)(nextEmptyChunk)) {
if (Number.isInteger(nextEmptyChunk)) {
this._requestChunks([nextEmptyChunk]);
}
}

14
lib/core/cmap.js

@ -165,10 +165,10 @@ var IdentityCMap = function IdentityCMapClosure() { @@ -165,10 +165,10 @@ var IdentityCMap = function IdentityCMapClosure() {
throw new Error('should not call mapCidOne');
},
lookup: function lookup(code) {
return (0, _util.isInt)(code) && code <= 0xffff ? code : undefined;
return Number.isInteger(code) && code <= 0xffff ? code : undefined;
},
contains: function contains(code) {
return (0, _util.isInt)(code) && code <= 0xffff;
return Number.isInteger(code) && code <= 0xffff;
},
forEach: function forEach(callback) {
for (var i = 0; i <= 0xffff; i++) {
@ -176,7 +176,7 @@ var IdentityCMap = function IdentityCMapClosure() { @@ -176,7 +176,7 @@ var IdentityCMap = function IdentityCMapClosure() {
}
},
charCodeOf: function charCodeOf(value) {
return (0, _util.isInt)(value) && value <= 0xffff ? value : -1;
return Number.isInteger(value) && value <= 0xffff ? value : -1;
},
getMap: function getMap() {
var map = new Array(0x10000);
@ -472,7 +472,7 @@ var CMapFactory = function CMapFactoryClosure() { @@ -472,7 +472,7 @@ var CMapFactory = function CMapFactoryClosure() {
}
}
function expectInt(obj) {
if (!(0, _util.isInt)(obj)) {
if (!Number.isInteger(obj)) {
throw new _util.FormatError('Malformed CMap: expected int.');
}
}
@ -508,8 +508,8 @@ var CMapFactory = function CMapFactoryClosure() { @@ -508,8 +508,8 @@ var CMapFactory = function CMapFactoryClosure() {
expectString(obj);
var high = strToInt(obj);
obj = lexer.getObj();
if ((0, _util.isInt)(obj) || (0, _util.isString)(obj)) {
var dstLow = (0, _util.isInt)(obj) ? String.fromCharCode(obj) : obj;
if (Number.isInteger(obj) || (0, _util.isString)(obj)) {
var dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj;
cMap.mapBfRange(low, high, dstLow);
} else if ((0, _primitives.isCmd)(obj, '[')) {
obj = lexer.getObj();
@ -586,7 +586,7 @@ var CMapFactory = function CMapFactoryClosure() { @@ -586,7 +586,7 @@ var CMapFactory = function CMapFactoryClosure() {
}
function parseWMode(cMap, lexer) {
var obj = lexer.getObj();
if ((0, _util.isInt)(obj)) {
if (Number.isInteger(obj)) {
cMap.vertical = !!obj;
}
}

4
lib/core/crypto.js

@ -1446,7 +1446,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() { @@ -1446,7 +1446,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
}
this.dict = dict;
var algorithm = dict.get('V');
if (!(0, _util.isInt)(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) {
if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) {
throw new _util.FormatError('unsupported encryption algorithm');
}
this.algorithm = algorithm;
@ -1467,7 +1467,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() { @@ -1467,7 +1467,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
}
}
}
if (!(0, _util.isInt)(keyLength) || keyLength < 40 || keyLength % 8 !== 0) {
if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) {
throw new _util.FormatError('invalid key length');
}
var ownerPassword = (0, _util.stringToBytes)(dict.get('O')).subarray(0, 32);

2
lib/core/fonts.js

@ -206,7 +206,7 @@ var IdentityToUnicodeMap = function IdentityToUnicodeMapClosure() { @@ -206,7 +206,7 @@ var IdentityToUnicodeMap = function IdentityToUnicodeMapClosure() {
return undefined;
},
charCodeOf: function charCodeOf(v) {
return (0, _util.isInt)(v) && v >= this.firstChar && v <= this.lastChar ? v : -1;
return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar ? v : -1;
},
amend: function amend(map) {
throw new Error('Should not call amend()');

26
lib/core/obj.js

@ -170,7 +170,7 @@ var Catalog = function CatalogClosure() { @@ -170,7 +170,7 @@ var Catalog = function CatalogClosure() {
},
get numPages() {
var obj = this.toplevelPagesDict.get('Count');
if (!(0, _util.isInt)(obj)) {
if (!Number.isInteger(obj)) {
throw new _util.FormatError('page count in top level pages object is not an integer');
}
return (0, _util.shadow)(this, 'numPages', obj);
@ -278,7 +278,7 @@ var Catalog = function CatalogClosure() { @@ -278,7 +278,7 @@ var Catalog = function CatalogClosure() {
}
prefix = p ? (0, _util.stringToPDFString)(p) : '';
var st = labelDict.get('St');
if (st && !((0, _util.isInt)(st) && st >= 1)) {
if (st && !(Number.isInteger(st) && st >= 1)) {
throw new _util.FormatError('Invalid start in PageLabel dictionary.');
}
currentIndex = st || 1;
@ -764,7 +764,7 @@ var XRef = function XRefClosure() { @@ -764,7 +764,7 @@ var XRef = function XRefClosure() {
}
var first = tableState.firstEntryNum;
var count = tableState.entryCount;
if (!(0, _util.isInt)(first) || !(0, _util.isInt)(count)) {
if (!Number.isInteger(first) || !Number.isInteger(count)) {
throw new _util.FormatError('Invalid XRef table: wrong types in subsection header');
}
for (var i = tableState.entryNum; i < count; i++) {
@ -781,7 +781,7 @@ var XRef = function XRefClosure() { @@ -781,7 +781,7 @@ var XRef = function XRefClosure() {
} else if ((0, _primitives.isCmd)(type, 'n')) {
entry.uncompressed = true;
}
if (!(0, _util.isInt)(entry.offset) || !(0, _util.isInt)(entry.gen) || !(entry.free || entry.uncompressed)) {
if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) {
throw new _util.FormatError('Invalid entry in XRef subsection: ' + first + ', ' + count);
}
if (i === 0 && entry.free && first === 1) {
@ -834,10 +834,10 @@ var XRef = function XRefClosure() { @@ -834,10 +834,10 @@ var XRef = function XRefClosure() {
while (entryRanges.length > 0) {
var first = entryRanges[0];
var n = entryRanges[1];
if (!(0, _util.isInt)(first) || !(0, _util.isInt)(n)) {
if (!Number.isInteger(first) || !Number.isInteger(n)) {
throw new _util.FormatError('Invalid XRef range fields: ' + first + ', ' + n);
}
if (!(0, _util.isInt)(typeFieldWidth) || !(0, _util.isInt)(offsetFieldWidth) || !(0, _util.isInt)(generationFieldWidth)) {
if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) {
throw new _util.FormatError('Invalid XRef entry fields length: ' + first + ', ' + n);
}
for (i = streamState.entryNum; i < n; ++i) {
@ -1024,15 +1024,15 @@ var XRef = function XRefClosure() { @@ -1024,15 +1024,15 @@ var XRef = function XRefClosure() {
this.topDict = dict;
}
obj = dict.get('XRefStm');
if ((0, _util.isInt)(obj)) {
if (Number.isInteger(obj)) {
var pos = obj;
if (!(pos in this.xrefstms)) {
this.xrefstms[pos] = 1;
this.startXRefQueue.push(pos);
}
}
} else if ((0, _util.isInt)(obj)) {
if (!(0, _util.isInt)(parser.getObj()) || !(0, _primitives.isCmd)(parser.getObj(), 'obj') || !(0, _primitives.isStream)(obj = parser.getObj())) {
} else if (Number.isInteger(obj)) {
if (!Number.isInteger(parser.getObj()) || !(0, _primitives.isCmd)(parser.getObj(), 'obj') || !(0, _primitives.isStream)(obj = parser.getObj())) {
throw new _util.FormatError('Invalid XRef stream');
}
dict = this.processXRefStream(obj);
@ -1046,7 +1046,7 @@ var XRef = function XRefClosure() { @@ -1046,7 +1046,7 @@ var XRef = function XRefClosure() {
throw new _util.FormatError('Invalid XRef stream header');
}
obj = dict.get('Prev');
if ((0, _util.isInt)(obj)) {
if (Number.isInteger(obj)) {
this.startXRefQueue.push(obj);
} else if ((0, _primitives.isRef)(obj)) {
this.startXRefQueue.push(obj.num);
@ -1153,7 +1153,7 @@ var XRef = function XRefClosure() { @@ -1153,7 +1153,7 @@ var XRef = function XRefClosure() {
}
var first = stream.dict.get('First');
var n = stream.dict.get('N');
if (!(0, _util.isInt)(first) || !(0, _util.isInt)(n)) {
if (!Number.isInteger(first) || !Number.isInteger(n)) {
throw new _util.FormatError('invalid first and n parameters for ObjStm stream');
}
var parser = new _parser.Parser(new _parser.Lexer(stream), false, this);
@ -1164,12 +1164,12 @@ var XRef = function XRefClosure() { @@ -1164,12 +1164,12 @@ var XRef = function XRefClosure() {
nums = [];
for (i = 0; i < n; ++i) {
num = parser.getObj();
if (!(0, _util.isInt)(num)) {
if (!Number.isInteger(num)) {
throw new _util.FormatError('invalid object number in the ObjStm stream: ' + num);
}
nums.push(num);
var offset = parser.getObj();
if (!(0, _util.isInt)(offset)) {
if (!Number.isInteger(offset)) {
throw new _util.FormatError('invalid object offset in the ObjStm stream: ' + offset);
}
}

12
lib/core/parser.js

@ -110,9 +110,9 @@ var Parser = function ParserClosure() { @@ -110,9 +110,9 @@ var Parser = function ParserClosure() {
return buf1;
}
}
if ((0, _util.isInt)(buf1)) {
if (Number.isInteger(buf1)) {
var num = buf1;
if ((0, _util.isInt)(this.buf1) && (0, _primitives.isCmd)(this.buf2, 'R')) {
if (Number.isInteger(this.buf1) && (0, _primitives.isCmd)(this.buf2, 'R')) {
var ref = new _primitives.Ref(num, this.buf1);
this.shift();
this.shift();
@ -389,7 +389,7 @@ var Parser = function ParserClosure() { @@ -389,7 +389,7 @@ var Parser = function ParserClosure() {
lexer.skipToNextLine();
var pos = stream.pos - 1;
var length = dict.get('Length');
if (!(0, _util.isInt)(length)) {
if (!Number.isInteger(length)) {
(0, _util.info)('Bad ' + length + ' attribute in stream');
length = 0;
}
@ -929,7 +929,7 @@ var Linearization = { @@ -929,7 +929,7 @@ var Linearization = {
create: function LinearizationCreate(stream) {
function getInt(name, allowZeroValue) {
var obj = linDict.get(name);
if ((0, _util.isInt)(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) {
if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) {
return obj;
}
throw new Error('The "' + name + '" parameter in the linearization ' + 'dictionary is invalid.');
@ -940,7 +940,7 @@ var Linearization = { @@ -940,7 +940,7 @@ var Linearization = {
item;
if ((0, _util.isArray)(hints) && ((hintsLength = hints.length) === 2 || hintsLength === 4)) {
for (var index = 0; index < hintsLength; index++) {
if (!((0, _util.isInt)(item = hints[index]) && item > 0)) {
if (!(Number.isInteger(item = hints[index]) && item > 0)) {
throw new Error('Hint (' + index + ') in the linearization dictionary is invalid.');
}
}
@ -954,7 +954,7 @@ var Linearization = { @@ -954,7 +954,7 @@ var Linearization = {
var obj3 = parser.getObj();
var linDict = parser.getObj();
var obj, length;
if (!((0, _util.isInt)(obj1) && (0, _util.isInt)(obj2) && (0, _primitives.isCmd)(obj3, 'obj') && (0, _primitives.isDict)(linDict) && (0, _util.isNum)(obj = linDict.get('Linearized')) && obj > 0)) {
if (!(Number.isInteger(obj1) && Number.isInteger(obj2) && (0, _primitives.isCmd)(obj3, 'obj') && (0, _primitives.isDict)(linDict) && (0, _util.isNum)(obj = linDict.get('Linearized')) && obj > 0)) {
return null;
} else if ((length = getInt('L')) !== stream.length) {
throw new Error('The "L" parameter in the linearization dictionary ' + 'does not equal the stream length.');

2
lib/core/stream.js

@ -730,7 +730,7 @@ var JpegStream = function JpegStreamClosure() { @@ -730,7 +730,7 @@ var JpegStream = function JpegStreamClosure() {
}
if ((0, _primitives.isDict)(this.params)) {
var colorTransform = this.params.get('ColorTransform');
if ((0, _util.isInt)(colorTransform)) {
if (Number.isInteger(colorTransform)) {
jpegImage.colorTransform = colorTransform;
}
}

6
lib/display/api.js

@ -1294,7 +1294,7 @@ var WorkerTransport = function WorkerTransportClosure() { @@ -1294,7 +1294,7 @@ var WorkerTransport = function WorkerTransportClosure() {
getPage: function WorkerTransport_getPage(pageNumber, capability) {
var _this13 = this;
if (!(0, _util.isInt)(pageNumber) || pageNumber <= 0 || pageNumber > this.numPages) {
if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this.numPages) {
return Promise.reject(new Error('Invalid page request'));
}
var pageIndex = pageNumber - 1;
@ -1581,8 +1581,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -1581,8 +1581,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.9.512';
exports.build = build = '066fea9c';
exports.version = version = '1.9.514';
exports.build = build = '22ade754';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;

4
lib/display/global.js

@ -45,8 +45,8 @@ if (!_global_scope2.default.PDFJS) { @@ -45,8 +45,8 @@ if (!_global_scope2.default.PDFJS) {
}
var PDFJS = _global_scope2.default.PDFJS;
{
PDFJS.version = '1.9.512';
PDFJS.build = '066fea9c';
PDFJS.version = '1.9.514';
PDFJS.build = '22ade754';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {

5
lib/display/network_utils.js

@ -42,9 +42,8 @@ function validateRangeRequestCapabilities(_ref) { @@ -42,9 +42,8 @@ function validateRangeRequestCapabilities(_ref) {
if (contentEncoding !== 'identity') {
return returnValues;
}
var length = getResponseHeader('Content-Length');
length = parseInt(length, 10);
if (!(0, _util.isInt)(length)) {
var length = parseInt(getResponseHeader('Content-Length'), 10);
if (!Number.isInteger(length)) {
return returnValues;
}
returnValues.suggestedLength = length;

4
lib/pdf.js

@ -14,8 +14,8 @@ @@ -14,8 +14,8 @@
*/
'use strict';
var pdfjsVersion = '1.9.512';
var pdfjsBuild = '066fea9c';
var pdfjsVersion = '1.9.514';
var pdfjsBuild = '22ade754';
var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayGlobal = require('./display/global.js');
var pdfjsDisplayAPI = require('./display/api.js');

4
lib/pdf.worker.js vendored

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
*/
'use strict';
var pdfjsVersion = '1.9.512';
var pdfjsBuild = '066fea9c';
var pdfjsVersion = '1.9.514';
var pdfjsBuild = '22ade754';
var pdfjsCoreWorker = require('./core/worker.js');
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

8
lib/shared/util.js

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isNodeJS = exports.isSpace = exports.isString = exports.isNum = exports.isInt = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.isArray = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.StatTimer = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isNodeJS = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.isArray = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.StatTimer = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
@ -632,7 +632,7 @@ var Util = function UtilClosure() { @@ -632,7 +632,7 @@ var Util = function UtilClosure() {
};
var ROMAN_NUMBER_MAP = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];
Util.toRoman = function Util_toRoman(number, lowerCase) {
assert(isInt(number) && number > 0, 'The number should be a positive integer.');
assert(Number.isInteger(number) && number > 0, 'The number should be a positive integer.');
var pos,
romanBuf = [];
while (number >= 1000) {
@ -805,9 +805,6 @@ function isEmptyObj(obj) { @@ -805,9 +805,6 @@ function isEmptyObj(obj) {
function isBool(v) {
return typeof v === 'boolean';
}
function isInt(v) {
return typeof v === 'number' && (v | 0) === v;
}
function isNum(v) {
return typeof v === 'number';
}
@ -1378,7 +1375,6 @@ exports.isArray = isArray; @@ -1378,7 +1375,6 @@ exports.isArray = isArray;
exports.isArrayBuffer = isArrayBuffer;
exports.isBool = isBool;
exports.isEmptyObj = isEmptyObj;
exports.isInt = isInt;
exports.isNum = isNum;
exports.isString = isString;
exports.isSpace = isSpace;

4
lib/test/unit/fonts_spec.js

@ -16,8 +16,6 @@ @@ -16,8 +16,6 @@
var _fonts = require('../../core/fonts');
var _util = require('../../shared/util');
var checkProblematicCharRanges = function checkProblematicCharRanges() {
function printRange(limits) {
return '[' + limits.lower.toString('16').toUpperCase() + ', ' + limits.upper.toString('16').toUpperCase() + ')';
@ -33,7 +31,7 @@ var checkProblematicCharRanges = function checkProblematicCharRanges() { @@ -33,7 +31,7 @@ var checkProblematicCharRanges = function checkProblematicCharRanges() {
lower: _fonts.ProblematicCharRanges[i],
upper: _fonts.ProblematicCharRanges[i + 1]
};
if (!(0, _util.isInt)(limits.lower) || !(0, _util.isInt)(limits.upper)) {
if (!Number.isInteger(limits.lower) || !Number.isInteger(limits.upper)) {
throw new Error('Range endpoints must be integers: ' + printRange(limits));
}
if (limits.lower < 0 || limits.upper < 0) {

2
package.json

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

Loading…
Cancel
Save