pdfjs-dist 2.0.943 → 2.1.266
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pdfjs-dist might be problematic. Click here for more details.
- package/bower.json +1 -1
- package/build/pdf.js +15329 -11095
- package/build/pdf.js.map +1 -1
- package/build/pdf.min.js +1 -1
- package/build/pdf.worker.js +12497 -4184
- package/build/pdf.worker.js.map +1 -1
- package/build/pdf.worker.min.js +1 -1
- package/image_decoders/pdf.image_decoders.js +3438 -1209
- package/image_decoders/pdf.image_decoders.js.map +1 -1
- package/image_decoders/pdf.image_decoders.min.js +1 -1
- package/lib/core/annotation.js +335 -109
- package/lib/core/arithmetic_decoder.js +274 -244
- package/lib/core/bidi.js +64 -5
- package/lib/core/ccitt.js +172 -17
- package/lib/core/ccitt_stream.js +14 -5
- package/lib/core/cff_parser.js +304 -28
- package/lib/core/charsets.js +4 -3
- package/lib/core/chunked_stream.js +379 -149
- package/lib/core/cmap.js +210 -40
- package/lib/core/colorspace.js +332 -187
- package/lib/core/crypto.js +289 -44
- package/lib/core/document.js +508 -249
- package/lib/core/encodings.js +18 -9
- package/lib/core/evaluator.js +657 -119
- package/lib/core/font_renderer.js +217 -34
- package/lib/core/fonts.js +632 -41
- package/lib/core/function.js +252 -26
- package/lib/core/glyphlist.js +2 -1
- package/lib/core/image.js +124 -27
- package/lib/core/jbig2.js +425 -65
- package/lib/core/jbig2_stream.js +18 -7
- package/lib/core/jpeg_stream.js +24 -8
- package/lib/core/jpg.js +208 -16
- package/lib/core/jpx.js +395 -5
- package/lib/core/jpx_stream.js +17 -5
- package/lib/core/metrics.js +3 -3
- package/lib/core/murmurhash3.js +23 -5
- package/lib/core/obj.js +625 -132
- package/lib/core/operator_list.js +104 -3
- package/lib/core/parser.js +262 -25
- package/lib/core/pattern.js +144 -12
- package/lib/core/pdf_manager.js +104 -70
- package/lib/core/primitives.js +74 -21
- package/lib/core/ps_parser.js +133 -44
- package/lib/core/standard_fonts.js +9 -9
- package/lib/core/stream.js +283 -31
- package/lib/core/type1_parser.js +138 -6
- package/lib/core/unicode.js +28 -1
- package/lib/core/worker.js +192 -57
- package/lib/display/annotation_layer.js +303 -123
- package/lib/display/api.js +1073 -574
- package/lib/display/api_compatibility.js +4 -1
- package/lib/display/canvas.js +314 -18
- package/lib/display/content_disposition.js +70 -23
- package/lib/display/dom_utils.js +112 -59
- package/lib/display/fetch_stream.js +95 -50
- package/lib/display/font_loader.js +250 -132
- package/lib/display/metadata.js +37 -15
- package/lib/display/network.js +123 -34
- package/lib/display/network_utils.js +23 -10
- package/lib/display/node_stream.js +162 -65
- package/lib/display/pattern_helper.js +57 -6
- package/lib/display/svg.js +194 -18
- package/lib/display/text_layer.js +128 -14
- package/lib/display/transport_stream.js +83 -27
- package/lib/display/webgl.js +63 -17
- package/lib/display/worker_options.js +4 -3
- package/lib/display/xml_parser.js +162 -52
- package/lib/examples/node/domstubs.js +56 -3
- package/lib/pdf.js +15 -2
- package/lib/pdf.worker.js +4 -2
- package/lib/shared/compatibility.js +129 -26
- package/lib/shared/global_scope.js +1 -1
- package/lib/shared/is_node.js +3 -3
- package/lib/shared/message_handler.js +103 -45
- package/lib/shared/streams_polyfill.js +20 -16
- package/lib/shared/url_polyfill.js +8 -2
- package/lib/shared/util.js +246 -84
- package/lib/test/unit/annotation_spec.js +99 -73
- package/lib/test/unit/api_spec.js +347 -113
- package/lib/test/unit/bidi_spec.js +6 -6
- package/lib/test/unit/cff_parser_spec.js +17 -5
- package/lib/test/unit/clitests_helper.js +7 -8
- package/lib/test/unit/cmap_spec.js +79 -25
- package/lib/test/unit/colorspace_spec.js +65 -18
- package/lib/test/unit/crypto_spec.js +16 -4
- package/lib/test/unit/custom_spec.js +40 -52
- package/lib/test/unit/display_svg_spec.js +32 -16
- package/lib/test/unit/document_spec.js +2 -2
- package/lib/test/unit/dom_utils_spec.js +8 -8
- package/lib/test/unit/encodings_spec.js +24 -44
- package/lib/test/unit/evaluator_spec.js +15 -8
- package/lib/test/unit/function_spec.js +16 -4
- package/lib/test/unit/jasmine-boot.js +29 -16
- package/lib/test/unit/message_handler_spec.js +19 -6
- package/lib/test/unit/metadata_spec.js +64 -11
- package/lib/test/unit/murmurhash3_spec.js +2 -2
- package/lib/test/unit/network_spec.js +19 -4
- package/lib/test/unit/network_utils_spec.js +6 -4
- package/lib/test/unit/node_stream_spec.js +50 -26
- package/lib/test/unit/parser_spec.js +13 -29
- package/lib/test/unit/pdf_find_controller_spec.js +144 -32
- package/lib/test/unit/pdf_find_utils_spec.js +10 -9
- package/lib/test/unit/pdf_history_spec.js +20 -8
- package/lib/test/unit/primitives_spec.js +23 -3
- package/lib/test/unit/stream_spec.js +8 -3
- package/lib/test/unit/test_utils.js +89 -26
- package/lib/test/unit/testreporter.js +19 -1
- package/lib/test/unit/type1_parser_spec.js +7 -5
- package/lib/test/unit/ui_utils_spec.js +162 -38
- package/lib/test/unit/unicode_spec.js +13 -10
- package/lib/test/unit/util_spec.js +89 -9
- package/lib/web/annotation_layer_builder.js +38 -21
- package/lib/web/app.js +610 -245
- package/lib/web/app_options.js +54 -34
- package/lib/web/base_viewer.js +359 -162
- package/lib/web/chromecom.js +159 -80
- package/lib/web/debugger.js +161 -17
- package/lib/web/download_manager.js +29 -11
- package/lib/web/firefox_print_service.js +16 -8
- package/lib/web/firefoxcom.js +127 -91
- package/lib/web/genericcom.js +50 -31
- package/lib/web/genericl10n.js +46 -34
- package/lib/web/grab_to_pan.js +25 -3
- package/lib/web/interfaces.js +108 -61
- package/lib/web/overlay_manager.js +67 -45
- package/lib/web/password_prompt.js +20 -12
- package/lib/web/pdf_attachment_viewer.js +37 -17
- package/lib/web/pdf_cursor_tools.js +38 -15
- package/lib/web/pdf_document_properties.js +65 -24
- package/lib/web/pdf_find_bar.js +48 -20
- package/lib/web/pdf_find_controller.js +290 -89
- package/lib/web/pdf_find_utils.js +19 -3
- package/lib/web/pdf_history.js +186 -49
- package/lib/web/pdf_link_service.js +127 -52
- package/lib/web/pdf_outline_viewer.js +71 -21
- package/lib/web/pdf_page_view.js +188 -63
- package/lib/web/pdf_presentation_mode.js +98 -33
- package/lib/web/pdf_print_service.js +54 -10
- package/lib/web/pdf_rendering_queue.js +26 -4
- package/lib/web/pdf_sidebar.js +116 -62
- package/lib/web/pdf_sidebar_resizer.js +41 -15
- package/lib/web/pdf_single_page_viewer.js +65 -68
- package/lib/web/pdf_thumbnail_view.js +102 -31
- package/lib/web/pdf_thumbnail_viewer.js +62 -22
- package/lib/web/pdf_viewer.component.js +111 -31
- package/lib/web/pdf_viewer.js +80 -60
- package/lib/web/preferences.js +61 -39
- package/lib/web/secondary_toolbar.js +101 -82
- package/lib/web/text_layer_builder.js +124 -69
- package/lib/web/toolbar.js +67 -27
- package/lib/web/ui_utils.js +284 -128
- package/lib/web/view_history.js +75 -51
- package/lib/web/viewer_compatibility.js +2 -1
- package/package.json +1 -1
- package/web/pdf_viewer.css +1 -1
- package/web/pdf_viewer.js +2200 -973
- package/web/pdf_viewer.js.map +1 -1
- package/lib/web/dom_events.js +0 -140
package/lib/shared/util.js
CHANGED
@@ -19,28 +19,78 @@
|
|
19
19
|
* @licend The above is the entire license notice for the
|
20
20
|
* Javascript code in this page
|
21
21
|
*/
|
22
|
-
|
22
|
+
"use strict";
|
23
23
|
|
24
24
|
Object.defineProperty(exports, "__esModule", {
|
25
25
|
value: true
|
26
26
|
});
|
27
|
-
exports.
|
27
|
+
exports.toRomanNumerals = toRomanNumerals;
|
28
|
+
exports.arrayByteLength = arrayByteLength;
|
29
|
+
exports.arraysToBytes = arraysToBytes;
|
30
|
+
exports.assert = assert;
|
31
|
+
exports.bytesToString = bytesToString;
|
32
|
+
exports.createPromiseCapability = createPromiseCapability;
|
33
|
+
exports.deprecated = deprecated;
|
34
|
+
exports.getInheritableProperty = getInheritableProperty;
|
35
|
+
exports.getLookupTableFactory = getLookupTableFactory;
|
36
|
+
exports.getVerbosityLevel = getVerbosityLevel;
|
37
|
+
exports.info = info;
|
38
|
+
exports.isArrayBuffer = isArrayBuffer;
|
39
|
+
exports.isBool = isBool;
|
40
|
+
exports.isEmptyObj = isEmptyObj;
|
41
|
+
exports.isNum = isNum;
|
42
|
+
exports.isString = isString;
|
43
|
+
exports.isSpace = isSpace;
|
44
|
+
exports.isSameOrigin = isSameOrigin;
|
45
|
+
exports.createValidAbsoluteUrl = createValidAbsoluteUrl;
|
46
|
+
exports.isLittleEndian = isLittleEndian;
|
47
|
+
exports.isEvalSupported = isEvalSupported;
|
48
|
+
exports.log2 = log2;
|
49
|
+
exports.readInt8 = readInt8;
|
50
|
+
exports.readUint16 = readUint16;
|
51
|
+
exports.readUint32 = readUint32;
|
52
|
+
exports.removeNullCharacters = removeNullCharacters;
|
53
|
+
exports.setVerbosityLevel = setVerbosityLevel;
|
54
|
+
exports.shadow = shadow;
|
55
|
+
exports.string32 = string32;
|
56
|
+
exports.stringToBytes = stringToBytes;
|
57
|
+
exports.stringToPDFString = stringToPDFString;
|
58
|
+
exports.stringToUTF8String = stringToUTF8String;
|
59
|
+
exports.utf8StringToString = utf8StringToString;
|
60
|
+
exports.warn = warn;
|
61
|
+
exports.unreachable = unreachable;
|
62
|
+
Object.defineProperty(exports, "ReadableStream", {
|
63
|
+
enumerable: true,
|
64
|
+
get: function get() {
|
65
|
+
return _streams_polyfill.ReadableStream;
|
66
|
+
}
|
67
|
+
});
|
68
|
+
Object.defineProperty(exports, "URL", {
|
69
|
+
enumerable: true,
|
70
|
+
get: function get() {
|
71
|
+
return _url_polyfill.URL;
|
72
|
+
}
|
73
|
+
});
|
74
|
+
exports.createObjectURL = exports.FormatError = exports.XRefParseException = exports.XRefEntryException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PermissionFlag = exports.PasswordResponses = exports.PasswordException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VerbosityLevel = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = void 0;
|
28
75
|
|
29
|
-
|
76
|
+
require("./compatibility");
|
30
77
|
|
31
|
-
require(
|
78
|
+
var _streams_polyfill = require("./streams_polyfill");
|
32
79
|
|
33
|
-
var
|
80
|
+
var _url_polyfill = require("./url_polyfill");
|
34
81
|
|
35
|
-
|
82
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
36
83
|
|
37
84
|
var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];
|
85
|
+
exports.IDENTITY_MATRIX = IDENTITY_MATRIX;
|
38
86
|
var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
|
87
|
+
exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX;
|
39
88
|
var NativeImageDecoding = {
|
40
89
|
NONE: 'none',
|
41
90
|
DECODE: 'decode',
|
42
91
|
DISPLAY: 'display'
|
43
92
|
};
|
93
|
+
exports.NativeImageDecoding = NativeImageDecoding;
|
44
94
|
var PermissionFlag = {
|
45
95
|
PRINT: 0x04,
|
46
96
|
MODIFY_CONTENTS: 0x08,
|
@@ -51,6 +101,7 @@ var PermissionFlag = {
|
|
51
101
|
ASSEMBLE: 0x400,
|
52
102
|
PRINT_HIGH_QUALITY: 0x800
|
53
103
|
};
|
104
|
+
exports.PermissionFlag = PermissionFlag;
|
54
105
|
var TextRenderingMode = {
|
55
106
|
FILL: 0,
|
56
107
|
STROKE: 1,
|
@@ -63,11 +114,13 @@ var TextRenderingMode = {
|
|
63
114
|
FILL_STROKE_MASK: 3,
|
64
115
|
ADD_TO_PATH_FLAG: 4
|
65
116
|
};
|
117
|
+
exports.TextRenderingMode = TextRenderingMode;
|
66
118
|
var ImageKind = {
|
67
119
|
GRAYSCALE_1BPP: 1,
|
68
120
|
RGB_24BPP: 2,
|
69
121
|
RGBA_32BPP: 3
|
70
122
|
};
|
123
|
+
exports.ImageKind = ImageKind;
|
71
124
|
var AnnotationType = {
|
72
125
|
TEXT: 1,
|
73
126
|
LINK: 2,
|
@@ -96,6 +149,7 @@ var AnnotationType = {
|
|
96
149
|
THREED: 25,
|
97
150
|
REDACT: 26
|
98
151
|
};
|
152
|
+
exports.AnnotationType = AnnotationType;
|
99
153
|
var AnnotationFlag = {
|
100
154
|
INVISIBLE: 0x01,
|
101
155
|
HIDDEN: 0x02,
|
@@ -108,6 +162,7 @@ var AnnotationFlag = {
|
|
108
162
|
TOGGLENOVIEW: 0x100,
|
109
163
|
LOCKEDCONTENTS: 0x200
|
110
164
|
};
|
165
|
+
exports.AnnotationFlag = AnnotationFlag;
|
111
166
|
var AnnotationFieldFlag = {
|
112
167
|
READONLY: 0x0000001,
|
113
168
|
REQUIRED: 0x0000002,
|
@@ -129,6 +184,7 @@ var AnnotationFieldFlag = {
|
|
129
184
|
RADIOSINUNISON: 0x2000000,
|
130
185
|
COMMITONSELCHANGE: 0x4000000
|
131
186
|
};
|
187
|
+
exports.AnnotationFieldFlag = AnnotationFieldFlag;
|
132
188
|
var AnnotationBorderStyleType = {
|
133
189
|
SOLID: 1,
|
134
190
|
DASHED: 2,
|
@@ -136,6 +192,7 @@ var AnnotationBorderStyleType = {
|
|
136
192
|
INSET: 4,
|
137
193
|
UNDERLINE: 5
|
138
194
|
};
|
195
|
+
exports.AnnotationBorderStyleType = AnnotationBorderStyleType;
|
139
196
|
var StreamType = {
|
140
197
|
UNKNOWN: 0,
|
141
198
|
FLATE: 1,
|
@@ -148,6 +205,7 @@ var StreamType = {
|
|
148
205
|
CCF: 8,
|
149
206
|
RL: 9
|
150
207
|
};
|
208
|
+
exports.StreamType = StreamType;
|
151
209
|
var FontType = {
|
152
210
|
UNKNOWN: 0,
|
153
211
|
TYPE1: 1,
|
@@ -161,16 +219,19 @@ var FontType = {
|
|
161
219
|
TYPE0: 9,
|
162
220
|
MMTYPE1: 10
|
163
221
|
};
|
222
|
+
exports.FontType = FontType;
|
164
223
|
var VerbosityLevel = {
|
165
224
|
ERRORS: 0,
|
166
225
|
WARNINGS: 1,
|
167
226
|
INFOS: 5
|
168
227
|
};
|
228
|
+
exports.VerbosityLevel = VerbosityLevel;
|
169
229
|
var CMapCompressionType = {
|
170
230
|
NONE: 0,
|
171
231
|
BINARY: 1,
|
172
232
|
STREAM: 2
|
173
233
|
};
|
234
|
+
exports.CMapCompressionType = CMapCompressionType;
|
174
235
|
var OPS = {
|
175
236
|
dependency: 1,
|
176
237
|
setLineWidth: 2,
|
@@ -264,6 +325,7 @@ var OPS = {
|
|
264
325
|
paintSolidColorImageMask: 90,
|
265
326
|
constructPath: 91
|
266
327
|
};
|
328
|
+
exports.OPS = OPS;
|
267
329
|
var UNSUPPORTED_FEATURES = {
|
268
330
|
unknown: 'unknown',
|
269
331
|
forms: 'forms',
|
@@ -272,56 +334,70 @@ var UNSUPPORTED_FEATURES = {
|
|
272
334
|
shadingPattern: 'shadingPattern',
|
273
335
|
font: 'font'
|
274
336
|
};
|
337
|
+
exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES;
|
275
338
|
var PasswordResponses = {
|
276
339
|
NEED_PASSWORD: 1,
|
277
340
|
INCORRECT_PASSWORD: 2
|
278
341
|
};
|
342
|
+
exports.PasswordResponses = PasswordResponses;
|
279
343
|
var verbosity = VerbosityLevel.WARNINGS;
|
344
|
+
|
280
345
|
function setVerbosityLevel(level) {
|
281
346
|
if (Number.isInteger(level)) {
|
282
347
|
verbosity = level;
|
283
348
|
}
|
284
349
|
}
|
350
|
+
|
285
351
|
function getVerbosityLevel() {
|
286
352
|
return verbosity;
|
287
353
|
}
|
354
|
+
|
288
355
|
function info(msg) {
|
289
356
|
if (verbosity >= VerbosityLevel.INFOS) {
|
290
357
|
console.log('Info: ' + msg);
|
291
358
|
}
|
292
359
|
}
|
360
|
+
|
293
361
|
function warn(msg) {
|
294
362
|
if (verbosity >= VerbosityLevel.WARNINGS) {
|
295
363
|
console.log('Warning: ' + msg);
|
296
364
|
}
|
297
365
|
}
|
366
|
+
|
298
367
|
function deprecated(details) {
|
299
368
|
console.log('Deprecated API usage: ' + details);
|
300
369
|
}
|
370
|
+
|
301
371
|
function unreachable(msg) {
|
302
372
|
throw new Error(msg);
|
303
373
|
}
|
374
|
+
|
304
375
|
function assert(cond, msg) {
|
305
376
|
if (!cond) {
|
306
377
|
unreachable(msg);
|
307
378
|
}
|
308
379
|
}
|
380
|
+
|
309
381
|
function isSameOrigin(baseUrl, otherUrl) {
|
310
382
|
try {
|
311
383
|
var base = new _url_polyfill.URL(baseUrl);
|
384
|
+
|
312
385
|
if (!base.origin || base.origin === 'null') {
|
313
386
|
return false;
|
314
387
|
}
|
315
388
|
} catch (e) {
|
316
389
|
return false;
|
317
390
|
}
|
391
|
+
|
318
392
|
var other = new _url_polyfill.URL(otherUrl, base);
|
319
393
|
return base.origin === other.origin;
|
320
394
|
}
|
395
|
+
|
321
396
|
function _isValidProtocol(url) {
|
322
397
|
if (!url) {
|
323
398
|
return false;
|
324
399
|
}
|
400
|
+
|
325
401
|
switch (url.protocol) {
|
326
402
|
case 'http:':
|
327
403
|
case 'https:':
|
@@ -329,22 +405,28 @@ function _isValidProtocol(url) {
|
|
329
405
|
case 'mailto:':
|
330
406
|
case 'tel:':
|
331
407
|
return true;
|
408
|
+
|
332
409
|
default:
|
333
410
|
return false;
|
334
411
|
}
|
335
412
|
}
|
413
|
+
|
336
414
|
function createValidAbsoluteUrl(url, baseUrl) {
|
337
415
|
if (!url) {
|
338
416
|
return null;
|
339
417
|
}
|
418
|
+
|
340
419
|
try {
|
341
420
|
var absoluteUrl = baseUrl ? new _url_polyfill.URL(url, baseUrl) : new _url_polyfill.URL(url);
|
421
|
+
|
342
422
|
if (_isValidProtocol(absoluteUrl)) {
|
343
423
|
return absoluteUrl;
|
344
424
|
}
|
345
425
|
} catch (ex) {}
|
426
|
+
|
346
427
|
return null;
|
347
428
|
}
|
429
|
+
|
348
430
|
function shadow(obj, prop, value) {
|
349
431
|
Object.defineProperty(obj, prop, {
|
350
432
|
value: value,
|
@@ -354,6 +436,7 @@ function shadow(obj, prop, value) {
|
|
354
436
|
});
|
355
437
|
return value;
|
356
438
|
}
|
439
|
+
|
357
440
|
function getLookupTableFactory(initializer) {
|
358
441
|
var lookup;
|
359
442
|
return function () {
|
@@ -362,151 +445,219 @@ function getLookupTableFactory(initializer) {
|
|
362
445
|
initializer(lookup);
|
363
446
|
initializer = null;
|
364
447
|
}
|
448
|
+
|
365
449
|
return lookup;
|
366
450
|
};
|
367
451
|
}
|
452
|
+
|
368
453
|
var PasswordException = function PasswordExceptionClosure() {
|
369
454
|
function PasswordException(msg, code) {
|
370
455
|
this.name = 'PasswordException';
|
371
456
|
this.message = msg;
|
372
457
|
this.code = code;
|
373
458
|
}
|
459
|
+
|
374
460
|
PasswordException.prototype = new Error();
|
375
461
|
PasswordException.constructor = PasswordException;
|
376
462
|
return PasswordException;
|
377
463
|
}();
|
464
|
+
|
465
|
+
exports.PasswordException = PasswordException;
|
466
|
+
|
378
467
|
var UnknownErrorException = function UnknownErrorExceptionClosure() {
|
379
468
|
function UnknownErrorException(msg, details) {
|
380
469
|
this.name = 'UnknownErrorException';
|
381
470
|
this.message = msg;
|
382
471
|
this.details = details;
|
383
472
|
}
|
473
|
+
|
384
474
|
UnknownErrorException.prototype = new Error();
|
385
475
|
UnknownErrorException.constructor = UnknownErrorException;
|
386
476
|
return UnknownErrorException;
|
387
477
|
}();
|
478
|
+
|
479
|
+
exports.UnknownErrorException = UnknownErrorException;
|
480
|
+
|
388
481
|
var InvalidPDFException = function InvalidPDFExceptionClosure() {
|
389
482
|
function InvalidPDFException(msg) {
|
390
483
|
this.name = 'InvalidPDFException';
|
391
484
|
this.message = msg;
|
392
485
|
}
|
486
|
+
|
393
487
|
InvalidPDFException.prototype = new Error();
|
394
488
|
InvalidPDFException.constructor = InvalidPDFException;
|
395
489
|
return InvalidPDFException;
|
396
490
|
}();
|
491
|
+
|
492
|
+
exports.InvalidPDFException = InvalidPDFException;
|
493
|
+
|
397
494
|
var MissingPDFException = function MissingPDFExceptionClosure() {
|
398
495
|
function MissingPDFException(msg) {
|
399
496
|
this.name = 'MissingPDFException';
|
400
497
|
this.message = msg;
|
401
498
|
}
|
499
|
+
|
402
500
|
MissingPDFException.prototype = new Error();
|
403
501
|
MissingPDFException.constructor = MissingPDFException;
|
404
502
|
return MissingPDFException;
|
405
503
|
}();
|
504
|
+
|
505
|
+
exports.MissingPDFException = MissingPDFException;
|
506
|
+
|
406
507
|
var UnexpectedResponseException = function UnexpectedResponseExceptionClosure() {
|
407
508
|
function UnexpectedResponseException(msg, status) {
|
408
509
|
this.name = 'UnexpectedResponseException';
|
409
510
|
this.message = msg;
|
410
511
|
this.status = status;
|
411
512
|
}
|
513
|
+
|
412
514
|
UnexpectedResponseException.prototype = new Error();
|
413
515
|
UnexpectedResponseException.constructor = UnexpectedResponseException;
|
414
516
|
return UnexpectedResponseException;
|
415
517
|
}();
|
518
|
+
|
519
|
+
exports.UnexpectedResponseException = UnexpectedResponseException;
|
520
|
+
|
416
521
|
var MissingDataException = function MissingDataExceptionClosure() {
|
417
522
|
function MissingDataException(begin, end) {
|
418
523
|
this.begin = begin;
|
419
524
|
this.end = end;
|
420
525
|
this.message = 'Missing data [' + begin + ', ' + end + ')';
|
421
526
|
}
|
527
|
+
|
422
528
|
MissingDataException.prototype = new Error();
|
423
529
|
MissingDataException.prototype.name = 'MissingDataException';
|
424
530
|
MissingDataException.constructor = MissingDataException;
|
425
531
|
return MissingDataException;
|
426
532
|
}();
|
533
|
+
|
534
|
+
exports.MissingDataException = MissingDataException;
|
535
|
+
|
536
|
+
var XRefEntryException = function XRefEntryExceptionClosure() {
|
537
|
+
function XRefEntryException(msg) {
|
538
|
+
this.message = msg;
|
539
|
+
}
|
540
|
+
|
541
|
+
XRefEntryException.prototype = new Error();
|
542
|
+
XRefEntryException.prototype.name = 'XRefEntryException';
|
543
|
+
XRefEntryException.constructor = XRefEntryException;
|
544
|
+
return XRefEntryException;
|
545
|
+
}();
|
546
|
+
|
547
|
+
exports.XRefEntryException = XRefEntryException;
|
548
|
+
|
427
549
|
var XRefParseException = function XRefParseExceptionClosure() {
|
428
550
|
function XRefParseException(msg) {
|
429
551
|
this.message = msg;
|
430
552
|
}
|
553
|
+
|
431
554
|
XRefParseException.prototype = new Error();
|
432
555
|
XRefParseException.prototype.name = 'XRefParseException';
|
433
556
|
XRefParseException.constructor = XRefParseException;
|
434
557
|
return XRefParseException;
|
435
558
|
}();
|
559
|
+
|
560
|
+
exports.XRefParseException = XRefParseException;
|
561
|
+
|
436
562
|
var FormatError = function FormatErrorClosure() {
|
437
563
|
function FormatError(msg) {
|
438
564
|
this.message = msg;
|
439
565
|
}
|
566
|
+
|
440
567
|
FormatError.prototype = new Error();
|
441
568
|
FormatError.prototype.name = 'FormatError';
|
442
569
|
FormatError.constructor = FormatError;
|
443
570
|
return FormatError;
|
444
571
|
}();
|
572
|
+
|
573
|
+
exports.FormatError = FormatError;
|
574
|
+
|
445
575
|
var AbortException = function AbortExceptionClosure() {
|
446
576
|
function AbortException(msg) {
|
447
577
|
this.name = 'AbortException';
|
448
578
|
this.message = msg;
|
449
579
|
}
|
580
|
+
|
450
581
|
AbortException.prototype = new Error();
|
451
582
|
AbortException.constructor = AbortException;
|
452
583
|
return AbortException;
|
453
584
|
}();
|
585
|
+
|
586
|
+
exports.AbortException = AbortException;
|
454
587
|
var NullCharactersRegExp = /\x00/g;
|
588
|
+
|
455
589
|
function removeNullCharacters(str) {
|
456
590
|
if (typeof str !== 'string') {
|
457
591
|
warn('The argument for removeNullCharacters must be a string.');
|
458
592
|
return str;
|
459
593
|
}
|
594
|
+
|
460
595
|
return str.replace(NullCharactersRegExp, '');
|
461
596
|
}
|
597
|
+
|
462
598
|
function bytesToString(bytes) {
|
463
|
-
assert(bytes !== null &&
|
599
|
+
assert(bytes !== null && _typeof(bytes) === 'object' && bytes.length !== undefined, 'Invalid argument for bytesToString');
|
464
600
|
var length = bytes.length;
|
465
601
|
var MAX_ARGUMENT_COUNT = 8192;
|
602
|
+
|
466
603
|
if (length < MAX_ARGUMENT_COUNT) {
|
467
604
|
return String.fromCharCode.apply(null, bytes);
|
468
605
|
}
|
606
|
+
|
469
607
|
var strBuf = [];
|
608
|
+
|
470
609
|
for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) {
|
471
610
|
var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);
|
472
611
|
var chunk = bytes.subarray(i, chunkEnd);
|
473
612
|
strBuf.push(String.fromCharCode.apply(null, chunk));
|
474
613
|
}
|
614
|
+
|
475
615
|
return strBuf.join('');
|
476
616
|
}
|
617
|
+
|
477
618
|
function stringToBytes(str) {
|
478
619
|
assert(typeof str === 'string', 'Invalid argument for stringToBytes');
|
479
620
|
var length = str.length;
|
480
621
|
var bytes = new Uint8Array(length);
|
622
|
+
|
481
623
|
for (var i = 0; i < length; ++i) {
|
482
624
|
bytes[i] = str.charCodeAt(i) & 0xFF;
|
483
625
|
}
|
626
|
+
|
484
627
|
return bytes;
|
485
628
|
}
|
629
|
+
|
486
630
|
function arrayByteLength(arr) {
|
487
631
|
if (arr.length !== undefined) {
|
488
632
|
return arr.length;
|
489
633
|
}
|
634
|
+
|
490
635
|
assert(arr.byteLength !== undefined);
|
491
636
|
return arr.byteLength;
|
492
637
|
}
|
638
|
+
|
493
639
|
function arraysToBytes(arr) {
|
494
640
|
if (arr.length === 1 && arr[0] instanceof Uint8Array) {
|
495
641
|
return arr[0];
|
496
642
|
}
|
643
|
+
|
497
644
|
var resultLength = 0;
|
498
645
|
var i,
|
499
646
|
ii = arr.length;
|
500
647
|
var item, itemLength;
|
648
|
+
|
501
649
|
for (i = 0; i < ii; i++) {
|
502
650
|
item = arr[i];
|
503
651
|
itemLength = arrayByteLength(item);
|
504
652
|
resultLength += itemLength;
|
505
653
|
}
|
654
|
+
|
506
655
|
var pos = 0;
|
507
656
|
var data = new Uint8Array(resultLength);
|
657
|
+
|
508
658
|
for (i = 0; i < ii; i++) {
|
509
659
|
item = arr[i];
|
660
|
+
|
510
661
|
if (!(item instanceof Uint8Array)) {
|
511
662
|
if (typeof item === 'string') {
|
512
663
|
item = stringToBytes(item);
|
@@ -514,36 +665,46 @@ function arraysToBytes(arr) {
|
|
514
665
|
item = new Uint8Array(item);
|
515
666
|
}
|
516
667
|
}
|
668
|
+
|
517
669
|
itemLength = item.byteLength;
|
518
670
|
data.set(item, pos);
|
519
671
|
pos += itemLength;
|
520
672
|
}
|
673
|
+
|
521
674
|
return data;
|
522
675
|
}
|
676
|
+
|
523
677
|
function string32(value) {
|
524
678
|
return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff);
|
525
679
|
}
|
680
|
+
|
526
681
|
function log2(x) {
|
527
682
|
if (x <= 0) {
|
528
683
|
return 0;
|
529
684
|
}
|
685
|
+
|
530
686
|
return Math.ceil(Math.log2(x));
|
531
687
|
}
|
688
|
+
|
532
689
|
function readInt8(data, start) {
|
533
690
|
return data[start] << 24 >> 24;
|
534
691
|
}
|
692
|
+
|
535
693
|
function readUint16(data, offset) {
|
536
694
|
return data[offset] << 8 | data[offset + 1];
|
537
695
|
}
|
696
|
+
|
538
697
|
function readUint32(data, offset) {
|
539
698
|
return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0;
|
540
699
|
}
|
700
|
+
|
541
701
|
function isLittleEndian() {
|
542
702
|
var buffer8 = new Uint8Array(4);
|
543
703
|
buffer8[0] = 1;
|
544
704
|
var view32 = new Uint32Array(buffer8.buffer, 0, 1);
|
545
705
|
return view32[0] === 1;
|
546
706
|
}
|
707
|
+
|
547
708
|
function isEvalSupported() {
|
548
709
|
try {
|
549
710
|
new Function('');
|
@@ -552,59 +713,73 @@ function isEvalSupported() {
|
|
552
713
|
return false;
|
553
714
|
}
|
554
715
|
}
|
716
|
+
|
555
717
|
function getInheritableProperty(_ref) {
|
556
718
|
var dict = _ref.dict,
|
557
719
|
key = _ref.key,
|
558
720
|
_ref$getArray = _ref.getArray,
|
559
|
-
getArray = _ref$getArray ===
|
721
|
+
getArray = _ref$getArray === void 0 ? false : _ref$getArray,
|
560
722
|
_ref$stopWhenFound = _ref.stopWhenFound,
|
561
|
-
stopWhenFound = _ref$stopWhenFound ===
|
562
|
-
|
723
|
+
stopWhenFound = _ref$stopWhenFound === void 0 ? true : _ref$stopWhenFound;
|
563
724
|
var LOOP_LIMIT = 100;
|
564
725
|
var loopCount = 0;
|
565
|
-
var values
|
726
|
+
var values;
|
727
|
+
|
566
728
|
while (dict) {
|
567
729
|
var value = getArray ? dict.getArray(key) : dict.get(key);
|
730
|
+
|
568
731
|
if (value !== undefined) {
|
569
732
|
if (stopWhenFound) {
|
570
733
|
return value;
|
571
734
|
}
|
735
|
+
|
572
736
|
if (!values) {
|
573
737
|
values = [];
|
574
738
|
}
|
739
|
+
|
575
740
|
values.push(value);
|
576
741
|
}
|
742
|
+
|
577
743
|
if (++loopCount > LOOP_LIMIT) {
|
578
|
-
warn(
|
744
|
+
warn("getInheritableProperty: maximum loop count exceeded for \"".concat(key, "\""));
|
579
745
|
break;
|
580
746
|
}
|
747
|
+
|
581
748
|
dict = dict.get('Parent');
|
582
749
|
}
|
750
|
+
|
583
751
|
return values;
|
584
752
|
}
|
753
|
+
|
585
754
|
var Util = function UtilClosure() {
|
586
755
|
function Util() {}
|
756
|
+
|
587
757
|
var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')'];
|
758
|
+
|
588
759
|
Util.makeCssRgb = function Util_makeCssRgb(r, g, b) {
|
589
760
|
rgbBuf[1] = r;
|
590
761
|
rgbBuf[3] = g;
|
591
762
|
rgbBuf[5] = b;
|
592
763
|
return rgbBuf.join('');
|
593
764
|
};
|
765
|
+
|
594
766
|
Util.transform = function Util_transform(m1, m2) {
|
595
767
|
return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]];
|
596
768
|
};
|
769
|
+
|
597
770
|
Util.applyTransform = function Util_applyTransform(p, m) {
|
598
771
|
var xt = p[0] * m[0] + p[1] * m[2] + m[4];
|
599
772
|
var yt = p[0] * m[1] + p[1] * m[3] + m[5];
|
600
773
|
return [xt, yt];
|
601
774
|
};
|
775
|
+
|
602
776
|
Util.applyInverseTransform = function Util_applyInverseTransform(p, m) {
|
603
777
|
var d = m[0] * m[3] - m[1] * m[2];
|
604
778
|
var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;
|
605
779
|
var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;
|
606
780
|
return [xt, yt];
|
607
781
|
};
|
782
|
+
|
608
783
|
Util.getAxialAlignedBoundingBox = function Util_getAxialAlignedBoundingBox(r, m) {
|
609
784
|
var p1 = Util.applyTransform(r, m);
|
610
785
|
var p2 = Util.applyTransform(r.slice(2, 4), m);
|
@@ -612,13 +787,16 @@ var Util = function UtilClosure() {
|
|
612
787
|
var p4 = Util.applyTransform([r[2], r[1]], m);
|
613
788
|
return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])];
|
614
789
|
};
|
790
|
+
|
615
791
|
Util.inverseTransform = function Util_inverseTransform(m) {
|
616
792
|
var d = m[0] * m[3] - m[1] * m[2];
|
617
793
|
return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d];
|
618
794
|
};
|
795
|
+
|
619
796
|
Util.apply3dTransform = function Util_apply3dTransform(m, v) {
|
620
797
|
return [m[0] * v[0] + m[1] * v[1] + m[2] * v[2], m[3] * v[0] + m[4] * v[1] + m[5] * v[2], m[6] * v[0] + m[7] * v[1] + m[8] * v[2]];
|
621
798
|
};
|
799
|
+
|
622
800
|
Util.singularValueDecompose2dScale = function Util_singularValueDecompose2dScale(m) {
|
623
801
|
var transpose = [m[0], m[2], m[1], m[3]];
|
624
802
|
var a = m[0] * transpose[0] + m[1] * transpose[2];
|
@@ -631,54 +809,68 @@ var Util = function UtilClosure() {
|
|
631
809
|
var sy = first - second || 1;
|
632
810
|
return [Math.sqrt(sx), Math.sqrt(sy)];
|
633
811
|
};
|
812
|
+
|
634
813
|
Util.normalizeRect = function Util_normalizeRect(rect) {
|
635
814
|
var r = rect.slice(0);
|
815
|
+
|
636
816
|
if (rect[0] > rect[2]) {
|
637
817
|
r[0] = rect[2];
|
638
818
|
r[2] = rect[0];
|
639
819
|
}
|
820
|
+
|
640
821
|
if (rect[1] > rect[3]) {
|
641
822
|
r[1] = rect[3];
|
642
823
|
r[3] = rect[1];
|
643
824
|
}
|
825
|
+
|
644
826
|
return r;
|
645
827
|
};
|
828
|
+
|
646
829
|
Util.intersect = function Util_intersect(rect1, rect2) {
|
647
830
|
function compare(a, b) {
|
648
831
|
return a - b;
|
649
832
|
}
|
833
|
+
|
650
834
|
var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare),
|
651
835
|
orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare),
|
652
836
|
result = [];
|
653
837
|
rect1 = Util.normalizeRect(rect1);
|
654
838
|
rect2 = Util.normalizeRect(rect2);
|
839
|
+
|
655
840
|
if (orderedX[0] === rect1[0] && orderedX[1] === rect2[0] || orderedX[0] === rect2[0] && orderedX[1] === rect1[0]) {
|
656
841
|
result[0] = orderedX[1];
|
657
842
|
result[2] = orderedX[2];
|
658
843
|
} else {
|
659
844
|
return false;
|
660
845
|
}
|
846
|
+
|
661
847
|
if (orderedY[0] === rect1[1] && orderedY[1] === rect2[1] || orderedY[0] === rect2[1] && orderedY[1] === rect1[1]) {
|
662
848
|
result[1] = orderedY[1];
|
663
849
|
result[3] = orderedY[2];
|
664
850
|
} else {
|
665
851
|
return false;
|
666
852
|
}
|
853
|
+
|
667
854
|
return result;
|
668
855
|
};
|
856
|
+
|
669
857
|
return Util;
|
670
858
|
}();
|
859
|
+
|
860
|
+
exports.Util = Util;
|
671
861
|
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'];
|
862
|
+
|
672
863
|
function toRomanNumerals(number) {
|
673
864
|
var lowerCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
674
|
-
|
675
865
|
assert(Number.isInteger(number) && number > 0, 'The number should be a positive integer.');
|
676
|
-
var pos
|
866
|
+
var pos,
|
677
867
|
romanBuf = [];
|
868
|
+
|
678
869
|
while (number >= 1000) {
|
679
870
|
number -= 1000;
|
680
871
|
romanBuf.push('M');
|
681
872
|
}
|
873
|
+
|
682
874
|
pos = number / 100 | 0;
|
683
875
|
number %= 100;
|
684
876
|
romanBuf.push(ROMAN_NUMBER_MAP[pos]);
|
@@ -689,11 +881,14 @@ function toRomanNumerals(number) {
|
|
689
881
|
var romanStr = romanBuf.join('');
|
690
882
|
return lowerCase ? romanStr.toLowerCase() : romanStr;
|
691
883
|
}
|
884
|
+
|
692
885
|
var PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC];
|
886
|
+
|
693
887
|
function stringToPDFString(str) {
|
694
888
|
var i,
|
695
889
|
n = str.length,
|
696
890
|
strBuf = [];
|
891
|
+
|
697
892
|
if (str[0] === '\xFE' && str[1] === '\xFF') {
|
698
893
|
for (i = 2; i < n; i += 2) {
|
699
894
|
strBuf.push(String.fromCharCode(str.charCodeAt(i) << 8 | str.charCodeAt(i + 1)));
|
@@ -704,53 +899,82 @@ function stringToPDFString(str) {
|
|
704
899
|
strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));
|
705
900
|
}
|
706
901
|
}
|
902
|
+
|
707
903
|
return strBuf.join('');
|
708
904
|
}
|
905
|
+
|
709
906
|
function stringToUTF8String(str) {
|
710
907
|
return decodeURIComponent(escape(str));
|
711
908
|
}
|
909
|
+
|
712
910
|
function utf8StringToString(str) {
|
713
911
|
return unescape(encodeURIComponent(str));
|
714
912
|
}
|
913
|
+
|
715
914
|
function isEmptyObj(obj) {
|
716
915
|
for (var key in obj) {
|
717
916
|
return false;
|
718
917
|
}
|
918
|
+
|
719
919
|
return true;
|
720
920
|
}
|
921
|
+
|
721
922
|
function isBool(v) {
|
722
923
|
return typeof v === 'boolean';
|
723
924
|
}
|
925
|
+
|
724
926
|
function isNum(v) {
|
725
927
|
return typeof v === 'number';
|
726
928
|
}
|
929
|
+
|
727
930
|
function isString(v) {
|
728
931
|
return typeof v === 'string';
|
729
932
|
}
|
933
|
+
|
730
934
|
function isArrayBuffer(v) {
|
731
|
-
return
|
935
|
+
return _typeof(v) === 'object' && v !== null && v.byteLength !== undefined;
|
732
936
|
}
|
937
|
+
|
733
938
|
function isSpace(ch) {
|
734
939
|
return ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A;
|
735
940
|
}
|
941
|
+
|
736
942
|
function createPromiseCapability() {
|
737
|
-
var capability =
|
943
|
+
var capability = Object.create(null);
|
944
|
+
var isSettled = false;
|
945
|
+
Object.defineProperty(capability, 'settled', {
|
946
|
+
get: function get() {
|
947
|
+
return isSettled;
|
948
|
+
}
|
949
|
+
});
|
738
950
|
capability.promise = new Promise(function (resolve, reject) {
|
739
|
-
capability.resolve =
|
740
|
-
|
951
|
+
capability.resolve = function (data) {
|
952
|
+
isSettled = true;
|
953
|
+
resolve(data);
|
954
|
+
};
|
955
|
+
|
956
|
+
capability.reject = function (reason) {
|
957
|
+
isSettled = true;
|
958
|
+
reject(reason);
|
959
|
+
};
|
741
960
|
});
|
742
961
|
return capability;
|
743
962
|
}
|
963
|
+
|
744
964
|
var createObjectURL = function createObjectURLClosure() {
|
745
965
|
var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
746
966
|
return function createObjectURL(data, contentType) {
|
747
967
|
var forceDataSchema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
748
968
|
|
749
969
|
if (!forceDataSchema && _url_polyfill.URL.createObjectURL) {
|
750
|
-
var blob = new Blob([data], {
|
970
|
+
var blob = new Blob([data], {
|
971
|
+
type: contentType
|
972
|
+
});
|
751
973
|
return _url_polyfill.URL.createObjectURL(blob);
|
752
974
|
}
|
975
|
+
|
753
976
|
var buffer = 'data:' + contentType + ';base64,';
|
977
|
+
|
754
978
|
for (var i = 0, ii = data.length; i < ii; i += 3) {
|
755
979
|
var b1 = data[i] & 0xFF;
|
756
980
|
var b2 = data[i + 1] & 0xFF;
|
@@ -761,71 +985,9 @@ var createObjectURL = function createObjectURLClosure() {
|
|
761
985
|
var d4 = i + 2 < ii ? b3 & 0x3F : 64;
|
762
986
|
buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4];
|
763
987
|
}
|
988
|
+
|
764
989
|
return buffer;
|
765
990
|
};
|
766
991
|
}();
|
767
|
-
|
768
|
-
exports.
|
769
|
-
exports.OPS = OPS;
|
770
|
-
exports.VerbosityLevel = VerbosityLevel;
|
771
|
-
exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES;
|
772
|
-
exports.AnnotationBorderStyleType = AnnotationBorderStyleType;
|
773
|
-
exports.AnnotationFieldFlag = AnnotationFieldFlag;
|
774
|
-
exports.AnnotationFlag = AnnotationFlag;
|
775
|
-
exports.AnnotationType = AnnotationType;
|
776
|
-
exports.FontType = FontType;
|
777
|
-
exports.ImageKind = ImageKind;
|
778
|
-
exports.CMapCompressionType = CMapCompressionType;
|
779
|
-
exports.AbortException = AbortException;
|
780
|
-
exports.InvalidPDFException = InvalidPDFException;
|
781
|
-
exports.MissingDataException = MissingDataException;
|
782
|
-
exports.MissingPDFException = MissingPDFException;
|
783
|
-
exports.NativeImageDecoding = NativeImageDecoding;
|
784
|
-
exports.PasswordException = PasswordException;
|
785
|
-
exports.PasswordResponses = PasswordResponses;
|
786
|
-
exports.PermissionFlag = PermissionFlag;
|
787
|
-
exports.StreamType = StreamType;
|
788
|
-
exports.TextRenderingMode = TextRenderingMode;
|
789
|
-
exports.UnexpectedResponseException = UnexpectedResponseException;
|
790
|
-
exports.UnknownErrorException = UnknownErrorException;
|
791
|
-
exports.Util = Util;
|
792
|
-
exports.toRomanNumerals = toRomanNumerals;
|
793
|
-
exports.XRefParseException = XRefParseException;
|
794
|
-
exports.FormatError = FormatError;
|
795
|
-
exports.arrayByteLength = arrayByteLength;
|
796
|
-
exports.arraysToBytes = arraysToBytes;
|
797
|
-
exports.assert = assert;
|
798
|
-
exports.bytesToString = bytesToString;
|
799
|
-
exports.createPromiseCapability = createPromiseCapability;
|
800
|
-
exports.createObjectURL = createObjectURL;
|
801
|
-
exports.deprecated = deprecated;
|
802
|
-
exports.getInheritableProperty = getInheritableProperty;
|
803
|
-
exports.getLookupTableFactory = getLookupTableFactory;
|
804
|
-
exports.getVerbosityLevel = getVerbosityLevel;
|
805
|
-
exports.info = info;
|
806
|
-
exports.isArrayBuffer = isArrayBuffer;
|
807
|
-
exports.isBool = isBool;
|
808
|
-
exports.isEmptyObj = isEmptyObj;
|
809
|
-
exports.isNum = isNum;
|
810
|
-
exports.isString = isString;
|
811
|
-
exports.isSpace = isSpace;
|
812
|
-
exports.isSameOrigin = isSameOrigin;
|
813
|
-
exports.createValidAbsoluteUrl = createValidAbsoluteUrl;
|
814
|
-
exports.isLittleEndian = isLittleEndian;
|
815
|
-
exports.isEvalSupported = isEvalSupported;
|
816
|
-
exports.log2 = log2;
|
817
|
-
exports.readInt8 = readInt8;
|
818
|
-
exports.readUint16 = readUint16;
|
819
|
-
exports.readUint32 = readUint32;
|
820
|
-
exports.removeNullCharacters = removeNullCharacters;
|
821
|
-
exports.ReadableStream = _streams_polyfill.ReadableStream;
|
822
|
-
exports.URL = _url_polyfill.URL;
|
823
|
-
exports.setVerbosityLevel = setVerbosityLevel;
|
824
|
-
exports.shadow = shadow;
|
825
|
-
exports.string32 = string32;
|
826
|
-
exports.stringToBytes = stringToBytes;
|
827
|
-
exports.stringToPDFString = stringToPDFString;
|
828
|
-
exports.stringToUTF8String = stringToUTF8String;
|
829
|
-
exports.utf8StringToString = utf8StringToString;
|
830
|
-
exports.warn = warn;
|
831
|
-
exports.unreachable = unreachable;
|
992
|
+
|
993
|
+
exports.createObjectURL = createObjectURL;
|