@vaadin-component-factory/vcf-pdf-viewer 0.9.0 → 1.0.0

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.
Files changed (172) hide show
  1. package/README.md +1 -1
  2. package/package.json +42 -26
  3. package/{src/display → pdfjs/dist}/display_utils.js +344 -139
  4. package/{src/display → pdfjs/dist}/fetch_stream.js +115 -97
  5. package/pdfjs/dist/l10n_utils.js +140 -0
  6. package/{src/shared → pdfjs/dist}/message_handler.js +243 -259
  7. package/{src/display → pdfjs/dist}/network.js +149 -87
  8. package/{src/display/content_disposition.js → pdfjs/dist/network_utils.js} +167 -55
  9. package/{src/display → pdfjs/dist}/node_stream.js +133 -98
  10. package/pdfjs/dist/pdf.js +12778 -0
  11. package/pdfjs/dist/pdf_link_service.js +638 -0
  12. package/pdfjs/dist/pdf_rendering_queue.js +199 -0
  13. package/pdfjs/dist/pdf_thumbnail_viewer.js +819 -0
  14. package/pdfjs/dist/pdf_viewer.js +3598 -0
  15. package/pdfjs/dist/ui_utils.js +1033 -0
  16. package/{src/shared → pdfjs/dist}/util.js +301 -287
  17. package/pdfjs/dist/worker.js +62813 -0
  18. package/src/vcf-pdf-viewer.js +98 -46
  19. package/theme/lumo/vcf-pdf-viewer-styles.js +4 -4
  20. package/theme/material/vcf-pdf-viewer-styles.js +4 -4
  21. package/theme/material/vcf-pdf-viewer.js +2 -2
  22. package/src/core/.eslintrc +0 -13
  23. package/src/core/annotation.js +0 -2948
  24. package/src/core/arithmetic_decoder.js +0 -182
  25. package/src/core/ascii_85_stream.js +0 -98
  26. package/src/core/ascii_hex_stream.js +0 -79
  27. package/src/core/base_stream.js +0 -110
  28. package/src/core/bidi.js +0 -438
  29. package/src/core/calibri_factors.js +0 -308
  30. package/src/core/catalog.js +0 -1459
  31. package/src/core/ccitt.js +0 -1062
  32. package/src/core/ccitt_stream.js +0 -60
  33. package/src/core/cff_font.js +0 -116
  34. package/src/core/cff_parser.js +0 -1949
  35. package/src/core/charsets.js +0 -119
  36. package/src/core/chunked_stream.js +0 -557
  37. package/src/core/cmap.js +0 -1039
  38. package/src/core/colorspace.js +0 -1533
  39. package/src/core/core_utils.js +0 -464
  40. package/src/core/crypto.js +0 -1900
  41. package/src/core/decode_stream.js +0 -170
  42. package/src/core/decrypt_stream.js +0 -59
  43. package/src/core/default_appearance.js +0 -99
  44. package/src/core/document.js +0 -1456
  45. package/src/core/encodings.js +0 -301
  46. package/src/core/evaluator.js +0 -4601
  47. package/src/core/file_spec.js +0 -108
  48. package/src/core/flate_stream.js +0 -402
  49. package/src/core/font_renderer.js +0 -882
  50. package/src/core/fonts.js +0 -3260
  51. package/src/core/fonts_utils.js +0 -221
  52. package/src/core/function.js +0 -1257
  53. package/src/core/glyf.js +0 -706
  54. package/src/core/glyphlist.js +0 -4558
  55. package/src/core/helvetica_factors.js +0 -353
  56. package/src/core/image.js +0 -802
  57. package/src/core/image_utils.js +0 -291
  58. package/src/core/jbig2.js +0 -2572
  59. package/src/core/jbig2_stream.js +0 -73
  60. package/src/core/jpeg_stream.js +0 -105
  61. package/src/core/jpg.js +0 -1416
  62. package/src/core/jpx.js +0 -2343
  63. package/src/core/jpx_stream.js +0 -87
  64. package/src/core/liberationsans_widths.js +0 -221
  65. package/src/core/lzw_stream.js +0 -150
  66. package/src/core/metadata_parser.js +0 -146
  67. package/src/core/metrics.js +0 -2970
  68. package/src/core/murmurhash3.js +0 -139
  69. package/src/core/myriadpro_factors.js +0 -290
  70. package/src/core/name_number_tree.js +0 -153
  71. package/src/core/object_loader.js +0 -149
  72. package/src/core/opentype_file_builder.js +0 -154
  73. package/src/core/operator_list.js +0 -734
  74. package/src/core/parser.js +0 -1416
  75. package/src/core/pattern.js +0 -985
  76. package/src/core/pdf_manager.js +0 -217
  77. package/src/core/predictor_stream.js +0 -238
  78. package/src/core/primitives.js +0 -402
  79. package/src/core/ps_parser.js +0 -272
  80. package/src/core/run_length_stream.js +0 -61
  81. package/src/core/segoeui_factors.js +0 -308
  82. package/src/core/standard_fonts.js +0 -817
  83. package/src/core/stream.js +0 -103
  84. package/src/core/struct_tree.js +0 -335
  85. package/src/core/to_unicode_map.js +0 -103
  86. package/src/core/type1_font.js +0 -421
  87. package/src/core/type1_parser.js +0 -776
  88. package/src/core/unicode.js +0 -1649
  89. package/src/core/worker.js +0 -848
  90. package/src/core/worker_stream.js +0 -135
  91. package/src/core/writer.js +0 -278
  92. package/src/core/xfa/bind.js +0 -652
  93. package/src/core/xfa/builder.js +0 -207
  94. package/src/core/xfa/config.js +0 -1926
  95. package/src/core/xfa/connection_set.js +0 -202
  96. package/src/core/xfa/data.js +0 -82
  97. package/src/core/xfa/datasets.js +0 -76
  98. package/src/core/xfa/factory.js +0 -111
  99. package/src/core/xfa/fonts.js +0 -181
  100. package/src/core/xfa/formcalc_lexer.js +0 -385
  101. package/src/core/xfa/formcalc_parser.js +0 -1340
  102. package/src/core/xfa/html_utils.js +0 -639
  103. package/src/core/xfa/layout.js +0 -383
  104. package/src/core/xfa/locale_set.js +0 -345
  105. package/src/core/xfa/namespaces.js +0 -81
  106. package/src/core/xfa/parser.js +0 -184
  107. package/src/core/xfa/setup.js +0 -38
  108. package/src/core/xfa/signature.js +0 -40
  109. package/src/core/xfa/som.js +0 -338
  110. package/src/core/xfa/stylesheet.js +0 -40
  111. package/src/core/xfa/template.js +0 -6260
  112. package/src/core/xfa/text.js +0 -290
  113. package/src/core/xfa/unknown.js +0 -29
  114. package/src/core/xfa/utils.js +0 -217
  115. package/src/core/xfa/xdp.js +0 -59
  116. package/src/core/xfa/xfa_object.js +0 -1130
  117. package/src/core/xfa/xhtml.js +0 -543
  118. package/src/core/xfa_fonts.js +0 -208
  119. package/src/core/xml_parser.js +0 -507
  120. package/src/core/xref.js +0 -899
  121. package/src/display/annotation_layer.js +0 -2107
  122. package/src/display/annotation_storage.js +0 -113
  123. package/src/display/api.js +0 -3292
  124. package/src/display/base_factory.js +0 -180
  125. package/src/display/canvas.js +0 -2828
  126. package/src/display/font_loader.js +0 -484
  127. package/src/display/metadata.js +0 -41
  128. package/src/display/network_utils.js +0 -100
  129. package/src/display/node_utils.js +0 -83
  130. package/src/display/optional_content_config.js +0 -189
  131. package/src/display/pattern_helper.js +0 -659
  132. package/src/display/svg.js +0 -1709
  133. package/src/display/text_layer.js +0 -847
  134. package/src/display/transport_stream.js +0 -303
  135. package/src/display/worker_options.js +0 -40
  136. package/src/display/xfa_layer.js +0 -204
  137. package/src/doc_helper.js +0 -25
  138. package/src/images/logo.svg +0 -41
  139. package/src/interfaces.js +0 -169
  140. package/src/license_header.js +0 -14
  141. package/src/license_header_libre.js +0 -21
  142. package/src/pdf.image_decoders.js +0 -46
  143. package/src/pdf.js +0 -146
  144. package/src/pdf.sandbox.external.js +0 -181
  145. package/src/pdf.sandbox.js +0 -151
  146. package/src/pdf.scripting.js +0 -25
  147. package/src/pdf.worker.entry.js +0 -19
  148. package/src/pdf.worker.js +0 -23
  149. package/src/scripting_api/aform.js +0 -608
  150. package/src/scripting_api/app.js +0 -621
  151. package/src/scripting_api/color.js +0 -129
  152. package/src/scripting_api/common.js +0 -58
  153. package/src/scripting_api/console.js +0 -38
  154. package/src/scripting_api/constants.js +0 -208
  155. package/src/scripting_api/doc.js +0 -1195
  156. package/src/scripting_api/error.js +0 -23
  157. package/src/scripting_api/event.js +0 -232
  158. package/src/scripting_api/field.js +0 -620
  159. package/src/scripting_api/fullscreen.js +0 -145
  160. package/src/scripting_api/initialization.js +0 -223
  161. package/src/scripting_api/pdf_object.js +0 -24
  162. package/src/scripting_api/print_params.js +0 -146
  163. package/src/scripting_api/proxy.js +0 -139
  164. package/src/scripting_api/thermometer.js +0 -69
  165. package/src/scripting_api/util.js +0 -581
  166. package/src/shared/.eslintrc +0 -13
  167. package/src/shared/cffStandardStrings.js +0 -311
  168. package/src/shared/compatibility.js +0 -114
  169. package/src/shared/fonts_utils.js +0 -429
  170. package/src/shared/is_node.js +0 -27
  171. package/src/shared/scripting_utils.js +0 -85
  172. package/src/worker_loader.js +0 -32
