pdfjs-dist 2.1.266 → 2.2.228
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/bower.json +1 -1
- package/build/pdf.js +3349 -2324
- package/build/pdf.js.map +1 -1
- package/build/pdf.min.js +1 -1
- package/build/pdf.worker.js +2804 -1975
- package/build/pdf.worker.js.map +1 -1
- package/build/pdf.worker.min.js +1 -1
- package/image_decoders/pdf.image_decoders.js +431 -511
- 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 +294 -224
- package/lib/core/arithmetic_decoder.js +1 -1
- package/lib/core/bidi.js +1 -1
- package/lib/core/ccitt.js +1 -1
- package/lib/core/ccitt_stream.js +1 -1
- package/lib/core/cff_parser.js +61 -12
- package/lib/core/charsets.js +1 -1
- package/lib/core/chunked_stream.js +24 -14
- package/lib/core/cmap.js +17 -13
- package/lib/core/colorspace.js +1 -1
- package/lib/core/core_utils.js +147 -0
- package/lib/core/crypto.js +1 -1
- package/lib/core/document.js +47 -40
- package/lib/core/encodings.js +1 -1
- package/lib/core/evaluator.js +346 -279
- package/lib/core/font_renderer.js +1 -1
- package/lib/core/fonts.js +23 -11
- package/lib/core/function.js +1 -1
- package/lib/core/glyphlist.js +2 -2
- package/lib/core/image.js +2 -2
- package/lib/core/image_utils.js +111 -0
- package/lib/core/jbig2.js +1 -1
- package/lib/core/jbig2_stream.js +1 -1
- package/lib/core/jpeg_stream.js +1 -1
- package/lib/core/jpg.js +2 -1
- package/lib/core/jpx.js +1 -1
- package/lib/core/jpx_stream.js +1 -1
- package/lib/core/metrics.js +13 -13
- package/lib/core/murmurhash3.js +37 -33
- package/lib/core/obj.js +245 -41
- package/lib/core/operator_list.js +43 -32
- package/lib/core/parser.js +228 -133
- package/lib/core/pattern.js +4 -2
- package/lib/core/pdf_manager.js +17 -15
- package/lib/core/primitives.js +40 -6
- package/lib/core/ps_parser.js +1 -1
- package/lib/core/standard_fonts.js +9 -9
- package/lib/core/stream.js +1 -1
- package/lib/core/type1_parser.js +1 -1
- package/lib/core/unicode.js +2 -2
- package/lib/core/worker.js +54 -171
- package/lib/core/worker_stream.js +277 -0
- package/lib/display/annotation_layer.js +112 -33
- package/lib/display/api.js +211 -123
- package/lib/display/api_compatibility.js +1 -1
- package/lib/display/canvas.js +40 -19
- package/lib/display/content_disposition.js +1 -1
- package/lib/display/display_utils.js +747 -0
- package/lib/display/fetch_stream.js +19 -12
- package/lib/display/font_loader.js +11 -8
- package/lib/display/metadata.js +1 -1
- package/lib/display/network.js +563 -521
- package/lib/display/network_utils.js +1 -1
- package/lib/display/node_stream.js +21 -12
- package/lib/display/pattern_helper.js +24 -25
- package/lib/display/svg.js +1068 -565
- package/lib/display/text_layer.js +24 -14
- package/lib/display/transport_stream.js +192 -70
- package/lib/display/webgl.js +1 -1
- package/lib/display/worker_options.js +1 -1
- package/lib/display/xml_parser.js +1 -1
- package/lib/examples/node/domstubs.js +4 -1
- package/lib/pdf.js +20 -15
- package/lib/pdf.worker.js +3 -3
- package/lib/shared/compatibility.js +6 -6
- package/lib/shared/global_scope.js +1 -1
- package/lib/shared/is_node.js +2 -2
- package/lib/shared/message_handler.js +7 -7
- package/lib/shared/streams_polyfill.js +1 -1
- package/lib/shared/url_polyfill.js +1 -1
- package/lib/shared/util.js +13 -125
- package/lib/test/unit/annotation_spec.js +278 -93
- package/lib/test/unit/api_spec.js +198 -188
- package/lib/test/unit/bidi_spec.js +1 -1
- package/lib/test/unit/cff_parser_spec.js +15 -1
- package/lib/test/unit/clitests_helper.js +3 -3
- package/lib/test/unit/cmap_spec.js +20 -20
- package/lib/test/unit/colorspace_spec.js +17 -12
- package/lib/test/unit/core_utils_spec.js +191 -0
- package/lib/test/unit/crypto_spec.js +1 -1
- package/lib/test/unit/custom_spec.js +8 -8
- package/lib/test/unit/display_svg_spec.js +8 -8
- package/lib/test/unit/display_utils_spec.js +273 -0
- package/lib/test/unit/document_spec.js +7 -12
- package/lib/test/unit/encodings_spec.js +5 -5
- package/lib/test/unit/evaluator_spec.js +8 -10
- package/lib/test/unit/fetch_stream_spec.js +109 -0
- package/lib/test/unit/function_spec.js +1 -1
- package/lib/test/unit/jasmine-boot.js +4 -4
- package/lib/test/unit/message_handler_spec.js +1 -1
- package/lib/test/unit/metadata_spec.js +1 -1
- package/lib/test/unit/murmurhash3_spec.js +1 -1
- package/lib/test/unit/network_spec.js +5 -55
- package/lib/test/unit/network_utils_spec.js +51 -1
- package/lib/test/unit/node_stream_spec.js +8 -8
- package/lib/test/unit/parser_spec.js +150 -86
- package/lib/test/unit/pdf_find_controller_spec.js +1 -1
- package/lib/test/unit/pdf_find_utils_spec.js +1 -1
- package/lib/test/unit/pdf_history_spec.js +1 -1
- package/lib/test/unit/primitives_spec.js +30 -17
- package/lib/test/unit/stream_spec.js +1 -1
- package/lib/test/unit/test_utils.js +197 -43
- package/lib/test/unit/testreporter.js +1 -1
- package/lib/test/unit/type1_parser_spec.js +1 -1
- package/lib/test/unit/ui_utils_spec.js +20 -20
- package/lib/test/unit/unicode_spec.js +5 -5
- package/lib/test/unit/util_spec.js +1 -164
- package/lib/web/annotation_layer_builder.js +1 -1
- package/lib/web/app.js +104 -60
- package/lib/web/app_options.js +45 -37
- package/lib/web/base_viewer.js +7 -7
- package/lib/web/chromecom.js +8 -8
- package/lib/web/debugger.js +7 -7
- package/lib/web/download_manager.js +3 -2
- package/lib/web/firefox_print_service.js +4 -2
- package/lib/web/firefoxcom.js +50 -19
- package/lib/web/genericcom.js +8 -8
- package/lib/web/genericl10n.js +10 -10
- package/lib/web/grab_to_pan.js +3 -1
- package/lib/web/interfaces.js +13 -13
- package/lib/web/overlay_manager.js +10 -10
- package/lib/web/password_prompt.js +2 -2
- package/lib/web/pdf_attachment_viewer.js +1 -1
- package/lib/web/pdf_cursor_tools.js +1 -1
- package/lib/web/pdf_document_properties.js +188 -119
- package/lib/web/pdf_find_bar.js +1 -1
- package/lib/web/pdf_find_controller.js +3 -3
- package/lib/web/pdf_find_utils.js +1 -1
- package/lib/web/pdf_history.js +1 -1
- package/lib/web/pdf_link_service.js +2 -2
- package/lib/web/pdf_outline_viewer.js +53 -28
- package/lib/web/pdf_page_view.js +9 -18
- package/lib/web/pdf_presentation_mode.js +1 -1
- package/lib/web/pdf_print_service.js +5 -3
- package/lib/web/pdf_rendering_queue.js +4 -7
- package/lib/web/pdf_sidebar.js +24 -17
- package/lib/web/pdf_sidebar_resizer.js +1 -1
- package/lib/web/pdf_single_page_viewer.js +1 -1
- package/lib/web/pdf_thumbnail_view.js +2 -2
- package/lib/web/pdf_thumbnail_viewer.js +3 -3
- package/lib/web/pdf_viewer.component.js +3 -3
- package/lib/web/pdf_viewer.js +3 -3
- package/lib/web/preferences.js +30 -30
- package/lib/web/secondary_toolbar.js +1 -1
- package/lib/web/text_layer_builder.js +23 -45
- package/lib/web/toolbar.js +1 -1
- package/lib/web/ui_utils.js +14 -14
- package/lib/web/view_history.js +15 -15
- package/lib/web/viewer_compatibility.js +1 -1
- package/package.json +1 -1
- package/web/pdf_viewer.css +21 -10
- package/web/pdf_viewer.js +126 -194
- package/web/pdf_viewer.js.map +1 -1
- package/lib/display/dom_utils.js +0 -494
- package/lib/test/unit/dom_utils_spec.js +0 -89
package/lib/web/grab_to_pan.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 2019 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.
|
@@ -175,4 +175,6 @@ function isLeftMouseReleased(event) {
|
|
175
175
|
if (isChrome15OrOpera15plus || isSafari6plus) {
|
176
176
|
return event.which === 0;
|
177
177
|
}
|
178
|
+
|
179
|
+
return false;
|
178
180
|
}
|
package/lib/web/interfaces.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 2019 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.
|
@@ -204,8 +204,8 @@ function () {
|
|
204
204
|
value: function () {
|
205
205
|
var _getLanguage = _asyncToGenerator(
|
206
206
|
/*#__PURE__*/
|
207
|
-
_regenerator
|
208
|
-
return _regenerator
|
207
|
+
_regenerator["default"].mark(function _callee() {
|
208
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
209
209
|
while (1) {
|
210
210
|
switch (_context.prev = _context.next) {
|
211
211
|
case 0:
|
@@ -213,7 +213,7 @@ function () {
|
|
213
213
|
return _context.stop();
|
214
214
|
}
|
215
215
|
}
|
216
|
-
}, _callee
|
216
|
+
}, _callee);
|
217
217
|
}));
|
218
218
|
|
219
219
|
function getLanguage() {
|
@@ -227,8 +227,8 @@ function () {
|
|
227
227
|
value: function () {
|
228
228
|
var _getDirection = _asyncToGenerator(
|
229
229
|
/*#__PURE__*/
|
230
|
-
_regenerator
|
231
|
-
return _regenerator
|
230
|
+
_regenerator["default"].mark(function _callee2() {
|
231
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
232
232
|
while (1) {
|
233
233
|
switch (_context2.prev = _context2.next) {
|
234
234
|
case 0:
|
@@ -236,7 +236,7 @@ function () {
|
|
236
236
|
return _context2.stop();
|
237
237
|
}
|
238
238
|
}
|
239
|
-
}, _callee2
|
239
|
+
}, _callee2);
|
240
240
|
}));
|
241
241
|
|
242
242
|
function getDirection() {
|
@@ -250,8 +250,8 @@ function () {
|
|
250
250
|
value: function () {
|
251
251
|
var _get = _asyncToGenerator(
|
252
252
|
/*#__PURE__*/
|
253
|
-
_regenerator
|
254
|
-
return _regenerator
|
253
|
+
_regenerator["default"].mark(function _callee3(key, args, fallback) {
|
254
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
255
255
|
while (1) {
|
256
256
|
switch (_context3.prev = _context3.next) {
|
257
257
|
case 0:
|
@@ -259,7 +259,7 @@ function () {
|
|
259
259
|
return _context3.stop();
|
260
260
|
}
|
261
261
|
}
|
262
|
-
}, _callee3
|
262
|
+
}, _callee3);
|
263
263
|
}));
|
264
264
|
|
265
265
|
function get(_x, _x2, _x3) {
|
@@ -273,8 +273,8 @@ function () {
|
|
273
273
|
value: function () {
|
274
274
|
var _translate = _asyncToGenerator(
|
275
275
|
/*#__PURE__*/
|
276
|
-
_regenerator
|
277
|
-
return _regenerator
|
276
|
+
_regenerator["default"].mark(function _callee4(element) {
|
277
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
278
278
|
while (1) {
|
279
279
|
switch (_context4.prev = _context4.next) {
|
280
280
|
case 0:
|
@@ -282,7 +282,7 @@ function () {
|
|
282
282
|
return _context4.stop();
|
283
283
|
}
|
284
284
|
}
|
285
|
-
}, _callee4
|
285
|
+
}, _callee4);
|
286
286
|
}));
|
287
287
|
|
288
288
|
function translate(_x4) {
|
@@ -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 2019 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.
|
@@ -28,7 +28,7 @@ exports.OverlayManager = void 0;
|
|
28
28
|
|
29
29
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
30
30
|
|
31
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
31
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
32
32
|
|
33
33
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
34
34
|
|
@@ -56,12 +56,12 @@ function () {
|
|
56
56
|
value: function () {
|
57
57
|
var _register = _asyncToGenerator(
|
58
58
|
/*#__PURE__*/
|
59
|
-
_regenerator
|
59
|
+
_regenerator["default"].mark(function _callee(name, element) {
|
60
60
|
var callerCloseMethod,
|
61
61
|
canForceClose,
|
62
62
|
container,
|
63
63
|
_args = arguments;
|
64
|
-
return _regenerator
|
64
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
65
65
|
while (1) {
|
66
66
|
switch (_context.prev = _context.next) {
|
67
67
|
case 0:
|
@@ -110,8 +110,8 @@ function () {
|
|
110
110
|
value: function () {
|
111
111
|
var _unregister = _asyncToGenerator(
|
112
112
|
/*#__PURE__*/
|
113
|
-
_regenerator
|
114
|
-
return _regenerator
|
113
|
+
_regenerator["default"].mark(function _callee2(name) {
|
114
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
115
115
|
while (1) {
|
116
116
|
switch (_context2.prev = _context2.next) {
|
117
117
|
case 0:
|
@@ -152,8 +152,8 @@ function () {
|
|
152
152
|
value: function () {
|
153
153
|
var _open = _asyncToGenerator(
|
154
154
|
/*#__PURE__*/
|
155
|
-
_regenerator
|
156
|
-
return _regenerator
|
155
|
+
_regenerator["default"].mark(function _callee3(name) {
|
156
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
157
157
|
while (1) {
|
158
158
|
switch (_context3.prev = _context3.next) {
|
159
159
|
case 0:
|
@@ -219,8 +219,8 @@ function () {
|
|
219
219
|
value: function () {
|
220
220
|
var _close = _asyncToGenerator(
|
221
221
|
/*#__PURE__*/
|
222
|
-
_regenerator
|
223
|
-
return _regenerator
|
222
|
+
_regenerator["default"].mark(function _callee4(name) {
|
223
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
224
224
|
while (1) {
|
225
225
|
switch (_context4.prev = _context4.next) {
|
226
226
|
case 0:
|
@@ -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 2019 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.
|
@@ -103,7 +103,7 @@ function () {
|
|
103
103
|
|
104
104
|
if (password && password.length > 0) {
|
105
105
|
this.close();
|
106
|
-
|
106
|
+
this.updateCallback(password);
|
107
107
|
}
|
108
108
|
}
|
109
109
|
}, {
|
@@ -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 2019 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.
|
@@ -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 2019 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.
|
@@ -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 2019 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,10 +26,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
26
26
|
});
|
27
27
|
exports.PDFDocumentProperties = void 0;
|
28
28
|
|
29
|
-
var
|
29
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
30
30
|
|
31
31
|
var _pdf = require("../pdf");
|
32
32
|
|
33
|
+
var _ui_utils = require("./ui_utils");
|
34
|
+
|
35
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
36
|
+
|
37
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
38
|
+
|
39
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
40
|
+
|
33
41
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
34
42
|
|
35
43
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
@@ -252,136 +260,197 @@ function () {
|
|
252
260
|
}
|
253
261
|
}, {
|
254
262
|
key: "_parseFileSize",
|
255
|
-
value: function
|
256
|
-
var
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
return
|
263
|
-
|
264
|
-
|
265
|
-
|
263
|
+
value: function () {
|
264
|
+
var _parseFileSize2 = _asyncToGenerator(
|
265
|
+
/*#__PURE__*/
|
266
|
+
_regenerator["default"].mark(function _callee() {
|
267
|
+
var fileSize,
|
268
|
+
kb,
|
269
|
+
_args = arguments;
|
270
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
271
|
+
while (1) {
|
272
|
+
switch (_context.prev = _context.next) {
|
273
|
+
case 0:
|
274
|
+
fileSize = _args.length > 0 && _args[0] !== undefined ? _args[0] : 0;
|
275
|
+
kb = fileSize / 1024;
|
276
|
+
|
277
|
+
if (kb) {
|
278
|
+
_context.next = 6;
|
279
|
+
break;
|
280
|
+
}
|
281
|
+
|
282
|
+
return _context.abrupt("return", undefined);
|
283
|
+
|
284
|
+
case 6:
|
285
|
+
if (!(kb < 1024)) {
|
286
|
+
_context.next = 8;
|
287
|
+
break;
|
288
|
+
}
|
289
|
+
|
290
|
+
return _context.abrupt("return", this.l10n.get('document_properties_kb', {
|
291
|
+
size_kb: (+kb.toPrecision(3)).toLocaleString(),
|
292
|
+
size_b: fileSize.toLocaleString()
|
293
|
+
}, '{{size_kb}} KB ({{size_b}} bytes)'));
|
294
|
+
|
295
|
+
case 8:
|
296
|
+
return _context.abrupt("return", this.l10n.get('document_properties_mb', {
|
297
|
+
size_mb: (+(kb / 1024).toPrecision(3)).toLocaleString(),
|
298
|
+
size_b: fileSize.toLocaleString()
|
299
|
+
}, '{{size_mb}} MB ({{size_b}} bytes)'));
|
300
|
+
|
301
|
+
case 9:
|
302
|
+
case "end":
|
303
|
+
return _context.stop();
|
304
|
+
}
|
305
|
+
}
|
306
|
+
}, _callee, this);
|
307
|
+
}));
|
308
|
+
|
309
|
+
function _parseFileSize() {
|
310
|
+
return _parseFileSize2.apply(this, arguments);
|
266
311
|
}
|
267
312
|
|
268
|
-
return
|
269
|
-
|
270
|
-
size_b: fileSize.toLocaleString()
|
271
|
-
}, '{{size_mb}} MB ({{size_b}} bytes)');
|
272
|
-
}
|
313
|
+
return _parseFileSize;
|
314
|
+
}()
|
273
315
|
}, {
|
274
316
|
key: "_parsePageSize",
|
275
|
-
value: function
|
276
|
-
var
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
317
|
+
value: function () {
|
318
|
+
var _parsePageSize2 = _asyncToGenerator(
|
319
|
+
/*#__PURE__*/
|
320
|
+
_regenerator["default"].mark(function _callee2(pageSizeInches, pagesRotation) {
|
321
|
+
var _this3 = this;
|
322
|
+
|
323
|
+
var isPortrait, sizeInches, sizeMillimeters, pageName, name, exactMillimeters, intMillimeters;
|
324
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
325
|
+
while (1) {
|
326
|
+
switch (_context2.prev = _context2.next) {
|
327
|
+
case 0:
|
328
|
+
if (pageSizeInches) {
|
329
|
+
_context2.next = 2;
|
330
|
+
break;
|
331
|
+
}
|
332
|
+
|
333
|
+
return _context2.abrupt("return", undefined);
|
334
|
+
|
335
|
+
case 2:
|
336
|
+
if (pagesRotation % 180 !== 0) {
|
337
|
+
pageSizeInches = {
|
338
|
+
width: pageSizeInches.height,
|
339
|
+
height: pageSizeInches.width
|
340
|
+
};
|
341
|
+
}
|
342
|
+
|
343
|
+
isPortrait = (0, _ui_utils.isPortraitOrientation)(pageSizeInches);
|
344
|
+
sizeInches = {
|
345
|
+
width: Math.round(pageSizeInches.width * 100) / 100,
|
346
|
+
height: Math.round(pageSizeInches.height * 100) / 100
|
347
|
+
};
|
348
|
+
sizeMillimeters = {
|
349
|
+
width: Math.round(pageSizeInches.width * 25.4 * 10) / 10,
|
350
|
+
height: Math.round(pageSizeInches.height * 25.4 * 10) / 10
|
351
|
+
};
|
352
|
+
pageName = null;
|
353
|
+
name = getPageName(sizeInches, isPortrait, US_PAGE_NAMES) || getPageName(sizeMillimeters, isPortrait, METRIC_PAGE_NAMES);
|
354
|
+
|
355
|
+
if (!name && !(Number.isInteger(sizeMillimeters.width) && Number.isInteger(sizeMillimeters.height))) {
|
356
|
+
exactMillimeters = {
|
357
|
+
width: pageSizeInches.width * 25.4,
|
358
|
+
height: pageSizeInches.height * 25.4
|
359
|
+
};
|
360
|
+
intMillimeters = {
|
361
|
+
width: Math.round(sizeMillimeters.width),
|
362
|
+
height: Math.round(sizeMillimeters.height)
|
363
|
+
};
|
364
|
+
|
365
|
+
if (Math.abs(exactMillimeters.width - intMillimeters.width) < 0.1 && Math.abs(exactMillimeters.height - intMillimeters.height) < 0.1) {
|
366
|
+
name = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES);
|
367
|
+
|
368
|
+
if (name) {
|
369
|
+
sizeInches = {
|
370
|
+
width: Math.round(intMillimeters.width / 25.4 * 100) / 100,
|
371
|
+
height: Math.round(intMillimeters.height / 25.4 * 100) / 100
|
372
|
+
};
|
373
|
+
sizeMillimeters = intMillimeters;
|
374
|
+
}
|
375
|
+
}
|
376
|
+
}
|
377
|
+
|
378
|
+
if (name) {
|
379
|
+
pageName = this.l10n.get('document_properties_page_size_name_' + name.toLowerCase(), null, name);
|
380
|
+
}
|
381
|
+
|
382
|
+
return _context2.abrupt("return", Promise.all([this._isNonMetricLocale ? sizeInches : sizeMillimeters, this.l10n.get('document_properties_page_size_unit_' + (this._isNonMetricLocale ? 'inches' : 'millimeters'), null, this._isNonMetricLocale ? 'in' : 'mm'), pageName, this.l10n.get('document_properties_page_size_orientation_' + (isPortrait ? 'portrait' : 'landscape'), null, isPortrait ? 'portrait' : 'landscape')]).then(function (_ref6) {
|
383
|
+
var _ref7 = _slicedToArray(_ref6, 4),
|
384
|
+
_ref7$ = _ref7[0],
|
385
|
+
width = _ref7$.width,
|
386
|
+
height = _ref7$.height,
|
387
|
+
unit = _ref7[1],
|
388
|
+
name = _ref7[2],
|
389
|
+
orientation = _ref7[3];
|
390
|
+
|
391
|
+
return _this3.l10n.get('document_properties_page_size_dimension_' + (name ? 'name_' : '') + 'string', {
|
392
|
+
width: width.toLocaleString(),
|
393
|
+
height: height.toLocaleString(),
|
394
|
+
unit: unit,
|
395
|
+
name: name,
|
396
|
+
orientation: orientation
|
397
|
+
}, '{{width}} × {{height}} {{unit}} (' + (name ? '{{name}}, ' : '') + '{{orientation}})');
|
398
|
+
}));
|
399
|
+
|
400
|
+
case 11:
|
401
|
+
case "end":
|
402
|
+
return _context2.stop();
|
403
|
+
}
|
320
404
|
}
|
321
|
-
}
|
322
|
-
}
|
405
|
+
}, _callee2, this);
|
406
|
+
}));
|
323
407
|
|
324
|
-
|
325
|
-
|
408
|
+
function _parsePageSize(_x, _x2) {
|
409
|
+
return _parsePageSize2.apply(this, arguments);
|
326
410
|
}
|
327
411
|
|
328
|
-
return
|
329
|
-
|
330
|
-
_ref7$ = _ref7[0],
|
331
|
-
width = _ref7$.width,
|
332
|
-
height = _ref7$.height,
|
333
|
-
unit = _ref7[1],
|
334
|
-
name = _ref7[2],
|
335
|
-
orientation = _ref7[3];
|
336
|
-
|
337
|
-
return _this3.l10n.get('document_properties_page_size_dimension_' + (name ? 'name_' : '') + 'string', {
|
338
|
-
width: width.toLocaleString(),
|
339
|
-
height: height.toLocaleString(),
|
340
|
-
unit: unit,
|
341
|
-
name: name,
|
342
|
-
orientation: orientation
|
343
|
-
}, '{{width}} × {{height}} {{unit}} (' + (name ? '{{name}}, ' : '') + '{{orientation}})');
|
344
|
-
});
|
345
|
-
}
|
412
|
+
return _parsePageSize;
|
413
|
+
}()
|
346
414
|
}, {
|
347
415
|
key: "_parseDate",
|
348
|
-
value: function
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
416
|
+
value: function () {
|
417
|
+
var _parseDate2 = _asyncToGenerator(
|
418
|
+
/*#__PURE__*/
|
419
|
+
_regenerator["default"].mark(function _callee3(inputDate) {
|
420
|
+
var dateObject;
|
421
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
422
|
+
while (1) {
|
423
|
+
switch (_context3.prev = _context3.next) {
|
424
|
+
case 0:
|
425
|
+
dateObject = _pdf.PDFDateString.toDateObject(inputDate);
|
426
|
+
|
427
|
+
if (dateObject) {
|
428
|
+
_context3.next = 3;
|
429
|
+
break;
|
430
|
+
}
|
431
|
+
|
432
|
+
return _context3.abrupt("return", undefined);
|
433
|
+
|
434
|
+
case 3:
|
435
|
+
return _context3.abrupt("return", this.l10n.get('document_properties_date_string', {
|
436
|
+
date: dateObject.toLocaleDateString(),
|
437
|
+
time: dateObject.toLocaleTimeString()
|
438
|
+
}, '{{date}}, {{time}}'));
|
439
|
+
|
440
|
+
case 4:
|
441
|
+
case "end":
|
442
|
+
return _context3.stop();
|
443
|
+
}
|
444
|
+
}
|
445
|
+
}, _callee3, this);
|
446
|
+
}));
|
358
447
|
|
359
|
-
|
360
|
-
|
361
|
-
var day = parseInt(dateToParse.substring(6, 8), 10);
|
362
|
-
var hours = parseInt(dateToParse.substring(8, 10), 10);
|
363
|
-
var minutes = parseInt(dateToParse.substring(10, 12), 10);
|
364
|
-
var seconds = parseInt(dateToParse.substring(12, 14), 10);
|
365
|
-
var utRel = dateToParse.substring(14, 15);
|
366
|
-
var offsetHours = parseInt(dateToParse.substring(15, 17), 10);
|
367
|
-
var offsetMinutes = parseInt(dateToParse.substring(18, 20), 10);
|
368
|
-
|
369
|
-
if (utRel === '-') {
|
370
|
-
hours += offsetHours;
|
371
|
-
minutes += offsetMinutes;
|
372
|
-
} else if (utRel === '+') {
|
373
|
-
hours -= offsetHours;
|
374
|
-
minutes -= offsetMinutes;
|
448
|
+
function _parseDate(_x3) {
|
449
|
+
return _parseDate2.apply(this, arguments);
|
375
450
|
}
|
376
451
|
|
377
|
-
|
378
|
-
|
379
|
-
var timeString = date.toLocaleTimeString();
|
380
|
-
return this.l10n.get('document_properties_date_string', {
|
381
|
-
date: dateString,
|
382
|
-
time: timeString
|
383
|
-
}, '{{date}}, {{time}}');
|
384
|
-
}
|
452
|
+
return _parseDate;
|
453
|
+
}()
|
385
454
|
}, {
|
386
455
|
key: "_parseLinearization",
|
387
456
|
value: function _parseLinearization(isLinearized) {
|
package/lib/web/pdf_find_bar.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 2019 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.
|
@@ -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 2019 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.
|
@@ -236,8 +236,8 @@ function () {
|
|
236
236
|
var pageNumber = this._selected.pageIdx + 1;
|
237
237
|
var linkService = this._linkService;
|
238
238
|
|
239
|
-
if (pageNumber >= 1 && pageNumber <= linkService.pagesCount &&
|
240
|
-
|
239
|
+
if (pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !linkService.isPageVisible(pageNumber)) {
|
240
|
+
return true;
|
241
241
|
}
|
242
242
|
|
243
243
|
return false;
|
@@ -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 2019 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.
|
package/lib/web/pdf_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 2019 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.
|
@@ -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 2019 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.
|
@@ -99,7 +99,7 @@ function () {
|
|
99
99
|
namedDest: namedDest,
|
100
100
|
explicitDest: explicitDest
|
101
101
|
});
|
102
|
-
})
|
102
|
+
})["catch"](function () {
|
103
103
|
console.error("PDFLinkService.navigateTo: \"".concat(destRef, "\" is not ") + "a valid page reference, for dest=\"".concat(dest, "\"."));
|
104
104
|
});
|
105
105
|
|