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/web/app_options.js
CHANGED
@@ -19,26 +19,29 @@
|
|
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.OptionKind = exports.AppOptions =
|
27
|
+
exports.OptionKind = exports.AppOptions = void 0;
|
28
28
|
|
29
|
-
var
|
29
|
+
var _pdf = require("../pdf");
|
30
30
|
|
31
|
-
var
|
32
|
-
|
33
|
-
var _viewer_compatibility = require('./viewer_compatibility');
|
31
|
+
var _viewer_compatibility = require("./viewer_compatibility");
|
34
32
|
|
35
33
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
36
34
|
|
35
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
36
|
+
|
37
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
38
|
+
|
37
39
|
var OptionKind = {
|
38
40
|
VIEWER: 'viewer',
|
39
41
|
API: 'api',
|
40
42
|
WORKER: 'worker'
|
41
43
|
};
|
44
|
+
exports.OptionKind = OptionKind;
|
42
45
|
var defaultOptions = {
|
43
46
|
cursorToolOnLoad: {
|
44
47
|
value: 0,
|
@@ -60,10 +63,6 @@ var defaultOptions = {
|
|
60
63
|
value: false,
|
61
64
|
kind: OptionKind.VIEWER
|
62
65
|
},
|
63
|
-
disablePageMode: {
|
64
|
-
value: false,
|
65
|
-
kind: OptionKind.VIEWER
|
66
|
-
},
|
67
66
|
enablePrintAutoRotate: {
|
68
67
|
value: false,
|
69
68
|
kind: OptionKind.VIEWER
|
@@ -84,12 +83,17 @@ var defaultOptions = {
|
|
84
83
|
value: 0,
|
85
84
|
kind: OptionKind.VIEWER
|
86
85
|
},
|
86
|
+
historyUpdateUrl: {
|
87
|
+
value: false,
|
88
|
+
kind: OptionKind.VIEWER
|
89
|
+
},
|
87
90
|
imageResourcesPath: {
|
88
91
|
value: './images/',
|
89
92
|
kind: OptionKind.VIEWER
|
90
93
|
},
|
91
94
|
maxCanvasPixels: {
|
92
|
-
value:
|
95
|
+
value: 16777216,
|
96
|
+
compatibility: _viewer_compatibility.viewerCompatibilityParams.maxCanvasPixels,
|
93
97
|
kind: OptionKind.VIEWER
|
94
98
|
},
|
95
99
|
pdfBugEnabled: {
|
@@ -104,20 +108,16 @@ var defaultOptions = {
|
|
104
108
|
value: false,
|
105
109
|
kind: OptionKind.VIEWER
|
106
110
|
},
|
107
|
-
showPreviousViewOnLoad: {
|
108
|
-
value: true,
|
109
|
-
kind: OptionKind.VIEWER
|
110
|
-
},
|
111
111
|
sidebarViewOnLoad: {
|
112
|
-
value:
|
112
|
+
value: -1,
|
113
113
|
kind: OptionKind.VIEWER
|
114
114
|
},
|
115
115
|
scrollModeOnLoad: {
|
116
|
-
value:
|
116
|
+
value: -1,
|
117
117
|
kind: OptionKind.VIEWER
|
118
118
|
},
|
119
119
|
spreadModeOnLoad: {
|
120
|
-
value:
|
120
|
+
value: -1,
|
121
121
|
kind: OptionKind.VIEWER
|
122
122
|
},
|
123
123
|
textLayerMode: {
|
@@ -128,6 +128,10 @@ var defaultOptions = {
|
|
128
128
|
value: false,
|
129
129
|
kind: OptionKind.VIEWER
|
130
130
|
},
|
131
|
+
viewOnLoad: {
|
132
|
+
value: 0,
|
133
|
+
kind: OptionKind.VIEWER
|
134
|
+
},
|
131
135
|
cMapPacked: {
|
132
136
|
value: true,
|
133
137
|
kind: OptionKind.API
|
@@ -141,7 +145,8 @@ var defaultOptions = {
|
|
141
145
|
kind: OptionKind.API
|
142
146
|
},
|
143
147
|
disableCreateObjectURL: {
|
144
|
-
value:
|
148
|
+
value: false,
|
149
|
+
compatibility: _pdf.apiCompatibilityParams.disableCreateObjectURL,
|
145
150
|
kind: OptionKind.API
|
146
151
|
},
|
147
152
|
disableFontFace: {
|
@@ -186,6 +191,10 @@ var defaultOptions = {
|
|
186
191
|
}
|
187
192
|
};
|
188
193
|
{
|
194
|
+
defaultOptions.disablePreferences = {
|
195
|
+
value: false,
|
196
|
+
kind: OptionKind.VIEWER
|
197
|
+
};
|
189
198
|
defaultOptions.locale = {
|
190
199
|
value: typeof navigator !== 'undefined' ? navigator.language : 'en-US',
|
191
200
|
kind: OptionKind.VIEWER
|
@@ -193,7 +202,9 @@ var defaultOptions = {
|
|
193
202
|
}
|
194
203
|
var userOptions = Object.create(null);
|
195
204
|
|
196
|
-
var AppOptions =
|
205
|
+
var AppOptions =
|
206
|
+
/*#__PURE__*/
|
207
|
+
function () {
|
197
208
|
function AppOptions() {
|
198
209
|
_classCallCheck(this, AppOptions);
|
199
210
|
|
@@ -201,38 +212,48 @@ var AppOptions = function () {
|
|
201
212
|
}
|
202
213
|
|
203
214
|
_createClass(AppOptions, null, [{
|
204
|
-
key:
|
215
|
+
key: "get",
|
205
216
|
value: function get(name) {
|
206
|
-
var
|
207
|
-
|
217
|
+
var userOption = userOptions[name];
|
218
|
+
|
208
219
|
if (userOption !== undefined) {
|
209
220
|
return userOption;
|
210
221
|
}
|
211
|
-
|
222
|
+
|
223
|
+
var defaultOption = defaultOptions[name];
|
224
|
+
|
225
|
+
if (defaultOption !== undefined) {
|
226
|
+
return defaultOption.compatibility || defaultOption.value;
|
227
|
+
}
|
228
|
+
|
229
|
+
return undefined;
|
212
230
|
}
|
213
231
|
}, {
|
214
|
-
key:
|
232
|
+
key: "getAll",
|
215
233
|
value: function getAll() {
|
216
234
|
var kind = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
217
|
-
|
218
235
|
var options = Object.create(null);
|
236
|
+
|
219
237
|
for (var name in defaultOptions) {
|
220
|
-
var defaultOption = defaultOptions[name]
|
221
|
-
|
222
|
-
if (kind &&
|
238
|
+
var defaultOption = defaultOptions[name];
|
239
|
+
|
240
|
+
if (kind && kind !== defaultOption.kind) {
|
223
241
|
continue;
|
224
242
|
}
|
225
|
-
|
243
|
+
|
244
|
+
var userOption = userOptions[name];
|
245
|
+
options[name] = userOption !== undefined ? userOption : defaultOption.compatibility || defaultOption.value;
|
226
246
|
}
|
247
|
+
|
227
248
|
return options;
|
228
249
|
}
|
229
250
|
}, {
|
230
|
-
key:
|
251
|
+
key: "set",
|
231
252
|
value: function set(name, value) {
|
232
253
|
userOptions[name] = value;
|
233
254
|
}
|
234
255
|
}, {
|
235
|
-
key:
|
256
|
+
key: "remove",
|
236
257
|
value: function remove(name) {
|
237
258
|
delete userOptions[name];
|
238
259
|
}
|
@@ -241,5 +262,4 @@ var AppOptions = function () {
|
|
241
262
|
return AppOptions;
|
242
263
|
}();
|
243
264
|
|
244
|
-
exports.AppOptions = AppOptions;
|
245
|
-
exports.OptionKind = OptionKind;
|
265
|
+
exports.AppOptions = AppOptions;
|