pdfjs-dist 2.1.266 → 2.5.207
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/CODE_OF_CONDUCT.md +15 -0
- package/README.md +4 -0
- package/bower.json +1 -1
- package/build/pdf.js +8382 -18492
- package/build/pdf.js.map +1 -1
- package/build/pdf.min.js +22 -1
- package/build/pdf.worker.entry.js +5 -3
- package/build/pdf.worker.js +20417 -29816
- package/build/pdf.worker.js.map +1 -1
- package/build/pdf.worker.min.js +22 -1
- package/es5/build/pdf.js +25688 -0
- package/es5/build/pdf.js.map +1 -0
- package/{lib/shared/global_scope.js → es5/build/pdf.worker.entry.js} +5 -10
- package/es5/build/pdf.worker.js +58239 -0
- package/es5/build/pdf.worker.js.map +1 -0
- package/es5/web/images/annotation-check.svg +11 -0
- package/es5/web/images/annotation-comment.svg +16 -0
- package/es5/web/images/annotation-help.svg +26 -0
- package/es5/web/images/annotation-insert.svg +10 -0
- package/es5/web/images/annotation-key.svg +11 -0
- package/es5/web/images/annotation-newparagraph.svg +11 -0
- package/es5/web/images/annotation-noicon.svg +7 -0
- package/es5/web/images/annotation-note.svg +42 -0
- package/es5/web/images/annotation-paragraph.svg +16 -0
- package/es5/web/images/loading-icon.gif +0 -0
- package/es5/web/images/shadow.png +0 -0
- package/es5/web/images/texture.png +0 -0
- package/es5/web/pdf_viewer.css +403 -0
- package/es5/web/pdf_viewer.js +7742 -0
- package/es5/web/pdf_viewer.js.map +1 -0
- package/image_decoders/pdf.image_decoders.js +1475 -4897
- package/image_decoders/pdf.image_decoders.js.map +1 -1
- package/image_decoders/pdf.image_decoders.min.js +22 -1
- package/lib/README.md +7 -0
- package/lib/core/annotation.js +750 -899
- package/lib/core/arithmetic_decoder.js +81 -97
- package/lib/core/bidi.js +54 -46
- package/lib/core/ccitt.js +88 -81
- package/lib/core/ccitt_stream.js +15 -14
- package/lib/core/cff_parser.js +235 -183
- package/lib/core/charsets.js +4 -4
- package/lib/core/chunked_stream.js +447 -542
- package/lib/core/cmap.js +222 -264
- package/lib/core/colorspace.js +699 -863
- package/lib/core/core_utils.js +152 -0
- package/lib/core/crypto.js +379 -437
- package/lib/core/document.js +573 -660
- package/lib/core/encodings.js +15 -15
- package/lib/core/evaluator.js +1103 -868
- package/lib/core/font_renderer.js +135 -178
- package/lib/core/fonts.js +570 -491
- package/lib/core/function.js +291 -288
- package/lib/core/glyphlist.js +4527 -4526
- package/lib/core/image.js +145 -149
- package/lib/core/image_utils.js +170 -0
- package/lib/core/jbig2.js +325 -316
- package/lib/core/jbig2_stream.js +18 -17
- package/lib/core/jpeg_stream.js +21 -26
- package/lib/core/jpg.js +284 -232
- package/lib/core/jpx.js +161 -143
- package/lib/core/jpx_stream.js +28 -28
- package/lib/core/metrics.js +2929 -2929
- package/lib/core/murmurhash3.js +90 -101
- package/lib/core/obj.js +1183 -1157
- package/lib/core/operator_list.js +99 -67
- package/lib/core/parser.js +972 -911
- package/lib/core/pattern.js +87 -70
- package/lib/core/pdf_manager.js +150 -315
- package/lib/core/primitives.js +83 -56
- package/lib/core/ps_parser.js +175 -214
- package/lib/core/standard_fonts.js +237 -236
- package/lib/core/stream.js +94 -74
- package/lib/core/type1_parser.js +87 -69
- package/lib/core/unicode.js +1654 -1654
- package/lib/core/worker.js +193 -390
- package/lib/core/worker_stream.js +168 -0
- package/lib/display/annotation_layer.js +741 -972
- package/lib/display/api.js +1500 -1791
- package/lib/display/api_compatibility.js +12 -17
- package/lib/display/canvas.js +165 -165
- package/lib/display/content_disposition.js +40 -59
- package/lib/display/display_utils.js +515 -0
- package/lib/display/fetch_stream.js +183 -298
- package/lib/display/font_loader.js +273 -413
- package/lib/display/metadata.js +86 -98
- package/lib/display/network.js +266 -359
- package/lib/display/network_utils.js +25 -18
- package/lib/display/node_stream.js +285 -458
- package/lib/display/pattern_helper.js +113 -65
- package/lib/display/svg.js +1166 -901
- package/lib/display/text_layer.js +156 -132
- package/lib/display/transport_stream.js +262 -278
- package/lib/display/webgl.js +70 -83
- package/lib/display/worker_options.js +3 -3
- package/lib/display/xml_parser.js +303 -392
- package/lib/examples/node/domstubs.js +40 -37
- package/lib/pdf.js +226 -59
- package/lib/pdf.worker.js +14 -6
- package/lib/shared/compatibility.js +3 -246
- package/lib/shared/is_node.js +7 -6
- package/lib/shared/message_handler.js +327 -332
- package/lib/shared/util.js +266 -416
- package/lib/test/unit/annotation_spec.js +1555 -701
- package/lib/test/unit/api_spec.js +802 -604
- package/lib/test/unit/bidi_spec.js +7 -7
- package/lib/test/unit/cff_parser_spec.js +84 -69
- package/lib/test/unit/clitests_helper.js +7 -9
- package/lib/test/unit/cmap_spec.js +74 -76
- package/lib/test/unit/colorspace_spec.js +166 -161
- package/lib/test/unit/core_utils_spec.js +211 -0
- package/lib/test/unit/crypto_spec.js +181 -181
- package/lib/test/unit/custom_spec.js +20 -22
- package/lib/test/unit/display_svg_spec.js +34 -39
- package/lib/test/unit/display_utils_spec.js +263 -0
- package/lib/test/unit/document_spec.js +16 -21
- package/lib/test/unit/encodings_spec.js +12 -34
- package/lib/test/unit/evaluator_spec.js +83 -83
- package/lib/test/unit/fetch_stream_spec.js +111 -0
- package/lib/test/unit/function_spec.js +206 -204
- package/lib/test/unit/jasmine-boot.js +46 -30
- package/lib/test/unit/message_handler_spec.js +173 -159
- package/lib/test/unit/metadata_spec.js +69 -69
- package/lib/test/unit/murmurhash3_spec.js +12 -12
- package/lib/test/unit/network_spec.js +13 -61
- package/lib/test/unit/network_utils_spec.js +183 -119
- package/lib/test/unit/node_stream_spec.js +78 -92
- package/lib/test/unit/parser_spec.js +172 -114
- package/lib/test/unit/pdf_find_controller_spec.js +55 -86
- package/lib/test/unit/pdf_find_utils_spec.js +32 -32
- package/lib/test/unit/pdf_history_spec.js +32 -32
- package/lib/test/unit/primitives_spec.js +140 -125
- package/lib/test/unit/stream_spec.js +16 -14
- package/lib/test/unit/test_utils.js +131 -143
- package/lib/test/unit/testreporter.js +19 -19
- package/lib/test/unit/type1_parser_spec.js +42 -42
- package/lib/test/unit/ui_utils_spec.js +297 -459
- package/lib/test/unit/unicode_spec.js +38 -38
- package/lib/test/unit/util_spec.js +121 -305
- package/lib/web/annotation_layer_builder.js +66 -103
- package/lib/web/app.js +1328 -1214
- package/lib/web/app_options.js +105 -107
- package/lib/web/base_viewer.js +824 -838
- package/lib/web/chromecom.js +165 -252
- package/lib/web/debugger.js +149 -205
- package/lib/web/download_manager.js +39 -55
- package/lib/web/firefox_print_service.js +37 -27
- package/lib/web/firefoxcom.js +212 -363
- package/lib/web/genericcom.js +26 -108
- package/lib/web/genericl10n.js +24 -153
- package/lib/web/grab_to_pan.js +32 -30
- package/lib/web/interfaces.js +80 -254
- package/lib/web/overlay_manager.js +70 -246
- package/lib/web/password_prompt.js +38 -64
- package/lib/web/pdf_attachment_viewer.js +113 -131
- package/lib/web/pdf_cursor_tools.js +75 -102
- package/lib/web/pdf_document_properties.js +221 -306
- package/lib/web/pdf_find_bar.js +136 -170
- package/lib/web/pdf_find_controller.js +491 -548
- package/lib/web/pdf_find_utils.js +13 -13
- package/lib/web/pdf_history.js +397 -406
- package/lib/web/pdf_link_service.js +304 -348
- package/lib/web/pdf_outline_viewer.js +140 -175
- package/lib/web/pdf_page_view.js +452 -523
- package/lib/web/pdf_presentation_mode.js +308 -357
- package/lib/web/pdf_print_service.js +90 -104
- package/lib/web/pdf_rendering_queue.js +84 -108
- package/lib/web/pdf_sidebar.js +276 -306
- package/lib/web/pdf_sidebar_resizer.js +92 -119
- package/lib/web/pdf_single_page_viewer.js +77 -126
- package/lib/web/pdf_thumbnail_view.js +276 -297
- package/lib/web/pdf_thumbnail_viewer.js +186 -206
- package/lib/web/pdf_viewer.component.js +20 -21
- package/lib/web/pdf_viewer.js +55 -115
- package/lib/web/preferences.js +82 -286
- package/lib/web/secondary_toolbar.js +164 -196
- package/lib/web/text_layer_builder.js +282 -339
- package/lib/web/toolbar.js +217 -210
- package/lib/web/ui_utils.js +267 -420
- package/lib/web/view_history.js +52 -226
- package/lib/web/viewer_compatibility.js +21 -6
- package/package.json +2 -9
- package/web/pdf_viewer.css +35 -25
- package/web/pdf_viewer.js +3489 -4855
- package/web/pdf_viewer.js.map +1 -1
- package/webpack.js +14 -5
- package/external/streams/streams-lib.js +0 -3962
- package/external/url/url-lib.js +0 -627
- package/lib/display/dom_utils.js +0 -494
- package/lib/shared/streams_polyfill.js +0 -43
- package/lib/shared/url_polyfill.js +0 -56
- package/lib/test/unit/dom_utils_spec.js +0 -89
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2020 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -26,7 +26,7 @@ function xmlEncode(s) {
|
|
26
26
|
ch;
|
27
27
|
s = String(s);
|
28
28
|
|
29
|
-
while (i < s.length && (ch = s[i]) !==
|
29
|
+
while (i < s.length && (ch = s[i]) !== "&" && ch !== "<" && ch !== '"' && ch !== "\n" && ch !== "\r" && ch !== "\t") {
|
30
30
|
i++;
|
31
31
|
}
|
32
32
|
|
@@ -40,28 +40,28 @@ function xmlEncode(s) {
|
|
40
40
|
ch = s[i++];
|
41
41
|
|
42
42
|
switch (ch) {
|
43
|
-
case
|
44
|
-
buf +=
|
43
|
+
case "&":
|
44
|
+
buf += "&";
|
45
45
|
break;
|
46
46
|
|
47
|
-
case
|
48
|
-
buf +=
|
47
|
+
case "<":
|
48
|
+
buf += "<";
|
49
49
|
break;
|
50
50
|
|
51
|
-
case '
|
52
|
-
buf +=
|
51
|
+
case '"':
|
52
|
+
buf += """;
|
53
53
|
break;
|
54
54
|
|
55
|
-
case
|
56
|
-
buf +=
|
55
|
+
case "\n":
|
56
|
+
buf += "
";
|
57
57
|
break;
|
58
58
|
|
59
|
-
case
|
60
|
-
buf +=
|
59
|
+
case "\r":
|
60
|
+
buf += "
";
|
61
61
|
break;
|
62
62
|
|
63
|
-
case
|
64
|
-
buf +=
|
63
|
+
case "\t":
|
64
|
+
buf += "	";
|
65
65
|
break;
|
66
66
|
|
67
67
|
default:
|
@@ -77,12 +77,12 @@ function DOMElement(name) {
|
|
77
77
|
this.nodeName = name;
|
78
78
|
this.childNodes = [];
|
79
79
|
this.attributes = {};
|
80
|
-
this.textContent =
|
80
|
+
this.textContent = "";
|
81
81
|
|
82
|
-
if (name ===
|
82
|
+
if (name === "style") {
|
83
83
|
this.sheet = {
|
84
84
|
cssRules: [],
|
85
|
-
insertRule: function
|
85
|
+
insertRule: function (rule) {
|
86
86
|
this.cssRules.push(rule);
|
87
87
|
}
|
88
88
|
};
|
@@ -103,7 +103,7 @@ DOMElement.prototype = {
|
|
103
103
|
}
|
104
104
|
|
105
105
|
if (NS) {
|
106
|
-
var suffix =
|
106
|
+
var suffix = ":" + name;
|
107
107
|
|
108
108
|
for (var fullName in this.attributes) {
|
109
109
|
if (fullName.slice(-suffix.length) === suffix) {
|
@@ -115,7 +115,7 @@ DOMElement.prototype = {
|
|
115
115
|
return null;
|
116
116
|
},
|
117
117
|
setAttribute: function DOMElement_setAttribute(name, value) {
|
118
|
-
value = value ||
|
118
|
+
value = value || "";
|
119
119
|
value = xmlEncode(value);
|
120
120
|
this.attributes[name] = value;
|
121
121
|
},
|
@@ -129,6 +129,9 @@ DOMElement.prototype = {
|
|
129
129
|
childNodes.push(element);
|
130
130
|
}
|
131
131
|
},
|
132
|
+
hasChildNodes: function DOMElement_hasChildNodes() {
|
133
|
+
return this.childNodes.length !== 0;
|
134
|
+
},
|
132
135
|
cloneNode: function DOMElement_cloneNode() {
|
133
136
|
var newNode = new DOMElement(this.nodeName);
|
134
137
|
newNode.childNodes = this.childNodes;
|
@@ -145,7 +148,7 @@ DOMElement.prototype = {
|
|
145
148
|
buf.push(chunk);
|
146
149
|
}
|
147
150
|
|
148
|
-
return buf.join(
|
151
|
+
return buf.join("");
|
149
152
|
},
|
150
153
|
getSerializer: function DOMElement_getSerializer() {
|
151
154
|
return new DOMElementSerializer(this);
|
@@ -167,12 +170,12 @@ DOMElementSerializer.prototype = {
|
|
167
170
|
switch (this._state) {
|
168
171
|
case 0:
|
169
172
|
++this._state;
|
170
|
-
return
|
173
|
+
return "<" + node.nodeName;
|
171
174
|
|
172
175
|
case 1:
|
173
176
|
++this._state;
|
174
177
|
|
175
|
-
if (node.nodeName ===
|
178
|
+
if (node.nodeName === "svg:svg") {
|
176
179
|
return ' xmlns:xlink="http://www.w3.org/1999/xlink"' + ' xmlns:svg="http://www.w3.org/2000/svg"';
|
177
180
|
}
|
178
181
|
|
@@ -184,14 +187,14 @@ DOMElementSerializer.prototype = {
|
|
184
187
|
case 3:
|
185
188
|
if (this._loopIndex < this._attributeKeys.length) {
|
186
189
|
var name = this._attributeKeys[this._loopIndex++];
|
187
|
-
return
|
190
|
+
return " " + name + '="' + xmlEncode(node.attributes[name]) + '"';
|
188
191
|
}
|
189
192
|
|
190
193
|
++this._state;
|
191
|
-
return
|
194
|
+
return ">";
|
192
195
|
|
193
196
|
case 4:
|
194
|
-
if (node.nodeName ===
|
197
|
+
if (node.nodeName === "svg:tspan" || node.nodeName === "svg:style") {
|
195
198
|
this._state = 6;
|
196
199
|
return xmlEncode(node.textContent);
|
197
200
|
}
|
@@ -222,22 +225,22 @@ DOMElementSerializer.prototype = {
|
|
222
225
|
|
223
226
|
case 6:
|
224
227
|
++this._state;
|
225
|
-
return
|
228
|
+
return "</" + node.nodeName + ">";
|
226
229
|
|
227
230
|
case 7:
|
228
231
|
return null;
|
229
232
|
|
230
233
|
default:
|
231
|
-
throw new Error(
|
234
|
+
throw new Error("Unexpected serialization state: " + this._state);
|
232
235
|
}
|
233
236
|
}
|
234
237
|
};
|
235
|
-
|
238
|
+
const document = {
|
236
239
|
childNodes: [],
|
237
240
|
|
238
241
|
get currentScript() {
|
239
242
|
return {
|
240
|
-
src:
|
243
|
+
src: ""
|
241
244
|
};
|
242
245
|
},
|
243
246
|
|
@@ -245,16 +248,16 @@ var document = {
|
|
245
248
|
return this;
|
246
249
|
},
|
247
250
|
|
248
|
-
createElementNS: function
|
251
|
+
createElementNS: function (NS, element) {
|
249
252
|
var elObject = new DOMElement(element);
|
250
253
|
return elObject;
|
251
254
|
},
|
252
|
-
createElement: function
|
253
|
-
return this.createElementNS(
|
255
|
+
createElement: function (element) {
|
256
|
+
return this.createElementNS("", element);
|
254
257
|
},
|
255
|
-
getElementsByTagName: function
|
256
|
-
if (element ===
|
257
|
-
return [this.head || (this.head = new DOMElement(
|
258
|
+
getElementsByTagName: function (element) {
|
259
|
+
if (element === "head") {
|
260
|
+
return [this.head || (this.head = new DOMElement("head"))];
|
258
261
|
}
|
259
262
|
|
260
263
|
return [];
|
@@ -286,14 +289,14 @@ var exported_symbols = Object.keys(exports);
|
|
286
289
|
|
287
290
|
exports.setStubs = function (namespace) {
|
288
291
|
exported_symbols.forEach(function (key) {
|
289
|
-
console.assert(!(key in namespace),
|
292
|
+
console.assert(!(key in namespace), "property should not be set: " + key);
|
290
293
|
namespace[key] = exports[key];
|
291
294
|
});
|
292
295
|
};
|
293
296
|
|
294
297
|
exports.unsetStubs = function (namespace) {
|
295
298
|
exported_symbols.forEach(function (key) {
|
296
|
-
console.assert(key in namespace,
|
299
|
+
console.assert(key in namespace, "property should be set: " + key);
|
297
300
|
delete namespace[key];
|
298
301
|
});
|
299
302
|
};
|
package/lib/pdf.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2020 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -19,81 +19,248 @@
|
|
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
|
-
|
25
|
-
|
24
|
+
Object.defineProperty(exports, "__esModule", {
|
25
|
+
value: true
|
26
|
+
});
|
27
|
+
Object.defineProperty(exports, "addLinkAttributes", {
|
28
|
+
enumerable: true,
|
29
|
+
get: function () {
|
30
|
+
return _display_utils.addLinkAttributes;
|
31
|
+
}
|
32
|
+
});
|
33
|
+
Object.defineProperty(exports, "getFilenameFromUrl", {
|
34
|
+
enumerable: true,
|
35
|
+
get: function () {
|
36
|
+
return _display_utils.getFilenameFromUrl;
|
37
|
+
}
|
38
|
+
});
|
39
|
+
Object.defineProperty(exports, "LinkTarget", {
|
40
|
+
enumerable: true,
|
41
|
+
get: function () {
|
42
|
+
return _display_utils.LinkTarget;
|
43
|
+
}
|
44
|
+
});
|
45
|
+
Object.defineProperty(exports, "loadScript", {
|
46
|
+
enumerable: true,
|
47
|
+
get: function () {
|
48
|
+
return _display_utils.loadScript;
|
49
|
+
}
|
50
|
+
});
|
51
|
+
Object.defineProperty(exports, "PDFDateString", {
|
52
|
+
enumerable: true,
|
53
|
+
get: function () {
|
54
|
+
return _display_utils.PDFDateString;
|
55
|
+
}
|
56
|
+
});
|
57
|
+
Object.defineProperty(exports, "RenderingCancelledException", {
|
58
|
+
enumerable: true,
|
59
|
+
get: function () {
|
60
|
+
return _display_utils.RenderingCancelledException;
|
61
|
+
}
|
62
|
+
});
|
63
|
+
Object.defineProperty(exports, "build", {
|
64
|
+
enumerable: true,
|
65
|
+
get: function () {
|
66
|
+
return _api.build;
|
67
|
+
}
|
68
|
+
});
|
69
|
+
Object.defineProperty(exports, "getDocument", {
|
70
|
+
enumerable: true,
|
71
|
+
get: function () {
|
72
|
+
return _api.getDocument;
|
73
|
+
}
|
74
|
+
});
|
75
|
+
Object.defineProperty(exports, "LoopbackPort", {
|
76
|
+
enumerable: true,
|
77
|
+
get: function () {
|
78
|
+
return _api.LoopbackPort;
|
79
|
+
}
|
80
|
+
});
|
81
|
+
Object.defineProperty(exports, "PDFDataRangeTransport", {
|
82
|
+
enumerable: true,
|
83
|
+
get: function () {
|
84
|
+
return _api.PDFDataRangeTransport;
|
85
|
+
}
|
86
|
+
});
|
87
|
+
Object.defineProperty(exports, "PDFWorker", {
|
88
|
+
enumerable: true,
|
89
|
+
get: function () {
|
90
|
+
return _api.PDFWorker;
|
91
|
+
}
|
92
|
+
});
|
93
|
+
Object.defineProperty(exports, "version", {
|
94
|
+
enumerable: true,
|
95
|
+
get: function () {
|
96
|
+
return _api.version;
|
97
|
+
}
|
98
|
+
});
|
99
|
+
Object.defineProperty(exports, "CMapCompressionType", {
|
100
|
+
enumerable: true,
|
101
|
+
get: function () {
|
102
|
+
return _util.CMapCompressionType;
|
103
|
+
}
|
104
|
+
});
|
105
|
+
Object.defineProperty(exports, "createObjectURL", {
|
106
|
+
enumerable: true,
|
107
|
+
get: function () {
|
108
|
+
return _util.createObjectURL;
|
109
|
+
}
|
110
|
+
});
|
111
|
+
Object.defineProperty(exports, "createPromiseCapability", {
|
112
|
+
enumerable: true,
|
113
|
+
get: function () {
|
114
|
+
return _util.createPromiseCapability;
|
115
|
+
}
|
116
|
+
});
|
117
|
+
Object.defineProperty(exports, "createValidAbsoluteUrl", {
|
118
|
+
enumerable: true,
|
119
|
+
get: function () {
|
120
|
+
return _util.createValidAbsoluteUrl;
|
121
|
+
}
|
122
|
+
});
|
123
|
+
Object.defineProperty(exports, "InvalidPDFException", {
|
124
|
+
enumerable: true,
|
125
|
+
get: function () {
|
126
|
+
return _util.InvalidPDFException;
|
127
|
+
}
|
128
|
+
});
|
129
|
+
Object.defineProperty(exports, "MissingPDFException", {
|
130
|
+
enumerable: true,
|
131
|
+
get: function () {
|
132
|
+
return _util.MissingPDFException;
|
133
|
+
}
|
134
|
+
});
|
135
|
+
Object.defineProperty(exports, "OPS", {
|
136
|
+
enumerable: true,
|
137
|
+
get: function () {
|
138
|
+
return _util.OPS;
|
139
|
+
}
|
140
|
+
});
|
141
|
+
Object.defineProperty(exports, "PasswordResponses", {
|
142
|
+
enumerable: true,
|
143
|
+
get: function () {
|
144
|
+
return _util.PasswordResponses;
|
145
|
+
}
|
146
|
+
});
|
147
|
+
Object.defineProperty(exports, "PermissionFlag", {
|
148
|
+
enumerable: true,
|
149
|
+
get: function () {
|
150
|
+
return _util.PermissionFlag;
|
151
|
+
}
|
152
|
+
});
|
153
|
+
Object.defineProperty(exports, "removeNullCharacters", {
|
154
|
+
enumerable: true,
|
155
|
+
get: function () {
|
156
|
+
return _util.removeNullCharacters;
|
157
|
+
}
|
158
|
+
});
|
159
|
+
Object.defineProperty(exports, "shadow", {
|
160
|
+
enumerable: true,
|
161
|
+
get: function () {
|
162
|
+
return _util.shadow;
|
163
|
+
}
|
164
|
+
});
|
165
|
+
Object.defineProperty(exports, "UnexpectedResponseException", {
|
166
|
+
enumerable: true,
|
167
|
+
get: function () {
|
168
|
+
return _util.UnexpectedResponseException;
|
169
|
+
}
|
170
|
+
});
|
171
|
+
Object.defineProperty(exports, "UNSUPPORTED_FEATURES", {
|
172
|
+
enumerable: true,
|
173
|
+
get: function () {
|
174
|
+
return _util.UNSUPPORTED_FEATURES;
|
175
|
+
}
|
176
|
+
});
|
177
|
+
Object.defineProperty(exports, "Util", {
|
178
|
+
enumerable: true,
|
179
|
+
get: function () {
|
180
|
+
return _util.Util;
|
181
|
+
}
|
182
|
+
});
|
183
|
+
Object.defineProperty(exports, "VerbosityLevel", {
|
184
|
+
enumerable: true,
|
185
|
+
get: function () {
|
186
|
+
return _util.VerbosityLevel;
|
187
|
+
}
|
188
|
+
});
|
189
|
+
Object.defineProperty(exports, "AnnotationLayer", {
|
190
|
+
enumerable: true,
|
191
|
+
get: function () {
|
192
|
+
return _annotation_layer.AnnotationLayer;
|
193
|
+
}
|
194
|
+
});
|
195
|
+
Object.defineProperty(exports, "apiCompatibilityParams", {
|
196
|
+
enumerable: true,
|
197
|
+
get: function () {
|
198
|
+
return _api_compatibility.apiCompatibilityParams;
|
199
|
+
}
|
200
|
+
});
|
201
|
+
Object.defineProperty(exports, "GlobalWorkerOptions", {
|
202
|
+
enumerable: true,
|
203
|
+
get: function () {
|
204
|
+
return _worker_options.GlobalWorkerOptions;
|
205
|
+
}
|
206
|
+
});
|
207
|
+
Object.defineProperty(exports, "renderTextLayer", {
|
208
|
+
enumerable: true,
|
209
|
+
get: function () {
|
210
|
+
return _text_layer.renderTextLayer;
|
211
|
+
}
|
212
|
+
});
|
213
|
+
Object.defineProperty(exports, "SVGGraphics", {
|
214
|
+
enumerable: true,
|
215
|
+
get: function () {
|
216
|
+
return _svg.SVGGraphics;
|
217
|
+
}
|
218
|
+
});
|
26
219
|
|
27
|
-
var
|
220
|
+
var _display_utils = require("./display/display_utils.js");
|
28
221
|
|
29
|
-
var
|
222
|
+
var _api = require("./display/api.js");
|
30
223
|
|
31
|
-
var
|
224
|
+
var _util = require("./shared/util.js");
|
32
225
|
|
33
|
-
var
|
226
|
+
var _annotation_layer = require("./display/annotation_layer.js");
|
34
227
|
|
35
|
-
var
|
228
|
+
var _api_compatibility = require("./display/api_compatibility.js");
|
36
229
|
|
37
|
-
var
|
230
|
+
var _worker_options = require("./display/worker_options.js");
|
38
231
|
|
39
|
-
var
|
232
|
+
var _text_layer = require("./display/text_layer.js");
|
40
233
|
|
41
|
-
var
|
234
|
+
var _svg = require("./display/svg.js");
|
42
235
|
|
236
|
+
const pdfjsVersion = '2.5.207';
|
237
|
+
const pdfjsBuild = '0974d605';
|
43
238
|
{
|
44
|
-
|
239
|
+
const {
|
240
|
+
isNodeJS
|
241
|
+
} = require("./shared/is_node.js");
|
45
242
|
|
46
|
-
if (isNodeJS
|
47
|
-
|
243
|
+
if (isNodeJS) {
|
244
|
+
const PDFNodeStream = require("./display/node_stream.js").PDFNodeStream;
|
48
245
|
|
49
|
-
|
246
|
+
(0, _api.setPDFNetworkStreamFactory)(params => {
|
50
247
|
return new PDFNodeStream(params);
|
51
248
|
});
|
52
|
-
} else if (typeof Response !== 'undefined' && 'body' in Response.prototype && typeof ReadableStream !== 'undefined') {
|
53
|
-
var PDFFetchStream = require('./display/fetch_stream.js').PDFFetchStream;
|
54
|
-
|
55
|
-
pdfjsDisplayAPI.setPDFNetworkStreamFactory(function (params) {
|
56
|
-
return new PDFFetchStream(params);
|
57
|
-
});
|
58
249
|
} else {
|
59
|
-
|
250
|
+
const PDFNetworkStream = require("./display/network.js").PDFNetworkStream;
|
251
|
+
|
252
|
+
let PDFFetchStream;
|
253
|
+
|
254
|
+
if ((0, _display_utils.isFetchSupported)()) {
|
255
|
+
PDFFetchStream = require("./display/fetch_stream.js").PDFFetchStream;
|
256
|
+
}
|
257
|
+
|
258
|
+
(0, _api.setPDFNetworkStreamFactory)(params => {
|
259
|
+
if (PDFFetchStream && (0, _display_utils.isValidFetchUrl)(params.url)) {
|
260
|
+
return new PDFFetchStream(params);
|
261
|
+
}
|
60
262
|
|
61
|
-
pdfjsDisplayAPI.setPDFNetworkStreamFactory(function (params) {
|
62
263
|
return new PDFNetworkStream(params);
|
63
264
|
});
|
64
265
|
}
|
65
|
-
}
|
66
|
-
exports.build = pdfjsDisplayAPI.build;
|
67
|
-
exports.version = pdfjsDisplayAPI.version;
|
68
|
-
exports.getDocument = pdfjsDisplayAPI.getDocument;
|
69
|
-
exports.LoopbackPort = pdfjsDisplayAPI.LoopbackPort;
|
70
|
-
exports.PDFDataRangeTransport = pdfjsDisplayAPI.PDFDataRangeTransport;
|
71
|
-
exports.PDFWorker = pdfjsDisplayAPI.PDFWorker;
|
72
|
-
exports.renderTextLayer = pdfjsDisplayTextLayer.renderTextLayer;
|
73
|
-
exports.AnnotationLayer = pdfjsDisplayAnnotationLayer.AnnotationLayer;
|
74
|
-
exports.createPromiseCapability = pdfjsSharedUtil.createPromiseCapability;
|
75
|
-
exports.PasswordResponses = pdfjsSharedUtil.PasswordResponses;
|
76
|
-
exports.InvalidPDFException = pdfjsSharedUtil.InvalidPDFException;
|
77
|
-
exports.MissingPDFException = pdfjsSharedUtil.MissingPDFException;
|
78
|
-
exports.SVGGraphics = pdfjsDisplaySVG.SVGGraphics;
|
79
|
-
exports.NativeImageDecoding = pdfjsSharedUtil.NativeImageDecoding;
|
80
|
-
exports.CMapCompressionType = pdfjsSharedUtil.CMapCompressionType;
|
81
|
-
exports.PermissionFlag = pdfjsSharedUtil.PermissionFlag;
|
82
|
-
exports.UnexpectedResponseException = pdfjsSharedUtil.UnexpectedResponseException;
|
83
|
-
exports.OPS = pdfjsSharedUtil.OPS;
|
84
|
-
exports.VerbosityLevel = pdfjsSharedUtil.VerbosityLevel;
|
85
|
-
exports.UNSUPPORTED_FEATURES = pdfjsSharedUtil.UNSUPPORTED_FEATURES;
|
86
|
-
exports.createValidAbsoluteUrl = pdfjsSharedUtil.createValidAbsoluteUrl;
|
87
|
-
exports.createObjectURL = pdfjsSharedUtil.createObjectURL;
|
88
|
-
exports.removeNullCharacters = pdfjsSharedUtil.removeNullCharacters;
|
89
|
-
exports.shadow = pdfjsSharedUtil.shadow;
|
90
|
-
exports.Util = pdfjsSharedUtil.Util;
|
91
|
-
exports.ReadableStream = pdfjsSharedUtil.ReadableStream;
|
92
|
-
exports.URL = pdfjsSharedUtil.URL;
|
93
|
-
exports.RenderingCancelledException = pdfjsDisplayDOMUtils.RenderingCancelledException;
|
94
|
-
exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl;
|
95
|
-
exports.LinkTarget = pdfjsDisplayDOMUtils.LinkTarget;
|
96
|
-
exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes;
|
97
|
-
exports.loadScript = pdfjsDisplayDOMUtils.loadScript;
|
98
|
-
exports.GlobalWorkerOptions = pdfjsDisplayWorkerOptions.GlobalWorkerOptions;
|
99
|
-
exports.apiCompatibilityParams = pdfjsDisplayAPICompatibility.apiCompatibilityParams;
|
266
|
+
}
|
package/lib/pdf.worker.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2020 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -19,11 +19,19 @@
|
|
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
|
-
|
25
|
-
|
24
|
+
Object.defineProperty(exports, "__esModule", {
|
25
|
+
value: true
|
26
|
+
});
|
27
|
+
Object.defineProperty(exports, "WorkerMessageHandler", {
|
28
|
+
enumerable: true,
|
29
|
+
get: function () {
|
30
|
+
return _worker.WorkerMessageHandler;
|
31
|
+
}
|
32
|
+
});
|
26
33
|
|
27
|
-
var
|
34
|
+
var _worker = require("./core/worker.js");
|
28
35
|
|
29
|
-
|
36
|
+
const pdfjsVersion = '2.5.207';
|
37
|
+
const pdfjsBuild = '0974d605';
|