|
|
|
@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {}));
@@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {}));
|
|
|
|
|
// Use strict in our context only - users might not want it
|
|
|
|
|
'use strict'; |
|
|
|
|
|
|
|
|
|
var pdfjsVersion = '1.4.107'; |
|
|
|
|
var pdfjsBuild = '4d9a3d4'; |
|
|
|
|
var pdfjsVersion = '1.4.109'; |
|
|
|
|
var pdfjsBuild = '22341c0'; |
|
|
|
|
|
|
|
|
|
var pdfjsFilePath = |
|
|
|
|
typeof document !== 'undefined' && document.currentScript ? |
|
|
|
@ -699,6 +699,55 @@ function stringToBytes(str) {
@@ -699,6 +699,55 @@ function stringToBytes(str) {
|
|
|
|
|
return bytes; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Gets length of the array (Array, Uint8Array, or string) in bytes. |
|
|
|
|
* @param {Array|Uint8Array|string} arr |
|
|
|
|
* @returns {number} |
|
|
|
|
*/ |
|
|
|
|
function arrayByteLength(arr) { |
|
|
|
|
if (arr.length !== undefined) { |
|
|
|
|
return arr.length; |
|
|
|
|
} |
|
|
|
|
assert(arr.byteLength !== undefined); |
|
|
|
|
return arr.byteLength; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Combines array items (arrays) into single Uint8Array object. |
|
|
|
|
* @param {Array} arr - the array of the arrays (Array, Uint8Array, or string). |
|
|
|
|
* @returns {Uint8Array} |
|
|
|
|
*/ |
|
|
|
|
function arraysToBytes(arr) { |
|
|
|
|
// Shortcut: if first and only item is Uint8Array, return it.
|
|
|
|
|
if (arr.length === 1 && (arr[0] instanceof Uint8Array)) { |
|
|
|
|
return arr[0]; |
|
|
|
|
} |
|
|
|
|
var resultLength = 0; |
|
|
|
|
var i, ii = arr.length; |
|
|
|
|
var item, itemLength ; |
|
|
|
|
for (i = 0; i < ii; i++) { |
|
|
|
|
item = arr[i]; |
|
|
|
|
itemLength = arrayByteLength(item); |
|
|
|
|
resultLength += itemLength; |
|
|
|
|
} |
|
|
|
|
var pos = 0; |
|
|
|
|
var data = new Uint8Array(resultLength); |
|
|
|
|
for (i = 0; i < ii; i++) { |
|
|
|
|
item = arr[i]; |
|
|
|
|
if (!(item instanceof Uint8Array)) { |
|
|
|
|
if (typeof item === 'string') { |
|
|
|
|
item = stringToBytes(item); |
|
|
|
|
} else { |
|
|
|
|
item = new Uint8Array(item); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
itemLength = item.byteLength; |
|
|
|
|
data.set(item, pos); |
|
|
|
|
pos += itemLength; |
|
|
|
|
} |
|
|
|
|
return data; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function string32(value) { |
|
|
|
|
return String.fromCharCode((value >> 24) & 0xff, (value >> 16) & 0xff, |
|
|
|
|
(value >> 8) & 0xff, value & 0xff); |
|
|
|
@ -2483,6 +2532,8 @@ exports.UnexpectedResponseException = UnexpectedResponseException;
@@ -2483,6 +2532,8 @@ exports.UnexpectedResponseException = UnexpectedResponseException;
|
|
|
|
|
exports.UnknownErrorException = UnknownErrorException; |
|
|
|
|
exports.Util = Util; |
|
|
|
|
exports.XRefParseException = XRefParseException; |
|
|
|
|
exports.arrayByteLength = arrayByteLength; |
|
|
|
|
exports.arraysToBytes = arraysToBytes; |
|
|
|
|
exports.assert = assert; |
|
|
|
|
exports.bytesToString = bytesToString; |
|
|
|
|
exports.combineUrl = combineUrl; |
|
|
|
|