pdfjs-dist 2.4.456 → 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/bower.json +1 -1
- package/build/pdf.js +4447 -4379
- package/build/pdf.js.map +1 -1
- package/build/pdf.min.js +1 -1
- package/build/pdf.worker.js +8549 -8507
- package/build/pdf.worker.js.map +1 -1
- package/build/pdf.worker.min.js +1 -1
- package/es5/build/pdf.js +14755 -14540
- package/es5/build/pdf.js.map +1 -1
- package/es5/build/pdf.worker.js +9830 -9469
- package/es5/build/pdf.worker.js.map +1 -1
- package/es5/web/pdf_viewer.css +5 -9
- package/es5/web/pdf_viewer.js +157 -172
- package/es5/web/pdf_viewer.js.map +1 -1
- package/image_decoders/pdf.image_decoders.js +107 -93
- package/image_decoders/pdf.image_decoders.js.map +1 -1
- package/image_decoders/pdf.image_decoders.min.js +1 -1
- package/lib/README.md +2 -2
- package/lib/core/ccitt.js +7 -7
- package/lib/core/cff_parser.js +1 -1
- package/lib/core/chunked_stream.js +5 -5
- package/lib/core/cmap.js +13 -0
- package/lib/core/document.js +22 -18
- package/lib/core/evaluator.js +285 -247
- package/lib/core/font_renderer.js +7 -7
- package/lib/core/fonts.js +163 -147
- package/lib/core/function.js +4 -5
- package/lib/core/glyphlist.js +4523 -4523
- package/lib/core/image.js +19 -44
- package/lib/core/image_utils.js +123 -47
- package/lib/core/jpeg_stream.js +2 -116
- package/lib/core/jpg.js +47 -55
- package/lib/core/jpx.js +6 -6
- package/lib/core/metrics.js +2916 -2916
- package/lib/core/obj.js +18 -7
- package/lib/core/operator_list.js +5 -0
- package/lib/core/parser.js +1 -1
- package/lib/core/pdf_manager.js +2 -2
- package/lib/core/primitives.js +4 -0
- package/lib/core/standard_fonts.js +103 -103
- package/lib/core/type1_parser.js +6 -6
- package/lib/core/worker.js +31 -24
- package/lib/core/worker_stream.js +1 -1
- package/lib/display/annotation_layer.js +3 -0
- package/lib/display/api.js +29 -137
- package/lib/display/api_compatibility.js +11 -18
- package/lib/display/canvas.js +7 -34
- package/lib/display/content_disposition.js +4 -4
- package/lib/display/display_utils.js +6 -15
- package/lib/display/fetch_stream.js +3 -1
- package/lib/display/font_loader.js +2 -2
- package/lib/display/network.js +1 -1
- package/lib/display/node_stream.js +10 -8
- package/lib/display/pattern_helper.js +1 -1
- package/lib/display/svg.js +61 -31
- package/lib/display/text_layer.js +44 -32
- package/lib/display/transport_stream.js +3 -3
- package/lib/pdf.js +210 -48
- package/lib/pdf.worker.js +12 -4
- package/lib/shared/compatibility.js +2 -0
- package/lib/shared/is_node.js +1 -1
- package/lib/shared/message_handler.js +6 -6
- package/lib/shared/util.js +15 -9
- package/lib/test/unit/api_spec.js +165 -95
- package/lib/test/unit/cff_parser_spec.js +12 -12
- package/lib/test/unit/clitests_helper.js +1 -1
- package/lib/test/unit/display_svg_spec.js +1 -5
- package/lib/test/unit/jasmine-boot.js +2 -2
- package/lib/test/unit/node_stream_spec.js +5 -3
- package/lib/test/unit/parser_spec.js +3 -3
- package/lib/test/unit/test_utils.js +1 -1
- package/lib/test/unit/testreporter.js +4 -4
- package/lib/test/unit/ui_utils_spec.js +1 -55
- package/lib/test/unit/unicode_spec.js +1 -1
- package/lib/web/app.js +247 -159
- package/lib/web/app_options.js +16 -10
- package/lib/web/base_viewer.js +14 -6
- package/lib/web/download_manager.js +3 -1
- package/lib/web/firefox_print_service.js +1 -1
- package/lib/web/firefoxcom.js +16 -4
- package/lib/web/pdf_attachment_viewer.js +14 -7
- package/lib/web/pdf_document_properties.js +11 -16
- package/lib/web/pdf_find_bar.js +3 -3
- package/lib/web/pdf_find_controller.js +3 -3
- package/lib/web/pdf_history.js +7 -5
- package/lib/web/pdf_link_service.js +7 -8
- package/lib/web/pdf_page_view.js +1 -1
- package/lib/web/pdf_presentation_mode.js +6 -2
- package/lib/web/pdf_print_service.js +1 -1
- package/lib/web/pdf_single_page_viewer.js +2 -2
- package/lib/web/pdf_viewer.component.js +2 -2
- package/lib/web/pdf_viewer.js +2 -2
- package/lib/web/preferences.js +4 -1
- package/lib/web/text_layer_builder.js +1 -3
- package/lib/web/ui_utils.js +3 -55
- package/lib/web/view_history.js +8 -9
- package/lib/web/viewer_compatibility.js +14 -1
- package/package.json +1 -1
- package/web/pdf_viewer.css +5 -9
- package/web/pdf_viewer.js +97 -127
- package/web/pdf_viewer.js.map +1 -1
@@ -21,13 +21,25 @@
|
|
21
21
|
*/
|
22
22
|
"use strict";
|
23
23
|
|
24
|
+
Object.defineProperty(exports, "__esModule", {
|
25
|
+
value: true
|
26
|
+
});
|
27
|
+
exports.viewerCompatibilityParams = void 0;
|
24
28
|
const compatibilityParams = Object.create(null);
|
25
29
|
{
|
26
30
|
const userAgent = typeof navigator !== "undefined" && navigator.userAgent || "";
|
27
31
|
const platform = typeof navigator !== "undefined" && navigator.platform || "";
|
28
32
|
const maxTouchPoints = typeof navigator !== "undefined" && navigator.maxTouchPoints || 1;
|
29
33
|
const isAndroid = /Android/.test(userAgent);
|
34
|
+
const isIE = /Trident/.test(userAgent);
|
30
35
|
const isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1;
|
36
|
+
const isIOSChrome = /CriOS/.test(userAgent);
|
37
|
+
|
38
|
+
(function checkOnBlobSupport() {
|
39
|
+
if (isIE || isIOSChrome) {
|
40
|
+
compatibilityParams.disableCreateObjectURL = true;
|
41
|
+
}
|
42
|
+
})();
|
31
43
|
|
32
44
|
(function checkCanvasSizeLimitation() {
|
33
45
|
if (isIOS || isAndroid) {
|
@@ -35,4 +47,5 @@ const compatibilityParams = Object.create(null);
|
|
35
47
|
}
|
36
48
|
})();
|
37
49
|
}
|
38
|
-
|
50
|
+
const viewerCompatibilityParams = Object.freeze(compatibilityParams);
|
51
|
+
exports.viewerCompatibilityParams = viewerCompatibilityParams;
|
package/package.json
CHANGED
package/web/pdf_viewer.css
CHANGED
@@ -29,8 +29,7 @@
|
|
29
29
|
position: absolute;
|
30
30
|
white-space: pre;
|
31
31
|
cursor: text;
|
32
|
-
|
33
|
-
transform-origin: 0% 0%;
|
32
|
+
transform-origin: 0% 0%;
|
34
33
|
}
|
35
34
|
|
36
35
|
.textLayer .highlight {
|
@@ -182,13 +181,11 @@
|
|
182
181
|
}
|
183
182
|
|
184
183
|
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before {
|
185
|
-
|
186
|
-
transform: rotate(45deg);
|
184
|
+
transform: rotate(45deg);
|
187
185
|
}
|
188
186
|
|
189
187
|
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
|
190
|
-
|
191
|
-
transform: rotate(-45deg);
|
188
|
+
transform: rotate(-45deg);
|
192
189
|
}
|
193
190
|
|
194
191
|
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
|
@@ -292,9 +289,8 @@
|
|
292
289
|
overflow: visible;
|
293
290
|
border: 9px solid transparent;
|
294
291
|
background-clip: content-box;
|
295
|
-
-
|
296
|
-
|
297
|
-
border-image: url(images/shadow.png) 9 9 repeat;
|
292
|
+
-o-border-image: url(images/shadow.png) 9 9 repeat;
|
293
|
+
border-image: url(images/shadow.png) 9 9 repeat;
|
298
294
|
background-color: rgba(255, 255, 255, 1);
|
299
295
|
}
|
300
296
|
|
package/web/pdf_viewer.js
CHANGED
@@ -233,20 +233,20 @@ var _pdf_link_service = __w_pdfjs_require__(4);
|
|
233
233
|
|
234
234
|
var _download_manager = __w_pdfjs_require__(6);
|
235
235
|
|
236
|
-
var _genericl10n = __w_pdfjs_require__(
|
236
|
+
var _genericl10n = __w_pdfjs_require__(8);
|
237
237
|
|
238
|
-
var _pdf_find_controller = __w_pdfjs_require__(
|
238
|
+
var _pdf_find_controller = __w_pdfjs_require__(10);
|
239
239
|
|
240
|
-
var _pdf_history = __w_pdfjs_require__(
|
240
|
+
var _pdf_history = __w_pdfjs_require__(12);
|
241
241
|
|
242
|
-
var _pdf_page_view = __w_pdfjs_require__(
|
242
|
+
var _pdf_page_view = __w_pdfjs_require__(13);
|
243
243
|
|
244
244
|
var _pdf_single_page_viewer = __w_pdfjs_require__(15);
|
245
245
|
|
246
246
|
var _pdf_viewer = __w_pdfjs_require__(17);
|
247
247
|
|
248
|
-
const pdfjsVersion = '2.
|
249
|
-
const pdfjsBuild = '
|
248
|
+
const pdfjsVersion = '2.5.207';
|
249
|
+
const pdfjsBuild = '0974d605';
|
250
250
|
|
251
251
|
/***/ }),
|
252
252
|
/* 1 */
|
@@ -390,7 +390,6 @@ exports.isValidRotation = isValidRotation;
|
|
390
390
|
exports.isValidScrollMode = isValidScrollMode;
|
391
391
|
exports.isValidSpreadMode = isValidSpreadMode;
|
392
392
|
exports.isPortraitOrientation = isPortraitOrientation;
|
393
|
-
exports.getGlobalEventBus = getGlobalEventBus;
|
394
393
|
exports.clamp = clamp;
|
395
394
|
exports.getPDFFileNameFromURL = getPDFFileNameFromURL;
|
396
395
|
exports.noContextMenuHandler = noContextMenuHandler;
|
@@ -598,7 +597,7 @@ function binarySearchFirstItem(items, condition) {
|
|
598
597
|
let minIndex = 0;
|
599
598
|
let maxIndex = items.length - 1;
|
600
599
|
|
601
|
-
if (
|
600
|
+
if (maxIndex < 0 || !condition(items[maxIndex])) {
|
602
601
|
return items.length;
|
603
602
|
}
|
604
603
|
|
@@ -928,41 +927,12 @@ const animationStarted = new Promise(function (resolve) {
|
|
928
927
|
exports.animationStarted = animationStarted;
|
929
928
|
|
930
929
|
function dispatchDOMEvent(eventName, args = null) {
|
931
|
-
|
932
|
-
|
933
|
-
if (args && args.length > 0) {
|
934
|
-
const obj = args[0];
|
935
|
-
|
936
|
-
for (const key in obj) {
|
937
|
-
const value = obj[key];
|
938
|
-
|
939
|
-
if (key === "source") {
|
940
|
-
if (value === window || value === document) {
|
941
|
-
return;
|
942
|
-
}
|
943
|
-
|
944
|
-
continue;
|
945
|
-
}
|
946
|
-
|
947
|
-
details[key] = value;
|
948
|
-
}
|
949
|
-
}
|
950
|
-
|
951
|
-
const event = document.createEvent("CustomEvent");
|
952
|
-
event.initCustomEvent(eventName, true, true, details);
|
953
|
-
document.dispatchEvent(event);
|
930
|
+
throw new Error("Not implemented: dispatchDOMEvent");
|
954
931
|
}
|
955
932
|
|
956
933
|
class EventBus {
|
957
|
-
constructor({
|
958
|
-
dispatchToDOM = false
|
959
|
-
} = {}) {
|
934
|
+
constructor(options) {
|
960
935
|
this._listeners = Object.create(null);
|
961
|
-
this._dispatchToDOM = dispatchToDOM === true;
|
962
|
-
|
963
|
-
if (dispatchToDOM) {
|
964
|
-
console.error("The `eventBusDispatchToDOM` option/preference is deprecated, " + "add event listeners to the EventBus instance rather than the DOM.");
|
965
|
-
}
|
966
936
|
}
|
967
937
|
|
968
938
|
on(eventName, listener) {
|
@@ -981,11 +951,6 @@ class EventBus {
|
|
981
951
|
const eventListeners = this._listeners[eventName];
|
982
952
|
|
983
953
|
if (!eventListeners || eventListeners.length === 0) {
|
984
|
-
if (this._dispatchToDOM) {
|
985
|
-
const args = Array.prototype.slice.call(arguments, 1);
|
986
|
-
dispatchDOMEvent(eventName, args);
|
987
|
-
}
|
988
|
-
|
989
954
|
return;
|
990
955
|
}
|
991
956
|
|
@@ -1013,10 +978,6 @@ class EventBus {
|
|
1013
978
|
});
|
1014
979
|
externalListeners = null;
|
1015
980
|
}
|
1016
|
-
|
1017
|
-
if (this._dispatchToDOM) {
|
1018
|
-
dispatchDOMEvent(eventName, args);
|
1019
|
-
}
|
1020
981
|
}
|
1021
982
|
|
1022
983
|
_on(eventName, listener, options = null) {
|
@@ -1050,19 +1011,6 @@ class EventBus {
|
|
1050
1011
|
}
|
1051
1012
|
|
1052
1013
|
exports.EventBus = EventBus;
|
1053
|
-
let globalEventBus = null;
|
1054
|
-
|
1055
|
-
function getGlobalEventBus(dispatchToDOM = false) {
|
1056
|
-
console.error("getGlobalEventBus is deprecated, use a manually created EventBus instance instead.");
|
1057
|
-
|
1058
|
-
if (!globalEventBus) {
|
1059
|
-
globalEventBus = new EventBus({
|
1060
|
-
dispatchToDOM
|
1061
|
-
});
|
1062
|
-
}
|
1063
|
-
|
1064
|
-
return globalEventBus;
|
1065
|
-
}
|
1066
1014
|
|
1067
1015
|
function clamp(v, min, max) {
|
1068
1016
|
return Math.min(Math.max(v, min), max);
|
@@ -1185,7 +1133,7 @@ class PDFLinkService {
|
|
1185
1133
|
externalLinkEnabled = true,
|
1186
1134
|
ignoreDestinationZoom = false
|
1187
1135
|
} = {}) {
|
1188
|
-
this.eventBus = eventBus
|
1136
|
+
this.eventBus = eventBus;
|
1189
1137
|
this.externalLinkTarget = externalLinkTarget;
|
1190
1138
|
this.externalLinkRel = externalLinkRel;
|
1191
1139
|
this.externalLinkEnabled = externalLinkEnabled;
|
@@ -1333,16 +1281,11 @@ class PDFLinkService {
|
|
1333
1281
|
if ("search" in params) {
|
1334
1282
|
this.eventBus.dispatch("findfromurlhash", {
|
1335
1283
|
source: this,
|
1336
|
-
query: params
|
1337
|
-
phraseSearch: params
|
1284
|
+
query: params.search.replace(/"/g, ""),
|
1285
|
+
phraseSearch: params.phrase === "true"
|
1338
1286
|
});
|
1339
1287
|
}
|
1340
1288
|
|
1341
|
-
if ("nameddest" in params) {
|
1342
|
-
this.navigateTo(params.nameddest);
|
1343
|
-
return;
|
1344
|
-
}
|
1345
|
-
|
1346
1289
|
if ("page" in params) {
|
1347
1290
|
pageNumber = params.page | 0 || 1;
|
1348
1291
|
}
|
@@ -1395,6 +1338,10 @@ class PDFLinkService {
|
|
1395
1338
|
mode: params.pagemode
|
1396
1339
|
});
|
1397
1340
|
}
|
1341
|
+
|
1342
|
+
if ("nameddest" in params) {
|
1343
|
+
this.navigateTo(params.nameddest);
|
1344
|
+
}
|
1398
1345
|
} else {
|
1399
1346
|
dest = unescape(hash);
|
1400
1347
|
|
@@ -1615,8 +1562,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
1615
1562
|
});
|
1616
1563
|
exports.DefaultTextLayerFactory = exports.TextLayerBuilder = void 0;
|
1617
1564
|
|
1618
|
-
var _ui_utils = __w_pdfjs_require__(3);
|
1619
|
-
|
1620
1565
|
var _pdfjsLib = __w_pdfjs_require__(2);
|
1621
1566
|
|
1622
1567
|
const EXPAND_DIVS_TIMEOUT = 300;
|
@@ -1631,7 +1576,7 @@ class TextLayerBuilder {
|
|
1631
1576
|
enhanceTextSelection = false
|
1632
1577
|
}) {
|
1633
1578
|
this.textLayerDiv = textLayerDiv;
|
1634
|
-
this.eventBus = eventBus
|
1579
|
+
this.eventBus = eventBus;
|
1635
1580
|
this.textContent = null;
|
1636
1581
|
this.textContentItemsStr = [];
|
1637
1582
|
this.textContentStream = null;
|
@@ -2003,8 +1948,10 @@ exports.DownloadManager = void 0;
|
|
2003
1948
|
|
2004
1949
|
var _pdfjsLib = __w_pdfjs_require__(2);
|
2005
1950
|
|
1951
|
+
var _viewer_compatibility = __w_pdfjs_require__(7);
|
1952
|
+
|
2006
1953
|
;
|
2007
|
-
const DISABLE_CREATE_OBJECT_URL =
|
1954
|
+
const DISABLE_CREATE_OBJECT_URL = _viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL || false;
|
2008
1955
|
|
2009
1956
|
function download(blobUrl, filename) {
|
2010
1957
|
const a = document.createElement("a");
|
@@ -2081,12 +2028,48 @@ exports.DownloadManager = DownloadManager;
|
|
2081
2028
|
"use strict";
|
2082
2029
|
|
2083
2030
|
|
2031
|
+
Object.defineProperty(exports, "__esModule", {
|
2032
|
+
value: true
|
2033
|
+
});
|
2034
|
+
exports.viewerCompatibilityParams = void 0;
|
2035
|
+
const compatibilityParams = Object.create(null);
|
2036
|
+
{
|
2037
|
+
const userAgent = typeof navigator !== "undefined" && navigator.userAgent || "";
|
2038
|
+
const platform = typeof navigator !== "undefined" && navigator.platform || "";
|
2039
|
+
const maxTouchPoints = typeof navigator !== "undefined" && navigator.maxTouchPoints || 1;
|
2040
|
+
const isAndroid = /Android/.test(userAgent);
|
2041
|
+
const isIE = /Trident/.test(userAgent);
|
2042
|
+
const isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1;
|
2043
|
+
const isIOSChrome = /CriOS/.test(userAgent);
|
2044
|
+
|
2045
|
+
(function checkOnBlobSupport() {
|
2046
|
+
if (isIE || isIOSChrome) {
|
2047
|
+
compatibilityParams.disableCreateObjectURL = true;
|
2048
|
+
}
|
2049
|
+
})();
|
2050
|
+
|
2051
|
+
(function checkCanvasSizeLimitation() {
|
2052
|
+
if (isIOS || isAndroid) {
|
2053
|
+
compatibilityParams.maxCanvasPixels = 5242880;
|
2054
|
+
}
|
2055
|
+
})();
|
2056
|
+
}
|
2057
|
+
const viewerCompatibilityParams = Object.freeze(compatibilityParams);
|
2058
|
+
exports.viewerCompatibilityParams = viewerCompatibilityParams;
|
2059
|
+
|
2060
|
+
/***/ }),
|
2061
|
+
/* 8 */
|
2062
|
+
/***/ (function(module, exports, __w_pdfjs_require__) {
|
2063
|
+
|
2064
|
+
"use strict";
|
2065
|
+
|
2066
|
+
|
2084
2067
|
Object.defineProperty(exports, "__esModule", {
|
2085
2068
|
value: true
|
2086
2069
|
});
|
2087
2070
|
exports.GenericL10n = void 0;
|
2088
2071
|
|
2089
|
-
__w_pdfjs_require__(
|
2072
|
+
__w_pdfjs_require__(9);
|
2090
2073
|
|
2091
2074
|
const webL10n = document.webL10n;
|
2092
2075
|
|
@@ -2125,7 +2108,7 @@ class GenericL10n {
|
|
2125
2108
|
exports.GenericL10n = GenericL10n;
|
2126
2109
|
|
2127
2110
|
/***/ }),
|
2128
|
-
/*
|
2111
|
+
/* 9 */
|
2129
2112
|
/***/ (function(module, exports, __w_pdfjs_require__) {
|
2130
2113
|
|
2131
2114
|
"use strict";
|
@@ -2948,7 +2931,7 @@ document.webL10n = function (window, document, undefined) {
|
|
2948
2931
|
}(window, document);
|
2949
2932
|
|
2950
2933
|
/***/ }),
|
2951
|
-
/*
|
2934
|
+
/* 10 */
|
2952
2935
|
/***/ (function(module, exports, __w_pdfjs_require__) {
|
2953
2936
|
|
2954
2937
|
"use strict";
|
@@ -2959,11 +2942,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
2959
2942
|
});
|
2960
2943
|
exports.PDFFindController = exports.FindState = void 0;
|
2961
2944
|
|
2962
|
-
var _ui_utils = __w_pdfjs_require__(3);
|
2963
|
-
|
2964
2945
|
var _pdfjsLib = __w_pdfjs_require__(2);
|
2965
2946
|
|
2966
|
-
var _pdf_find_utils = __w_pdfjs_require__(
|
2947
|
+
var _pdf_find_utils = __w_pdfjs_require__(11);
|
2948
|
+
|
2949
|
+
var _ui_utils = __w_pdfjs_require__(3);
|
2967
2950
|
|
2968
2951
|
const FindState = {
|
2969
2952
|
FOUND: 0,
|
@@ -3007,7 +2990,7 @@ class PDFFindController {
|
|
3007
2990
|
eventBus
|
3008
2991
|
}) {
|
3009
2992
|
this._linkService = linkService;
|
3010
|
-
this._eventBus = eventBus
|
2993
|
+
this._eventBus = eventBus;
|
3011
2994
|
|
3012
2995
|
this._reset();
|
3013
2996
|
|
@@ -3629,7 +3612,7 @@ class PDFFindController {
|
|
3629
3612
|
exports.PDFFindController = PDFFindController;
|
3630
3613
|
|
3631
3614
|
/***/ }),
|
3632
|
-
/*
|
3615
|
+
/* 11 */
|
3633
3616
|
/***/ (function(module, exports, __w_pdfjs_require__) {
|
3634
3617
|
|
3635
3618
|
"use strict";
|
@@ -3725,7 +3708,7 @@ function getCharacterType(charCode) {
|
|
3725
3708
|
}
|
3726
3709
|
|
3727
3710
|
/***/ }),
|
3728
|
-
/*
|
3711
|
+
/* 12 */
|
3729
3712
|
/***/ (function(module, exports, __w_pdfjs_require__) {
|
3730
3713
|
|
3731
3714
|
"use strict";
|
@@ -3754,7 +3737,7 @@ class PDFHistory {
|
|
3754
3737
|
eventBus
|
3755
3738
|
}) {
|
3756
3739
|
this.linkService = linkService;
|
3757
|
-
this.eventBus = eventBus
|
3740
|
+
this.eventBus = eventBus;
|
3758
3741
|
this._initialized = false;
|
3759
3742
|
this._fingerprint = "";
|
3760
3743
|
this.reset();
|
@@ -3813,7 +3796,7 @@ class PDFHistory {
|
|
3813
3796
|
hash,
|
3814
3797
|
page,
|
3815
3798
|
rotation
|
3816
|
-
} = this._parseCurrentHash();
|
3799
|
+
} = this._parseCurrentHash(true);
|
3817
3800
|
|
3818
3801
|
if (!hash || reInitialized || resetHistory) {
|
3819
3802
|
this._pushOrReplaceState(null, true);
|
@@ -4091,11 +4074,13 @@ class PDFHistory {
|
|
4091
4074
|
this._numPositionUpdates = 0;
|
4092
4075
|
}
|
4093
4076
|
|
4094
|
-
_parseCurrentHash() {
|
4077
|
+
_parseCurrentHash(checkNameddest = false) {
|
4095
4078
|
const hash = unescape(getCurrentHash()).substring(1);
|
4096
|
-
|
4079
|
+
const params = (0, _ui_utils.parseQueryString)(hash);
|
4080
|
+
const nameddest = params.nameddest || "";
|
4081
|
+
let page = params.page | 0;
|
4097
4082
|
|
4098
|
-
if (!(Number.isInteger(page) && page > 0 && page <= this.linkService.pagesCount)) {
|
4083
|
+
if (!(Number.isInteger(page) && page > 0 && page <= this.linkService.pagesCount) || checkNameddest && nameddest.length > 0) {
|
4099
4084
|
page = null;
|
4100
4085
|
}
|
4101
4086
|
|
@@ -4311,7 +4296,7 @@ function isDestArraysEqual(firstDest, secondDest) {
|
|
4311
4296
|
}
|
4312
4297
|
|
4313
4298
|
/***/ }),
|
4314
|
-
/*
|
4299
|
+
/* 13 */
|
4315
4300
|
/***/ (function(module, exports, __w_pdfjs_require__) {
|
4316
4301
|
|
4317
4302
|
"use strict";
|
@@ -4326,9 +4311,9 @@ var _ui_utils = __w_pdfjs_require__(3);
|
|
4326
4311
|
|
4327
4312
|
var _pdfjsLib = __w_pdfjs_require__(2);
|
4328
4313
|
|
4329
|
-
var _pdf_rendering_queue = __w_pdfjs_require__(
|
4314
|
+
var _pdf_rendering_queue = __w_pdfjs_require__(14);
|
4330
4315
|
|
4331
|
-
var _viewer_compatibility = __w_pdfjs_require__(
|
4316
|
+
var _viewer_compatibility = __w_pdfjs_require__(7);
|
4332
4317
|
|
4333
4318
|
const MAX_CANVAS_PIXELS = _viewer_compatibility.viewerCompatibilityParams.maxCanvasPixels || 16777216;
|
4334
4319
|
|
@@ -4350,7 +4335,7 @@ class PDFPageView {
|
|
4350
4335
|
this.renderInteractiveForms = options.renderInteractiveForms || false;
|
4351
4336
|
this.useOnlyCssZoom = options.useOnlyCssZoom || false;
|
4352
4337
|
this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS;
|
4353
|
-
this.eventBus = options.eventBus
|
4338
|
+
this.eventBus = options.eventBus;
|
4354
4339
|
this.renderingQueue = options.renderingQueue;
|
4355
4340
|
this.textLayerFactory = options.textLayerFactory;
|
4356
4341
|
this.annotationLayerFactory = options.annotationLayerFactory;
|
@@ -4909,7 +4894,7 @@ class PDFPageView {
|
|
4909
4894
|
exports.PDFPageView = PDFPageView;
|
4910
4895
|
|
4911
4896
|
/***/ }),
|
4912
|
-
/*
|
4897
|
+
/* 14 */
|
4913
4898
|
/***/ (function(module, exports, __w_pdfjs_require__) {
|
4914
4899
|
|
4915
4900
|
"use strict";
|
@@ -5044,29 +5029,6 @@ class PDFRenderingQueue {
|
|
5044
5029
|
|
5045
5030
|
exports.PDFRenderingQueue = PDFRenderingQueue;
|
5046
5031
|
|
5047
|
-
/***/ }),
|
5048
|
-
/* 14 */
|
5049
|
-
/***/ (function(module, exports, __w_pdfjs_require__) {
|
5050
|
-
|
5051
|
-
"use strict";
|
5052
|
-
|
5053
|
-
|
5054
|
-
const compatibilityParams = Object.create(null);
|
5055
|
-
{
|
5056
|
-
const userAgent = typeof navigator !== "undefined" && navigator.userAgent || "";
|
5057
|
-
const platform = typeof navigator !== "undefined" && navigator.platform || "";
|
5058
|
-
const maxTouchPoints = typeof navigator !== "undefined" && navigator.maxTouchPoints || 1;
|
5059
|
-
const isAndroid = /Android/.test(userAgent);
|
5060
|
-
const isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1;
|
5061
|
-
|
5062
|
-
(function checkCanvasSizeLimitation() {
|
5063
|
-
if (isIOS || isAndroid) {
|
5064
|
-
compatibilityParams.maxCanvasPixels = 5242880;
|
5065
|
-
}
|
5066
|
-
})();
|
5067
|
-
}
|
5068
|
-
exports.viewerCompatibilityParams = Object.freeze(compatibilityParams);
|
5069
|
-
|
5070
5032
|
/***/ }),
|
5071
5033
|
/* 15 */
|
5072
5034
|
/***/ (function(module, exports, __w_pdfjs_require__) {
|
@@ -5092,8 +5054,8 @@ class PDFSinglePageViewer extends _base_viewer.BaseViewer {
|
|
5092
5054
|
});
|
5093
5055
|
}
|
5094
5056
|
|
5095
|
-
get
|
5096
|
-
return (0, _pdfjsLib.shadow)(this, "
|
5057
|
+
get _viewerElement() {
|
5058
|
+
return (0, _pdfjsLib.shadow)(this, "_viewerElement", this._shadowViewer);
|
5097
5059
|
}
|
5098
5060
|
|
5099
5061
|
_resetView() {
|
@@ -5203,13 +5165,13 @@ exports.BaseViewer = void 0;
|
|
5203
5165
|
|
5204
5166
|
var _ui_utils = __w_pdfjs_require__(3);
|
5205
5167
|
|
5206
|
-
var _pdf_rendering_queue = __w_pdfjs_require__(
|
5168
|
+
var _pdf_rendering_queue = __w_pdfjs_require__(14);
|
5207
5169
|
|
5208
5170
|
var _annotation_layer_builder = __w_pdfjs_require__(1);
|
5209
5171
|
|
5210
5172
|
var _pdfjsLib = __w_pdfjs_require__(2);
|
5211
5173
|
|
5212
|
-
var _pdf_page_view = __w_pdfjs_require__(
|
5174
|
+
var _pdf_page_view = __w_pdfjs_require__(13);
|
5213
5175
|
|
5214
5176
|
var _pdf_link_service = __w_pdfjs_require__(4);
|
5215
5177
|
|
@@ -5276,7 +5238,7 @@ class BaseViewer {
|
|
5276
5238
|
this._name = this.constructor.name;
|
5277
5239
|
this.container = options.container;
|
5278
5240
|
this.viewer = options.viewer || options.container.firstElementChild;
|
5279
|
-
this.eventBus = options.eventBus
|
5241
|
+
this.eventBus = options.eventBus;
|
5280
5242
|
this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService();
|
5281
5243
|
this.downloadManager = options.downloadManager || null;
|
5282
5244
|
this.findController = options.findController || null;
|
@@ -5483,8 +5445,16 @@ class BaseViewer {
|
|
5483
5445
|
return this.pdfDocument ? this._pagesCapability.promise : null;
|
5484
5446
|
}
|
5485
5447
|
|
5486
|
-
get
|
5487
|
-
throw new Error("Not implemented:
|
5448
|
+
get _viewerElement() {
|
5449
|
+
throw new Error("Not implemented: _viewerElement");
|
5450
|
+
}
|
5451
|
+
|
5452
|
+
_onePageRenderedOrForceFetch() {
|
5453
|
+
if (!this.container.offsetParent || this._getVisiblePages().views.length === 0) {
|
5454
|
+
return Promise.resolve();
|
5455
|
+
}
|
5456
|
+
|
5457
|
+
return this._onePageRenderedCapability.promise;
|
5488
5458
|
}
|
5489
5459
|
|
5490
5460
|
setDocument(pdfDocument) {
|
@@ -5551,7 +5521,7 @@ class BaseViewer {
|
|
5551
5521
|
|
5552
5522
|
for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
|
5553
5523
|
const pageView = new _pdf_page_view.PDFPageView({
|
5554
|
-
container: this.
|
5524
|
+
container: this._viewerElement,
|
5555
5525
|
eventBus: this.eventBus,
|
5556
5526
|
id: pageNum,
|
5557
5527
|
scale,
|
@@ -5583,12 +5553,12 @@ class BaseViewer {
|
|
5583
5553
|
this._updateSpreadMode();
|
5584
5554
|
}
|
5585
5555
|
|
5586
|
-
this.
|
5556
|
+
this._onePageRenderedOrForceFetch().then(() => {
|
5587
5557
|
if (this.findController) {
|
5588
5558
|
this.findController.setDocument(pdfDocument);
|
5589
5559
|
}
|
5590
5560
|
|
5591
|
-
if (pdfDocument.loadingParams
|
5561
|
+
if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > 7500) {
|
5592
5562
|
this._pagesCapability.resolve();
|
5593
5563
|
|
5594
5564
|
return;
|
@@ -6318,8 +6288,8 @@ var _base_viewer = __w_pdfjs_require__(16);
|
|
6318
6288
|
var _pdfjsLib = __w_pdfjs_require__(2);
|
6319
6289
|
|
6320
6290
|
class PDFViewer extends _base_viewer.BaseViewer {
|
6321
|
-
get
|
6322
|
-
return (0, _pdfjsLib.shadow)(this, "
|
6291
|
+
get _viewerElement() {
|
6292
|
+
return (0, _pdfjsLib.shadow)(this, "_viewerElement", this.viewer);
|
6323
6293
|
}
|
6324
6294
|
|
6325
6295
|
_scrollIntoView({
|