@@ -1,311 +0,0 @@
1
- /* Copyright 2012 Mozilla Foundation
2
- *
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- */
15
-
16
- 'use strict';
17
-
18
- var CFFEncodingMap = {
19
- '0': '-reserved-',
20
- '1': 'hstem',
21
- '2': '-reserved-',
22
- '3': 'vstem',
23
- '4': 'vmoveto',
24
- '5': 'rlineto',
25
- '6': 'hlineto',
26
- '7': 'vlineto',
27
- '8': 'rrcurveto',
28
- '9': '-reserved-',
29
- '10': 'callsubr',
30
- '11': 'return',
31
- '12': {
32
- '3': 'and',
33
- '4': 'or',
34
- '5': 'not',
35
- '9': 'abs',
36
- '10': 'add',
37
- '11': 'div',
38
- '12': 'sub',
39
- '14': 'neg',
40
- '15': 'eq',
41
- '18': 'drop',
42
- '20': 'put',
43
- '21': 'get',
44
- '22': 'ifelse',
45
- '23': 'random',
46
- '24': 'mul',
47
- '26': 'sqrt',
48
- '27': 'dup',
49
- '28': 'exch',
50
- '29': 'index',
51
- '30': 'roll',
52
- '34': 'hflex',
53
- '35': 'flex',
54
- '36': 'hflex1',
55
- '37': 'flex1'
56
- },
57
- '13': '-reserved-',
58
- '14': 'endchar',
59
- '15': '-reserved-',
60
- '16': '-reserved-',
61
- '17': '-reserved-',
62
- '18': 'hstemhm',
63
- '19': 'hintmask',
64
- '20': 'cntrmask',
65
- '21': 'rmoveto',
66
- '22': 'hmoveto',
67
- '23': 'vstemhm',
68
- '24': 'rcurveline',
69
- '25': 'rlivecurve',
70
- '26': 'vvcurveto',
71
- '27': 'hhcurveto',
72
- '29': 'callgsubr',
73
- '30': 'vhcurveto',
74
- '31': 'hvcurveto'
75
- };
76
-
77
- var CFFDictDataMap = {
78
- '0': {
79
- name: 'version',
80
- operand: 'SID'
81
- },
82
- '1': {
83
- name: 'Notice',
84
- operand: 'SID'
85
- },
86
- '2': {
87
- name: 'FullName',
88
- operand: 'SID'
89
- },
90
- '3': {
91
- name: 'FamilyName',
92
- operand: 'SID'
93
- },
94
- '4': {
95
- name: 'Weight',
96
- operand: 'SID'
97
- },
98
- '5': {
99
- name: 'FontBBox',
100
- operand: [0, 0, 0, 0]
101
- },
102
- '6': {
103
- name: 'BlueValues'
104
- },
105
- '7': {
106
- name: 'OtherBlues'
107
- },
108
- '8': {
109
- name: 'FamilyBlues'
110
- },
111
- '9': {
112
- name: 'FamilyOtherBlues'
113
- },
114
- '10': {
115
- name: 'StdHW'
116
- },
117
- '11': {
118
- name: 'StdVW'
119
- },
120
- '12': {
121
- '0': {
122
- name: 'Copyright',
123
- operand: 'SID'
124
- },
125
- '1': {
126
- name: 'IsFixedPitch',
127
- operand: false
128
- },
129
- '2': {
130
- name: 'ItalicAngle',
131
- operand: 0
132
- },
133
- '3': {
134
- name: 'UnderlinePosition',
135
- operand: -100
136
- },
137
- '4': {
138
- name: 'UnderlineThickness',
139
- operand: 50
140
- },
141
- '5': {
142
- name: 'PaintType',
143
- operand: 0
144
- },
145
- '6': {
146
- name: 'CharstringType',
147
- operand: 2
148
- },
149
- '7': {
150
- name: 'FontMatrix',
151
- operand: [0.001, 0, 0, 0.001, 0, 0]
152
- },
153
- '8': {
154
- name: 'StrokeWidth',
155
- operand: 0
156
- },
157
- '9': {
158
- name: 'BlueScale'
159
- },
160
- '10': {
161
- name: 'BlueShift'
162
- },
163
- '11': {
164
- name: 'BlueFuzz'
165
- },
166
- '12': {
167
- name: 'StemSnapH'
168
- },
169
- '13': {
170
- name: 'StemSnapV'
171
- },
172
- '14': {
173
- name: 'ForceBold'
174
- },
175
- '17': {
176
- name: 'LanguageGroup'
177
- },
178
- '18': {
179
- name: 'ExpansionFactor'
180
- },
181
- '19': {
182
- name: 'initialRandomSeed'
183
- },
184
- '20': {
185
- name: 'SyntheticBase',
186
- operand: null
187
- },
188
- '21': {
189
- name: 'PostScript',
190
- operand: 'SID'
191
- },
192
- '22': {
193
- name: 'BaseFontName',
194
- operand: 'SID'
195
- },
196
- '23': {
197
- name: 'BaseFontBlend',
198
- operand: 'delta'
199
- }
200
- },
201
- '13': {
202
- name: 'UniqueID',
203
- operand: null
204
- },
205
- '14': {
206
- name: 'XUID',
207
- operand: []
208
- },
209
- '15': {
210
- name: 'charset',
211
- operand: 0
212
- },
213
- '16': {
214
- name: 'Encoding',
215
- operand: 0
216
- },
217
- '17': {
218
- name: 'CharStrings',
219
- operand: null
220
- },
221
- '18': {
222
- name: 'Private',
223
- operand: 'number number'
224
- },
225
- '19': {
226
- name: 'Subrs'
227
- },
228
- '20': {
229
- name: 'defaultWidthX'
230
- },
231
- '21': {
232
- name: 'nominalWidthX'
233
- }
234
- };
235
-
236
- var CFFDictPrivateDataMap = {
237
- '6': {
238
- name: 'BluesValues',
239
- operand: 'delta'
240
- },
241
- '7': {
242
- name: 'OtherBlues',
243
- operand: 'delta'
244
- },
245
- '8': {
246
- name: 'FamilyBlues',
247
- operand: 'delta'
248
- },
249
- '9': {
250
- name: 'FamilyOtherBlues',
251
- operand: 'delta'
252
- },
253
- '10': {
254
- name: 'StdHW',
255
- operand: null
256
- },
257
- '11': {
258
- name: 'StdVW',
259
- operand: null
260
- },
261
- '12': {
262
- '9': {
263
- name: 'BlueScale',
264
- operand: 0.039625
265
- },
266
- '10': {
267
- name: 'BlueShift',
268
- operand: 7
269
- },
270
- '11': {
271
- name: 'BlueFuzz',
272
- operand: 1
273
- },
274
- '12': {
275
- name: 'StemSnapH',
276
- operand: 'delta'
277
- },
278
- '13': {
279
- name: 'StemSnapV',
280
- operand: 'delta'
281
- },
282
- '14': {
283
- name: 'ForceBold',
284
- operand: 'boolean'
285
- },
286
- '17': {
287
- name: 'LanguageGroup',
288
- operand: 0
289
- },
290
- '18': {
291
- name: 'ExpansionFactor',
292
- operand: 0.06
293
- },
294
- '19': {
295
- name: 'initialRandomSeed',
296
- operand: 0
297
- }
298
- },
299
- '19': {
300
- name: 'Subrs',
301
- operand: null
302
- },
303
- '20': {
304
- name: 'defaultWidthX',
305
- operand: 0
306
- },
307
- '21': {
308
- name: 'nominalWidthX',
309
- operand: 0
310
- }
311
- };
@@ -1,114 +0,0 @@
1
- /* Copyright 2017 Mozilla Foundation
2
- *
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- */
15
-
16
- import { isNodeJS } from "./is_node.js";
17
-
18
- // Skip compatibility checks for modern builds and if we already ran the module.
19
- if (
20
- (typeof PDFJSDev === "undefined" || !PDFJSDev.test("SKIP_BABEL")) &&
21
- (typeof globalThis === "undefined" || !globalThis._pdfjsCompatibilityChecked)
22
- ) {
23
- // Provides support for globalThis in legacy browsers.
24
- // Support: Firefox<65, Chrome<71, Safari<12.1
25
- if (typeof globalThis === "undefined" || globalThis.Math !== Math) {
26
- // eslint-disable-next-line no-global-assign
27
- globalThis = require("core-js/es/global-this");
28
- }
29
- globalThis._pdfjsCompatibilityChecked = true;
30
-
31
- // Support: Node.js
32
- (function checkNodeBtoa() {
33
- if (globalThis.btoa || !isNodeJS) {
34
- return;
35
- }
36
- globalThis.btoa = function (chars) {
37
- // eslint-disable-next-line no-undef
38
- return Buffer.from(chars, "binary").toString("base64");
39
- };
40
- })();
41
-
42
- // Support: Node.js
43
- (function checkNodeAtob() {
44
- if (globalThis.atob || !isNodeJS) {
45
- return;
46
- }
47
- globalThis.atob = function (input) {
48
- // eslint-disable-next-line no-undef
49
- return Buffer.from(input, "base64").toString("binary");
50
- };
51
- })();
52
-
53
- // Support: Node.js
54
- (function checkDOMMatrix() {
55
- if (globalThis.DOMMatrix || !isNodeJS) {
56
- return;
57
- }
58
- globalThis.DOMMatrix = require("dommatrix/dist/dommatrix.js");
59
- })();
60
-
61
- // Provides support for Object.fromEntries in legacy browsers.
62
- // Support: Firefox<63, Chrome<73, Safari<12.1, Node.js<12.0.0
63
- (function checkObjectFromEntries() {
64
- if (Object.fromEntries) {
65
- return;
66
- }
67
- require("core-js/es/object/from-entries.js");
68
- })();
69
-
70
- // Provides support for *recent* additions to the Promise specification,
71
- // however basic Promise support is assumed to be available natively.
72
- // Support: Firefox<71, Chrome<76, Safari<13, Node.js<12.9.0
73
- (function checkPromise() {
74
- if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("IMAGE_DECODERS")) {
75
- // The current image decoders are synchronous, hence `Promise` shouldn't
76
- // need to be polyfilled for the IMAGE_DECODERS build target.
77
- return;
78
- }
79
- if (globalThis.Promise.allSettled) {
80
- return;
81
- }
82
- globalThis.Promise = require("core-js/es/promise/index.js");
83
- })();
84
-
85
- // Support: Node.js
86
- (function checkReadableStream() {
87
- if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("IMAGE_DECODERS")) {
88
- // The current image decoders are synchronous, hence `ReadableStream`
89
- // shouldn't need to be polyfilled for the IMAGE_DECODERS build target.
90
- return;
91
- }
92
- let isReadableStreamSupported = false;
93
-
94
- if (typeof ReadableStream !== "undefined") {
95
- // MS Edge may say it has ReadableStream but they are not up to spec yet.
96
- try {
97
- // eslint-disable-next-line no-new
98
- new ReadableStream({
99
- start(controller) {
100
- controller.close();
101
- },
102
- });
103
- isReadableStreamSupported = true;
104
- } catch (e) {
105
- // The ReadableStream constructor cannot be used.
106
- }
107
- }
108
- if (isReadableStreamSupported) {
109
- return;
110
- }
111
- globalThis.ReadableStream =
112
- require("web-streams-polyfill/dist/ponyfill.js").ReadableStream;
113
- })();
114
- }