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
@@ -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/display/canvas.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.
|
@@ -318,7 +318,10 @@ function compileType3Glyph(imgData) {
|
|
318
318
|
|
319
319
|
coords.push(p % width1);
|
320
320
|
coords.push(p / width1 | 0);
|
321
|
-
|
321
|
+
|
322
|
+
if (!points[p]) {
|
323
|
+
--count;
|
324
|
+
}
|
322
325
|
} while (p0 !== p);
|
323
326
|
|
324
327
|
outlines.push(coords);
|
@@ -762,16 +765,32 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
|
|
762
765
|
if (fnId !== _util.OPS.dependency) {
|
763
766
|
this[fnId].apply(this, argsArray[i]);
|
764
767
|
} else {
|
765
|
-
var
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
var
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
768
|
+
var _iteratorNormalCompletion = true;
|
769
|
+
var _didIteratorError = false;
|
770
|
+
var _iteratorError = undefined;
|
771
|
+
|
772
|
+
try {
|
773
|
+
for (var _iterator = argsArray[i][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
774
|
+
var depObjId = _step.value;
|
775
|
+
var objsPool = depObjId.startsWith('g_') ? commonObjs : objs;
|
776
|
+
|
777
|
+
if (!objsPool.has(depObjId)) {
|
778
|
+
objsPool.get(depObjId, continueCallback);
|
779
|
+
return i;
|
780
|
+
}
|
781
|
+
}
|
782
|
+
} catch (err) {
|
783
|
+
_didIteratorError = true;
|
784
|
+
_iteratorError = err;
|
785
|
+
} finally {
|
786
|
+
try {
|
787
|
+
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
788
|
+
_iterator["return"]();
|
789
|
+
}
|
790
|
+
} finally {
|
791
|
+
if (_didIteratorError) {
|
792
|
+
throw _iteratorError;
|
793
|
+
}
|
775
794
|
}
|
776
795
|
}
|
777
796
|
}
|
@@ -836,8 +855,8 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
|
|
836
855
|
ctx.lineDashOffset = dashPhase;
|
837
856
|
}
|
838
857
|
},
|
839
|
-
setRenderingIntent: function
|
840
|
-
setFlatness: function
|
858
|
+
setRenderingIntent: function setRenderingIntent(intent) {},
|
859
|
+
setFlatness: function setFlatness(flatness) {},
|
841
860
|
setGState: function CanvasGraphics_setGState(states) {
|
842
861
|
for (var i = 0, ii = states.length; i < ii; i++) {
|
843
862
|
var state = states[i];
|
@@ -1318,7 +1337,9 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
|
|
1318
1337
|
},
|
1319
1338
|
|
1320
1339
|
get isFontSubpixelAAEnabled() {
|
1321
|
-
var
|
1340
|
+
var _this$cachedCanvases$ = this.cachedCanvases.getCanvas('isFontSubpixelAAEnabled', 10, 10),
|
1341
|
+
ctx = _this$cachedCanvases$.context;
|
1342
|
+
|
1322
1343
|
ctx.scale(1.5, 1);
|
1323
1344
|
ctx.fillText('I', 0, 10);
|
1324
1345
|
var data = ctx.getImageData(0, 0, 10, 10).data;
|
@@ -1345,7 +1366,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
|
|
1345
1366
|
var fontSize = current.fontSize;
|
1346
1367
|
|
1347
1368
|
if (fontSize === 0) {
|
1348
|
-
return;
|
1369
|
+
return undefined;
|
1349
1370
|
}
|
1350
1371
|
|
1351
1372
|
var ctx = this.ctx;
|
@@ -1771,7 +1792,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
|
|
1771
1792
|
this.restore();
|
1772
1793
|
},
|
1773
1794
|
paintJpegXObject: function CanvasGraphics_paintJpegXObject(objId, w, h) {
|
1774
|
-
var domImage = this.objs.get(objId);
|
1795
|
+
var domImage = this.processingType3 ? this.commonObjs.get(objId) : this.objs.get(objId);
|
1775
1796
|
|
1776
1797
|
if (!domImage) {
|
1777
1798
|
(0, _util.warn)('Dependent image isn\'t ready yet');
|
@@ -1880,7 +1901,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
|
|
1880
1901
|
}
|
1881
1902
|
},
|
1882
1903
|
paintImageXObject: function CanvasGraphics_paintImageXObject(objId) {
|
1883
|
-
var imgData = this.objs.get(objId);
|
1904
|
+
var imgData = this.processingType3 ? this.commonObjs.get(objId) : this.objs.get(objId);
|
1884
1905
|
|
1885
1906
|
if (!imgData) {
|
1886
1907
|
(0, _util.warn)('Dependent image isn\'t ready yet');
|
@@ -1890,7 +1911,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
|
|
1890
1911
|
this.paintInlineImageXObject(imgData);
|
1891
1912
|
},
|
1892
1913
|
paintImageXObjectRepeat: function CanvasGraphics_paintImageXObjectRepeat(objId, scaleX, scaleY, positions) {
|
1893
|
-
var imgData = this.objs.get(objId);
|
1914
|
+
var imgData = this.processingType3 ? this.commonObjs.get(objId) : this.objs.get(objId);
|
1894
1915
|
|
1895
1916
|
if (!imgData) {
|
1896
1917
|
(0, _util.warn)('Dependent image isn\'t ready yet');
|
@@ -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.
|