pdfjs-dist 2.0.943 → 2.4.456
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 +8286 -14230
- 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 +25500 -26628
- package/build/pdf.worker.js.map +1 -1
- package/build/pdf.worker.min.js +22 -1
- package/es5/build/pdf.js +25473 -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 +57878 -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 +407 -0
- package/es5/web/pdf_viewer.js +7757 -0
- package/es5/web/pdf_viewer.js.map +1 -0
- package/image_decoders/pdf.image_decoders.js +2887 -4094
- 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 +855 -778
- package/lib/core/arithmetic_decoder.js +325 -311
- package/lib/core/bidi.js +117 -50
- package/lib/core/ccitt.js +251 -89
- package/lib/core/ccitt_stream.js +26 -16
- package/lib/core/cff_parser.js +525 -197
- package/lib/core/charsets.js +6 -5
- package/lib/core/chunked_stream.js +541 -406
- package/lib/core/cmap.js +368 -253
- package/lib/core/colorspace.js +781 -800
- package/lib/core/core_utils.js +152 -0
- package/lib/core/crypto.js +609 -422
- package/lib/core/document.js +649 -481
- package/lib/core/encodings.js +33 -24
- package/lib/core/evaluator.js +1471 -736
- package/lib/core/font_renderer.js +289 -149
- package/lib/core/fonts.js +1067 -413
- package/lib/core/function.js +517 -287
- package/lib/core/glyphlist.js +4529 -4527
- package/lib/core/image.js +232 -114
- package/lib/core/image_utils.js +94 -0
- package/lib/core/jbig2.js +711 -342
- package/lib/core/jbig2_stream.js +31 -19
- package/lib/core/jpeg_stream.js +151 -26
- package/lib/core/jpg.js +433 -181
- package/lib/core/jpx.js +551 -143
- package/lib/core/jpx_stream.js +40 -28
- package/lib/core/metrics.js +2931 -2931
- package/lib/core/murmurhash3.js +104 -97
- package/lib/core/obj.js +1561 -1053
- package/lib/core/operator_list.js +192 -64
- package/lib/core/parser.js +1162 -864
- package/lib/core/pattern.js +224 -75
- package/lib/core/pdf_manager.js +154 -285
- package/lib/core/primitives.js +145 -69
- package/lib/core/ps_parser.js +212 -162
- package/lib/core/standard_fonts.js +245 -244
- package/lib/core/stream.js +353 -81
- package/lib/core/type1_parser.js +218 -68
- package/lib/core/unicode.js +1682 -1655
- package/lib/core/worker.js +233 -302
- package/lib/core/worker_stream.js +168 -0
- package/lib/display/annotation_layer.js +808 -862
- package/lib/display/api.js +1778 -1462
- package/lib/display/api_compatibility.js +14 -9
- package/lib/display/canvas.js +463 -140
- package/lib/display/content_disposition.js +86 -58
- package/lib/display/display_utils.js +524 -0
- package/lib/display/fetch_stream.js +202 -274
- package/lib/display/font_loader.js +311 -333
- package/lib/display/metadata.js +98 -88
- package/lib/display/network.js +343 -347
- package/lib/display/network_utils.js +46 -26
- package/lib/display/node_stream.js +326 -404
- package/lib/display/pattern_helper.js +168 -69
- package/lib/display/svg.js +1296 -885
- package/lib/display/text_layer.js +229 -103
- package/lib/display/transport_stream.js +290 -250
- package/lib/display/webgl.js +116 -83
- package/lib/display/worker_options.js +6 -5
- package/lib/display/xml_parser.js +358 -337
- package/lib/examples/node/domstubs.js +95 -39
- package/lib/pdf.js +49 -31
- package/lib/pdf.worker.js +7 -5
- package/lib/shared/compatibility.js +3 -145
- package/lib/shared/is_node.js +8 -7
- package/lib/shared/message_handler.js +367 -314
- package/lib/shared/util.js +421 -415
- package/lib/test/unit/annotation_spec.js +1570 -690
- package/lib/test/unit/api_spec.js +855 -493
- package/lib/test/unit/bidi_spec.js +12 -12
- package/lib/test/unit/cff_parser_spec.js +88 -61
- package/lib/test/unit/clitests_helper.js +9 -12
- package/lib/test/unit/cmap_spec.js +140 -88
- package/lib/test/unit/colorspace_spec.js +204 -152
- package/lib/test/unit/core_utils_spec.js +211 -0
- package/lib/test/unit/crypto_spec.js +194 -182
- package/lib/test/unit/custom_spec.js +50 -64
- package/lib/test/unit/display_svg_spec.js +53 -38
- package/lib/test/unit/display_utils_spec.js +263 -0
- package/lib/test/unit/document_spec.js +17 -22
- package/lib/test/unit/encodings_spec.js +15 -57
- package/lib/test/unit/evaluator_spec.js +90 -83
- package/lib/test/unit/fetch_stream_spec.js +111 -0
- package/lib/test/unit/function_spec.js +219 -205
- package/lib/test/unit/jasmine-boot.js +68 -39
- package/lib/test/unit/message_handler_spec.js +187 -160
- package/lib/test/unit/metadata_spec.js +87 -34
- package/lib/test/unit/murmurhash3_spec.js +13 -13
- package/lib/test/unit/network_spec.js +26 -59
- package/lib/test/unit/network_utils_spec.js +187 -121
- package/lib/test/unit/node_stream_spec.js +98 -90
- package/lib/test/unit/parser_spec.js +173 -131
- package/lib/test/unit/pdf_find_controller_spec.js +148 -67
- package/lib/test/unit/pdf_find_utils_spec.js +35 -34
- package/lib/test/unit/pdf_history_spec.js +45 -33
- package/lib/test/unit/primitives_spec.js +161 -126
- package/lib/test/unit/stream_spec.js +22 -15
- package/lib/test/unit/test_utils.js +149 -98
- package/lib/test/unit/testreporter.js +36 -18
- package/lib/test/unit/type1_parser_spec.js +46 -44
- package/lib/test/unit/ui_utils_spec.js +388 -372
- package/lib/test/unit/unicode_spec.js +49 -46
- package/lib/test/unit/util_spec.js +144 -248
- package/lib/web/annotation_layer_builder.js +75 -95
- package/lib/web/app.js +1538 -1147
- package/lib/web/app_options.js +116 -104
- package/lib/web/base_viewer.js +950 -775
- package/lib/web/chromecom.js +217 -225
- package/lib/web/debugger.js +236 -148
- package/lib/web/download_manager.js +50 -50
- package/lib/web/firefox_print_service.js +51 -33
- package/lib/web/firefoxcom.js +225 -352
- package/lib/web/genericcom.js +30 -93
- package/lib/web/genericl10n.js +26 -143
- package/lib/web/grab_to_pan.js +57 -33
- package/lib/web/interfaces.js +105 -232
- package/lib/web/overlay_manager.js +73 -227
- package/lib/web/password_prompt.js +44 -62
- package/lib/web/pdf_attachment_viewer.js +118 -123
- package/lib/web/pdf_cursor_tools.js +89 -93
- package/lib/web/pdf_document_properties.js +242 -281
- package/lib/web/pdf_find_bar.js +157 -163
- package/lib/web/pdf_find_controller.js +598 -454
- package/lib/web/pdf_find_utils.js +32 -16
- package/lib/web/pdf_history.js +481 -355
- package/lib/web/pdf_link_service.js +355 -323
- package/lib/web/pdf_outline_viewer.js +167 -152
- package/lib/web/pdf_page_view.js +511 -457
- package/lib/web/pdf_presentation_mode.js +347 -335
- package/lib/web/pdf_print_service.js +133 -103
- package/lib/web/pdf_rendering_queue.js +98 -100
- package/lib/web/pdf_sidebar.js +323 -299
- package/lib/web/pdf_sidebar_resizer.js +107 -108
- package/lib/web/pdf_single_page_viewer.js +94 -146
- package/lib/web/pdf_thumbnail_view.js +319 -269
- package/lib/web/pdf_thumbnail_viewer.js +219 -199
- package/lib/web/pdf_viewer.component.js +111 -32
- package/lib/web/pdf_viewer.js +61 -101
- package/lib/web/preferences.js +87 -272
- package/lib/web/secondary_toolbar.js +207 -220
- package/lib/web/text_layer_builder.js +322 -322
- package/lib/web/toolbar.js +227 -180
- package/lib/web/ui_utils.js +476 -421
- package/lib/web/view_history.js +59 -208
- package/lib/web/viewer_compatibility.js +9 -6
- package/package.json +2 -9
- package/web/pdf_viewer.css +36 -22
- package/web/pdf_viewer.js +4407 -4516
- 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 -441
- package/lib/shared/streams_polyfill.js +0 -39
- package/lib/shared/url_polyfill.js +0 -50
- package/lib/test/unit/dom_utils_spec.js +0 -89
- package/lib/web/dom_events.js +0 -140
package/lib/web/view_history.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,243 +19,94 @@
|
|
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.ViewHistory =
|
28
|
-
|
29
|
-
var _regenerator = require('babel-runtime/regenerator');
|
30
|
-
|
31
|
-
var _regenerator2 = _interopRequireDefault(_regenerator);
|
32
|
-
|
33
|
-
var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
34
|
-
|
35
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
36
|
-
|
37
|
-
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
|
38
|
-
|
39
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
40
|
-
|
41
|
-
var DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20;
|
42
|
-
|
43
|
-
var ViewHistory = function () {
|
44
|
-
function ViewHistory(fingerprint) {
|
45
|
-
var _this = this;
|
46
|
-
|
47
|
-
var cacheSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_VIEW_HISTORY_CACHE_SIZE;
|
48
|
-
|
49
|
-
_classCallCheck(this, ViewHistory);
|
27
|
+
exports.ViewHistory = void 0;
|
28
|
+
const DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20;
|
50
29
|
|
30
|
+
class ViewHistory {
|
31
|
+
constructor(fingerprint, cacheSize = DEFAULT_VIEW_HISTORY_CACHE_SIZE) {
|
51
32
|
this.fingerprint = fingerprint;
|
52
33
|
this.cacheSize = cacheSize;
|
53
|
-
this._initializedPromise = this._readFromStorage().then(
|
54
|
-
|
55
|
-
|
34
|
+
this._initializedPromise = this._readFromStorage().then(databaseStr => {
|
35
|
+
const database = JSON.parse(databaseStr || "{}");
|
36
|
+
|
37
|
+
if (!("files" in database)) {
|
56
38
|
database.files = [];
|
57
39
|
} else {
|
58
|
-
while (database.files.length >=
|
40
|
+
while (database.files.length >= this.cacheSize) {
|
59
41
|
database.files.shift();
|
60
42
|
}
|
61
43
|
}
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
44
|
+
|
45
|
+
let index = -1;
|
46
|
+
|
47
|
+
for (let i = 0, length = database.files.length; i < length; i++) {
|
48
|
+
const branch = database.files[i];
|
49
|
+
|
50
|
+
if (branch.fingerprint === this.fingerprint) {
|
66
51
|
index = i;
|
67
52
|
break;
|
68
53
|
}
|
69
54
|
}
|
55
|
+
|
70
56
|
if (index === -1) {
|
71
|
-
index = database.files.push({
|
57
|
+
index = database.files.push({
|
58
|
+
fingerprint: this.fingerprint
|
59
|
+
}) - 1;
|
72
60
|
}
|
73
|
-
|
74
|
-
|
61
|
+
|
62
|
+
this.file = database.files[index];
|
63
|
+
this.database = database;
|
75
64
|
});
|
76
65
|
}
|
77
66
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
var databaseStr;
|
83
|
-
return _regenerator2.default.wrap(function _callee$(_context) {
|
84
|
-
while (1) {
|
85
|
-
switch (_context.prev = _context.next) {
|
86
|
-
case 0:
|
87
|
-
databaseStr = JSON.stringify(this.database);
|
88
|
-
|
89
|
-
localStorage.setItem('pdfjs.history', databaseStr);
|
90
|
-
|
91
|
-
case 2:
|
92
|
-
case 'end':
|
93
|
-
return _context.stop();
|
94
|
-
}
|
95
|
-
}
|
96
|
-
}, _callee, this);
|
97
|
-
}));
|
98
|
-
|
99
|
-
function _writeToStorage() {
|
100
|
-
return _ref.apply(this, arguments);
|
101
|
-
}
|
102
|
-
|
103
|
-
return _writeToStorage;
|
104
|
-
}()
|
105
|
-
}, {
|
106
|
-
key: '_readFromStorage',
|
107
|
-
value: function () {
|
108
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {
|
109
|
-
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
110
|
-
while (1) {
|
111
|
-
switch (_context2.prev = _context2.next) {
|
112
|
-
case 0:
|
113
|
-
return _context2.abrupt('return', localStorage.getItem('pdfjs.history'));
|
114
|
-
|
115
|
-
case 1:
|
116
|
-
case 'end':
|
117
|
-
return _context2.stop();
|
118
|
-
}
|
119
|
-
}
|
120
|
-
}, _callee2, this);
|
121
|
-
}));
|
122
|
-
|
123
|
-
function _readFromStorage() {
|
124
|
-
return _ref2.apply(this, arguments);
|
125
|
-
}
|
126
|
-
|
127
|
-
return _readFromStorage;
|
128
|
-
}()
|
129
|
-
}, {
|
130
|
-
key: 'set',
|
131
|
-
value: function () {
|
132
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regenerator2.default.mark(function _callee3(name, val) {
|
133
|
-
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
134
|
-
while (1) {
|
135
|
-
switch (_context3.prev = _context3.next) {
|
136
|
-
case 0:
|
137
|
-
_context3.next = 2;
|
138
|
-
return this._initializedPromise;
|
139
|
-
|
140
|
-
case 2:
|
141
|
-
this.file[name] = val;
|
142
|
-
return _context3.abrupt('return', this._writeToStorage());
|
143
|
-
|
144
|
-
case 4:
|
145
|
-
case 'end':
|
146
|
-
return _context3.stop();
|
147
|
-
}
|
148
|
-
}
|
149
|
-
}, _callee3, this);
|
150
|
-
}));
|
151
|
-
|
152
|
-
function set(_x2, _x3) {
|
153
|
-
return _ref3.apply(this, arguments);
|
154
|
-
}
|
155
|
-
|
156
|
-
return set;
|
157
|
-
}()
|
158
|
-
}, {
|
159
|
-
key: 'setMultiple',
|
160
|
-
value: function () {
|
161
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regenerator2.default.mark(function _callee4(properties) {
|
162
|
-
var name;
|
163
|
-
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
164
|
-
while (1) {
|
165
|
-
switch (_context4.prev = _context4.next) {
|
166
|
-
case 0:
|
167
|
-
_context4.next = 2;
|
168
|
-
return this._initializedPromise;
|
169
|
-
|
170
|
-
case 2:
|
171
|
-
for (name in properties) {
|
172
|
-
this.file[name] = properties[name];
|
173
|
-
}
|
174
|
-
return _context4.abrupt('return', this._writeToStorage());
|
175
|
-
|
176
|
-
case 4:
|
177
|
-
case 'end':
|
178
|
-
return _context4.stop();
|
179
|
-
}
|
180
|
-
}
|
181
|
-
}, _callee4, this);
|
182
|
-
}));
|
183
|
-
|
184
|
-
function setMultiple(_x4) {
|
185
|
-
return _ref4.apply(this, arguments);
|
186
|
-
}
|
187
|
-
|
188
|
-
return setMultiple;
|
189
|
-
}()
|
190
|
-
}, {
|
191
|
-
key: 'get',
|
192
|
-
value: function () {
|
193
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regenerator2.default.mark(function _callee5(name, defaultValue) {
|
194
|
-
var val;
|
195
|
-
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
196
|
-
while (1) {
|
197
|
-
switch (_context5.prev = _context5.next) {
|
198
|
-
case 0:
|
199
|
-
_context5.next = 2;
|
200
|
-
return this._initializedPromise;
|
201
|
-
|
202
|
-
case 2:
|
203
|
-
val = this.file[name];
|
204
|
-
return _context5.abrupt('return', val !== undefined ? val : defaultValue);
|
67
|
+
async _writeToStorage() {
|
68
|
+
const databaseStr = JSON.stringify(this.database);
|
69
|
+
localStorage.setItem("pdfjs.history", databaseStr);
|
70
|
+
}
|
205
71
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
}
|
210
|
-
}
|
211
|
-
}, _callee5, this);
|
212
|
-
}));
|
72
|
+
async _readFromStorage() {
|
73
|
+
return localStorage.getItem("pdfjs.history");
|
74
|
+
}
|
213
75
|
|
214
|
-
|
215
|
-
|
216
|
-
|
76
|
+
async set(name, val) {
|
77
|
+
await this._initializedPromise;
|
78
|
+
this.file[name] = val;
|
79
|
+
return this._writeToStorage();
|
80
|
+
}
|
217
81
|
|
218
|
-
|
219
|
-
|
220
|
-
}, {
|
221
|
-
key: 'getMultiple',
|
222
|
-
value: function () {
|
223
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regenerator2.default.mark(function _callee6(properties) {
|
224
|
-
var values, name, val;
|
225
|
-
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
226
|
-
while (1) {
|
227
|
-
switch (_context6.prev = _context6.next) {
|
228
|
-
case 0:
|
229
|
-
_context6.next = 2;
|
230
|
-
return this._initializedPromise;
|
82
|
+
async setMultiple(properties) {
|
83
|
+
await this._initializedPromise;
|
231
84
|
|
232
|
-
|
233
|
-
|
85
|
+
for (const name in properties) {
|
86
|
+
this.file[name] = properties[name];
|
87
|
+
}
|
234
88
|
|
235
|
-
|
236
|
-
|
89
|
+
return this._writeToStorage();
|
90
|
+
}
|
237
91
|
|
238
|
-
|
239
|
-
|
240
|
-
|
92
|
+
async get(name, defaultValue) {
|
93
|
+
await this._initializedPromise;
|
94
|
+
const val = this.file[name];
|
95
|
+
return val !== undefined ? val : defaultValue;
|
96
|
+
}
|
241
97
|
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
}
|
246
|
-
}
|
247
|
-
}, _callee6, this);
|
248
|
-
}));
|
98
|
+
async getMultiple(properties) {
|
99
|
+
await this._initializedPromise;
|
100
|
+
const values = Object.create(null);
|
249
101
|
|
250
|
-
|
251
|
-
|
252
|
-
|
102
|
+
for (const name in properties) {
|
103
|
+
const val = this.file[name];
|
104
|
+
values[name] = val !== undefined ? val : properties[name];
|
105
|
+
}
|
253
106
|
|
254
|
-
|
255
|
-
|
256
|
-
}]);
|
107
|
+
return values;
|
108
|
+
}
|
257
109
|
|
258
|
-
|
259
|
-
}();
|
110
|
+
}
|
260
111
|
|
261
112
|
exports.ViewHistory = ViewHistory;
|
@@ -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,13 +19,16 @@
|
|
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
|
+
const compatibilityParams = Object.create(null);
|
25
25
|
{
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
const userAgent = typeof navigator !== "undefined" && navigator.userAgent || "";
|
27
|
+
const platform = typeof navigator !== "undefined" && navigator.platform || "";
|
28
|
+
const maxTouchPoints = typeof navigator !== "undefined" && navigator.maxTouchPoints || 1;
|
29
|
+
const isAndroid = /Android/.test(userAgent);
|
30
|
+
const isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1;
|
31
|
+
|
29
32
|
(function checkCanvasSizeLimitation() {
|
30
33
|
if (isIOS || isAndroid) {
|
31
34
|
compatibilityParams.maxCanvasPixels = 5242880;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "pdfjs-dist",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.4.456",
|
4
4
|
"main": "build/pdf.js",
|
5
5
|
"description": "Generic build of Mozilla's PDF.js library.",
|
6
6
|
"keywords": [
|
@@ -11,18 +11,11 @@
|
|
11
11
|
"homepage": "http://mozilla.github.io/pdf.js/",
|
12
12
|
"bugs": "https://github.com/mozilla/pdf.js/issues",
|
13
13
|
"license": "Apache-2.0",
|
14
|
-
"dependencies": {
|
15
|
-
"node-ensure": "^0.0.0",
|
16
|
-
"worker-loader": "^2.0.0"
|
17
|
-
},
|
18
|
-
"peerDependencies": {
|
19
|
-
"webpack": "^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0"
|
20
|
-
},
|
21
14
|
"browser": {
|
22
15
|
"fs": false,
|
23
16
|
"http": false,
|
24
17
|
"https": false,
|
25
|
-
"
|
18
|
+
"url": false,
|
26
19
|
"zlib": false
|
27
20
|
},
|
28
21
|
"format": "amd",
|
package/web/pdf_viewer.css
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
line-height: 1.0;
|
25
25
|
}
|
26
26
|
|
27
|
-
.textLayer >
|
27
|
+
.textLayer > span {
|
28
28
|
color: transparent;
|
29
29
|
position: absolute;
|
30
30
|
white-space: pre;
|
@@ -36,8 +36,7 @@
|
|
36
36
|
.textLayer .highlight {
|
37
37
|
margin: -1px;
|
38
38
|
padding: 1px;
|
39
|
-
|
40
|
-
background-color: rgb(180, 0, 170);
|
39
|
+
background-color: rgba(180, 0, 170, 1);
|
41
40
|
border-radius: 4px;
|
42
41
|
}
|
43
42
|
|
@@ -54,12 +53,16 @@
|
|
54
53
|
}
|
55
54
|
|
56
55
|
.textLayer .highlight.selected {
|
57
|
-
background-color:
|
56
|
+
background-color: rgba(0, 100, 0, 1);
|
58
57
|
}
|
59
58
|
|
60
|
-
.textLayer ::-moz-selection {
|
59
|
+
.textLayer ::-moz-selection {
|
60
|
+
background: rgba(0, 0, 255, 1);
|
61
|
+
}
|
61
62
|
|
62
|
-
.textLayer ::selection {
|
63
|
+
.textLayer ::selection {
|
64
|
+
background: rgba(0, 0, 255, 1);
|
65
|
+
}
|
63
66
|
|
64
67
|
.textLayer .endOfContent {
|
65
68
|
display: block;
|
@@ -98,8 +101,8 @@
|
|
98
101
|
.annotationLayer .linkAnnotation > a:hover,
|
99
102
|
.annotationLayer .buttonWidgetAnnotation.pushButton > a:hover {
|
100
103
|
opacity: 0.2;
|
101
|
-
background:
|
102
|
-
box-shadow: 0px 2px 10px
|
104
|
+
background: rgba(255, 255, 0, 1);
|
105
|
+
box-shadow: 0px 2px 10px rgba(255, 255, 0, 1);
|
103
106
|
}
|
104
107
|
|
105
108
|
.annotationLayer .textAnnotation img {
|
@@ -152,7 +155,7 @@
|
|
152
155
|
.annotationLayer .choiceWidgetAnnotation select:hover,
|
153
156
|
.annotationLayer .buttonWidgetAnnotation.checkBox input:hover,
|
154
157
|
.annotationLayer .buttonWidgetAnnotation.radioButton input:hover {
|
155
|
-
border: 1px solid
|
158
|
+
border: 1px solid rgba(0, 0, 0, 1);
|
156
159
|
}
|
157
160
|
|
158
161
|
.annotationLayer .textWidgetAnnotation input:focus,
|
@@ -165,7 +168,7 @@
|
|
165
168
|
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
|
166
169
|
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,
|
167
170
|
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
|
168
|
-
background-color:
|
171
|
+
background-color: rgba(0, 0, 0, 1);
|
169
172
|
content: '';
|
170
173
|
display: block;
|
171
174
|
position: absolute;
|
@@ -229,37 +232,47 @@
|
|
229
232
|
position: absolute;
|
230
233
|
z-index: 200;
|
231
234
|
max-width: 20em;
|
232
|
-
background-color:
|
233
|
-
box-shadow: 0px 2px 5px
|
235
|
+
background-color: rgba(255, 255, 153, 1);
|
236
|
+
box-shadow: 0px 2px 5px rgba(136, 136, 136, 1);
|
234
237
|
border-radius: 2px;
|
235
|
-
padding:
|
238
|
+
padding: 6px;
|
236
239
|
margin-left: 5px;
|
237
240
|
cursor: pointer;
|
238
241
|
font: message-box;
|
242
|
+
font-size: 9px;
|
239
243
|
word-wrap: break-word;
|
240
244
|
}
|
241
245
|
|
246
|
+
.annotationLayer .popup > * {
|
247
|
+
font-size: 9px;
|
248
|
+
}
|
249
|
+
|
242
250
|
.annotationLayer .popup h1 {
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
251
|
+
display: inline-block;
|
252
|
+
}
|
253
|
+
|
254
|
+
.annotationLayer .popup span {
|
255
|
+
display: inline-block;
|
256
|
+
margin-left: 5px;
|
247
257
|
}
|
248
258
|
|
249
259
|
.annotationLayer .popup p {
|
250
|
-
|
251
|
-
|
260
|
+
border-top: 1px solid rgba(51, 51, 51, 1);
|
261
|
+
margin-top: 2px;
|
262
|
+
padding-top: 2px;
|
252
263
|
}
|
253
264
|
|
254
265
|
.annotationLayer .highlightAnnotation,
|
255
266
|
.annotationLayer .underlineAnnotation,
|
256
267
|
.annotationLayer .squigglyAnnotation,
|
257
268
|
.annotationLayer .strikeoutAnnotation,
|
269
|
+
.annotationLayer .freeTextAnnotation,
|
258
270
|
.annotationLayer .lineAnnotation svg line,
|
259
271
|
.annotationLayer .squareAnnotation svg rect,
|
260
272
|
.annotationLayer .circleAnnotation svg ellipse,
|
261
273
|
.annotationLayer .polylineAnnotation svg polyline,
|
262
274
|
.annotationLayer .polygonAnnotation svg polygon,
|
275
|
+
.annotationLayer .caretAnnotation,
|
263
276
|
.annotationLayer .inkAnnotation svg polyline,
|
264
277
|
.annotationLayer .stampAnnotation,
|
265
278
|
.annotationLayer .fileAttachmentAnnotation {
|
@@ -279,9 +292,10 @@
|
|
279
292
|
overflow: visible;
|
280
293
|
border: 9px solid transparent;
|
281
294
|
background-clip: content-box;
|
282
|
-
-
|
283
|
-
|
284
|
-
|
295
|
+
-webkit-border-image: url(images/shadow.png) 9 9 repeat;
|
296
|
+
-o-border-image: url(images/shadow.png) 9 9 repeat;
|
297
|
+
border-image: url(images/shadow.png) 9 9 repeat;
|
298
|
+
background-color: rgba(255, 255, 255, 1);
|
285
299
|
}
|
286
300
|
|
287
301
|
.pdfViewer.removePageBorders .page {
|