pdfjs-dist 2.6.347 → 2.7.570

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.

Files changed (158) hide show
  1. package/README.md +3 -3
  2. package/bower.json +1 -1
  3. package/build/pdf.js +2050 -1087
  4. package/build/pdf.js.map +1 -1
  5. package/build/pdf.min.js +1 -1
  6. package/build/pdf.worker.js +18219 -10436
  7. package/build/pdf.worker.js.map +1 -1
  8. package/build/pdf.worker.min.js +1 -1
  9. package/es5/build/pdf.d.ts +1 -0
  10. package/es5/build/pdf.js +6623 -6654
  11. package/es5/build/pdf.js.map +1 -1
  12. package/es5/build/pdf.min.js +1 -1
  13. package/es5/build/pdf.worker.js +20815 -13888
  14. package/es5/build/pdf.worker.js.map +1 -1
  15. package/es5/build/pdf.worker.min.js +1 -1
  16. package/es5/image_decoders/pdf.image_decoders.js +3817 -4946
  17. package/es5/image_decoders/pdf.image_decoders.js.map +1 -1
  18. package/es5/image_decoders/pdf.image_decoders.min.js +1 -1
  19. package/es5/web/pdf_viewer.css +18 -15
  20. package/es5/web/pdf_viewer.js +1094 -514
  21. package/es5/web/pdf_viewer.js.map +1 -1
  22. package/image_decoders/pdf.image_decoders.js +774 -168
  23. package/image_decoders/pdf.image_decoders.js.map +1 -1
  24. package/image_decoders/pdf.image_decoders.min.js +1 -1
  25. package/lib/core/annotation.js +556 -108
  26. package/lib/core/cff_parser.js +7 -1
  27. package/lib/core/charsets.js +1 -1
  28. package/lib/core/cmap.js +20 -1
  29. package/lib/core/core_utils.js +162 -3
  30. package/lib/core/crypto.js +1 -1
  31. package/lib/core/default_appearance.js +132 -0
  32. package/lib/core/document.js +115 -9
  33. package/lib/core/encodings.js +1 -1
  34. package/lib/core/evaluator.js +168 -74
  35. package/lib/core/fonts.js +97 -11
  36. package/lib/core/function.js +5 -10
  37. package/lib/core/glyphlist.js +11 -4529
  38. package/lib/core/image_utils.js +30 -1
  39. package/lib/core/jpg.js +1 -1
  40. package/lib/core/jpx.js +5 -5
  41. package/lib/core/murmurhash3.js +1 -1
  42. package/lib/core/obj.js +123 -39
  43. package/lib/core/pattern.js +4 -4
  44. package/lib/core/primitives.js +24 -5
  45. package/lib/core/standard_fonts.js +1 -1
  46. package/lib/core/stream.js +5 -1
  47. package/lib/core/unicode.js +15 -1387
  48. package/lib/core/worker.js +58 -17
  49. package/lib/core/writer.js +68 -4
  50. package/lib/display/annotation_layer.js +712 -119
  51. package/lib/display/annotation_storage.js +21 -4
  52. package/lib/display/api.js +88 -18
  53. package/lib/display/canvas.js +414 -375
  54. package/lib/display/display_utils.js +11 -4
  55. package/lib/display/fetch_stream.js +3 -3
  56. package/lib/display/font_loader.js +2 -3
  57. package/lib/display/metadata.js +54 -20
  58. package/lib/display/node_stream.js +1 -1
  59. package/lib/display/optional_content_config.js +1 -1
  60. package/lib/display/pattern_helper.js +109 -113
  61. package/lib/display/svg.js +5 -5
  62. package/lib/display/text_layer.js +54 -54
  63. package/lib/display/transport_stream.js +4 -4
  64. package/lib/display/webgl.js +65 -68
  65. package/lib/examples/node/domstubs.js +9 -4
  66. package/lib/pdf.js +2 -2
  67. package/lib/pdf.sandbox.js +311 -0
  68. package/lib/pdf.worker.js +2 -2
  69. package/lib/shared/scripting_utils.js +84 -0
  70. package/lib/shared/util.js +129 -14
  71. package/lib/{display → shared}/xml_parser.js +112 -4
  72. package/lib/test/unit/annotation_spec.js +831 -109
  73. package/lib/test/unit/annotation_storage_spec.js +28 -10
  74. package/lib/test/unit/api_spec.js +190 -160
  75. package/lib/test/unit/bidi_spec.js +6 -6
  76. package/lib/test/unit/cff_parser_spec.js +73 -73
  77. package/lib/test/unit/clitests_helper.js +2 -0
  78. package/lib/test/unit/cmap_spec.js +48 -74
  79. package/lib/test/unit/core_utils_spec.js +34 -0
  80. package/lib/test/unit/crypto_spec.js +162 -199
  81. package/lib/test/unit/custom_spec.js +7 -18
  82. package/lib/test/unit/default_appearance_spec.js +54 -0
  83. package/lib/test/unit/display_svg_spec.js +24 -19
  84. package/lib/test/unit/display_utils_spec.js +1 -1
  85. package/lib/test/unit/document_spec.js +187 -20
  86. package/lib/test/unit/evaluator_spec.js +30 -30
  87. package/lib/test/unit/function_spec.js +165 -165
  88. package/lib/test/unit/jasmine-boot.js +52 -53
  89. package/lib/test/unit/metadata_spec.js +2 -2
  90. package/lib/test/unit/murmurhash3_spec.js +29 -16
  91. package/lib/test/unit/network_spec.js +21 -21
  92. package/lib/test/unit/pdf_find_controller_spec.js +131 -69
  93. package/lib/test/unit/pdf_find_utils_spec.js +10 -10
  94. package/lib/test/unit/scripting_spec.js +1104 -0
  95. package/lib/test/unit/stream_spec.js +8 -8
  96. package/lib/test/unit/test_utils.js +16 -19
  97. package/lib/test/unit/testreporter.js +11 -4
  98. package/lib/test/unit/type1_parser_spec.js +23 -23
  99. package/lib/test/unit/ui_utils_spec.js +78 -35
  100. package/lib/test/unit/unicode_spec.js +7 -7
  101. package/lib/test/unit/util_spec.js +26 -3
  102. package/lib/test/unit/writer_spec.js +16 -1
  103. package/lib/test/unit/xml_spec.js +117 -0
  104. package/lib/web/annotation_layer_builder.js +18 -6
  105. package/lib/web/app.js +579 -161
  106. package/lib/web/app_options.js +14 -0
  107. package/lib/web/base_tree_viewer.js +50 -0
  108. package/lib/web/base_viewer.js +350 -14
  109. package/lib/web/chromecom.js +9 -1
  110. package/lib/web/debugger.js +1 -2
  111. package/lib/web/download_manager.js +0 -15
  112. package/lib/web/firefox_print_service.js +6 -4
  113. package/lib/web/firefoxcom.js +84 -69
  114. package/lib/web/generic_scripting.js +55 -0
  115. package/lib/web/genericcom.js +9 -1
  116. package/lib/web/grab_to_pan.js +1 -1
  117. package/lib/web/interfaces.js +9 -3
  118. package/lib/web/pdf_attachment_viewer.js +1 -3
  119. package/lib/web/pdf_cursor_tools.js +20 -13
  120. package/lib/web/pdf_document_properties.js +48 -61
  121. package/lib/web/pdf_find_bar.js +1 -3
  122. package/lib/web/pdf_find_controller.js +58 -12
  123. package/lib/web/pdf_history.js +43 -21
  124. package/lib/web/pdf_layer_viewer.js +1 -9
  125. package/lib/web/pdf_link_service.js +108 -78
  126. package/lib/web/pdf_outline_viewer.js +166 -10
  127. package/lib/web/pdf_page_view.js +14 -14
  128. package/lib/web/pdf_presentation_mode.js +21 -31
  129. package/lib/web/pdf_rendering_queue.js +8 -1
  130. package/lib/web/pdf_sidebar.js +62 -107
  131. package/lib/web/pdf_sidebar_resizer.js +11 -21
  132. package/lib/web/pdf_single_page_viewer.js +8 -0
  133. package/lib/web/pdf_thumbnail_view.js +26 -26
  134. package/lib/web/pdf_thumbnail_viewer.js +13 -2
  135. package/lib/web/pdf_viewer.component.js +2 -2
  136. package/lib/web/pdf_viewer.js +3 -1
  137. package/lib/web/preferences.js +33 -44
  138. package/lib/web/text_layer_builder.js +2 -9
  139. package/lib/web/ui_utils.js +78 -46
  140. package/lib/web/viewer_compatibility.js +1 -2
  141. package/package.json +4 -1
  142. package/types/display/annotation_layer.d.ts +18 -3
  143. package/types/display/api.d.ts +110 -54
  144. package/types/display/canvas.d.ts +1 -1
  145. package/types/display/display_utils.d.ts +96 -95
  146. package/types/display/fetch_stream.d.ts +2 -2
  147. package/types/display/metadata.d.ts +4 -0
  148. package/types/display/pattern_helper.d.ts +1 -1
  149. package/types/display/text_layer.d.ts +7 -7
  150. package/types/display/transport_stream.d.ts +1 -1
  151. package/types/shared/scripting_utils.d.ts +12 -0
  152. package/types/shared/util.d.ts +281 -250
  153. package/types/shared/xml_parser.d.ts +64 -0
  154. package/web/pdf_viewer.css +18 -15
  155. package/web/pdf_viewer.js +809 -408
  156. package/web/pdf_viewer.js.map +1 -1
  157. package/webpack.js +1 -1
  158. package/types/display/xml_parser.d.ts +0 -35
@@ -19,160 +19,56 @@ export type PromiseCapability = {
19
19
  */
20
20
  reject: Function;
21
21
  };
22
+ declare const AbortException_base: any;
22
23
  /**
23
- * @type {any}
24
+ * Error used to indicate task cancellation.
24
25
  */
25
- export const BaseException: any;
26
- export const FONT_IDENTITY_MATRIX: number[];
27
- export const IDENTITY_MATRIX: number[];
28
- export namespace OPS {
29
- export const dependency: number;
30
- export const setLineWidth: number;
31
- export const setLineCap: number;
32
- export const setLineJoin: number;
33
- export const setMiterLimit: number;
34
- export const setDash: number;
35
- export const setRenderingIntent: number;
36
- export const setFlatness: number;
37
- export const setGState: number;
38
- export const save: number;
39
- export const restore: number;
40
- export const transform: number;
41
- export const moveTo: number;
42
- export const lineTo: number;
43
- export const curveTo: number;
44
- export const curveTo2: number;
45
- export const curveTo3: number;
46
- export const closePath: number;
47
- export const rectangle: number;
48
- export const stroke: number;
49
- export const closeStroke: number;
50
- export const fill: number;
51
- export const eoFill: number;
52
- export const fillStroke: number;
53
- export const eoFillStroke: number;
54
- export const closeFillStroke: number;
55
- export const closeEOFillStroke: number;
56
- export const endPath: number;
57
- export const clip: number;
58
- export const eoClip: number;
59
- export const beginText: number;
60
- export const endText: number;
61
- export const setCharSpacing: number;
62
- export const setWordSpacing: number;
63
- export const setHScale: number;
64
- export const setLeading: number;
65
- export const setFont: number;
66
- export const setTextRenderingMode: number;
67
- export const setTextRise: number;
68
- export const moveText: number;
69
- export const setLeadingMoveText: number;
70
- export const setTextMatrix: number;
71
- export const nextLine: number;
72
- export const showText: number;
73
- export const showSpacedText: number;
74
- export const nextLineShowText: number;
75
- export const nextLineSetSpacingShowText: number;
76
- export const setCharWidth: number;
77
- export const setCharWidthAndBounds: number;
78
- export const setStrokeColorSpace: number;
79
- export const setFillColorSpace: number;
80
- export const setStrokeColor: number;
81
- export const setStrokeColorN: number;
82
- export const setFillColor: number;
83
- export const setFillColorN: number;
84
- export const setStrokeGray: number;
85
- export const setFillGray: number;
86
- export const setStrokeRGBColor: number;
87
- export const setFillRGBColor: number;
88
- export const setStrokeCMYKColor: number;
89
- export const setFillCMYKColor: number;
90
- export const shadingFill: number;
91
- export const beginInlineImage: number;
92
- export const beginImageData: number;
93
- export const endInlineImage: number;
94
- export const paintXObject: number;
95
- export const markPoint: number;
96
- export const markPointProps: number;
97
- export const beginMarkedContent: number;
98
- export const beginMarkedContentProps: number;
99
- export const endMarkedContent: number;
100
- export const beginCompat: number;
101
- export const endCompat: number;
102
- export const paintFormXObjectBegin: number;
103
- export const paintFormXObjectEnd: number;
104
- export const beginGroup: number;
105
- export const endGroup: number;
106
- export const beginAnnotations: number;
107
- export const endAnnotations: number;
108
- export const beginAnnotation: number;
109
- export const endAnnotation: number;
110
- export const paintJpegXObject: number;
111
- export const paintImageMaskXObject: number;
112
- export const paintImageMaskXObjectGroup: number;
113
- export const paintImageXObject: number;
114
- export const paintInlineImageXObject: number;
115
- export const paintInlineImageXObjectGroup: number;
116
- export const paintImageXObjectRepeat: number;
117
- export const paintImageMaskXObjectRepeat: number;
118
- export const paintSolidColorImageMask: number;
119
- export const constructPath: number;
26
+ export class AbortException extends AbortException_base {
27
+ [x: string]: any;
120
28
  }
121
- export namespace VerbosityLevel {
122
- export const ERRORS: number;
123
- export const WARNINGS: number;
124
- export const INFOS: number;
29
+ export namespace AnnotationActionEventType {
30
+ const E: string;
31
+ const X: string;
32
+ const D: string;
33
+ const U: string;
34
+ const Fo: string;
35
+ const Bl: string;
36
+ const PO: string;
37
+ const PC: string;
38
+ const PV: string;
39
+ const PI: string;
40
+ const K: string;
41
+ const F: string;
42
+ const V: string;
43
+ const C: string;
125
44
  }
126
- export const UNSUPPORTED_FEATURES: {
127
- /** @deprecated unused */
128
- unknown: string;
129
- forms: string;
130
- javaScript: string;
131
- smask: string;
132
- shadingPattern: string;
133
- /** @deprecated unused */
134
- font: string;
135
- errorTilingPattern: string;
136
- errorExtGState: string;
137
- errorXObject: string;
138
- errorFontLoadType3: string;
139
- errorFontState: string;
140
- errorFontMissing: string;
141
- errorFontTranslate: string;
142
- errorColorSpace: string;
143
- errorOperatorList: string;
144
- errorFontToUnicode: string;
145
- errorFontLoadNative: string;
146
- errorFontGetPath: string;
147
- errorMarkedContent: string;
148
- };
149
45
  export namespace AnnotationBorderStyleType {
150
- export const SOLID: number;
151
- export const DASHED: number;
152
- export const BEVELED: number;
153
- export const INSET: number;
154
- export const UNDERLINE: number;
46
+ const SOLID: number;
47
+ const DASHED: number;
48
+ const BEVELED: number;
49
+ const INSET: number;
50
+ const UNDERLINE: number;
155
51
  }
156
52
  export namespace AnnotationFieldFlag {
157
- export const READONLY: number;
158
- export const REQUIRED: number;
159
- export const NOEXPORT: number;
160
- export const MULTILINE: number;
161
- export const PASSWORD: number;
162
- export const NOTOGGLETOOFF: number;
163
- export const RADIO: number;
164
- export const PUSHBUTTON: number;
165
- export const COMBO: number;
166
- export const EDIT: number;
167
- export const SORT: number;
168
- export const FILESELECT: number;
169
- export const MULTISELECT: number;
170
- export const DONOTSPELLCHECK: number;
171
- export const DONOTSCROLL: number;
172
- export const COMB: number;
173
- export const RICHTEXT: number;
174
- export const RADIOSINUNISON: number;
175
- export const COMMITONSELCHANGE: number;
53
+ const READONLY: number;
54
+ const REQUIRED: number;
55
+ const NOEXPORT: number;
56
+ const MULTILINE: number;
57
+ const PASSWORD: number;
58
+ const NOTOGGLETOOFF: number;
59
+ const RADIO: number;
60
+ const PUSHBUTTON: number;
61
+ const COMBO: number;
62
+ const EDIT: number;
63
+ const SORT: number;
64
+ const FILESELECT: number;
65
+ const MULTISELECT: number;
66
+ const DONOTSPELLCHECK: number;
67
+ const DONOTSCROLL: number;
68
+ const COMB: number;
69
+ const RICHTEXT: number;
70
+ const RADIOSINUNISON: number;
71
+ const COMMITONSELCHANGE: number;
176
72
  }
177
73
  export namespace AnnotationFlag {
178
74
  export const INVISIBLE: number;
@@ -188,19 +84,19 @@ export namespace AnnotationFlag {
188
84
  export const LOCKEDCONTENTS: number;
189
85
  }
190
86
  export namespace AnnotationMarkedState {
191
- export const MARKED: string;
192
- export const UNMARKED: string;
87
+ const MARKED: string;
88
+ const UNMARKED: string;
193
89
  }
194
90
  export namespace AnnotationReplyType {
195
- export const GROUP: string;
196
- export const REPLY: string;
91
+ const GROUP: string;
92
+ const REPLY: string;
197
93
  }
198
94
  export namespace AnnotationReviewState {
199
- export const ACCEPTED: string;
200
- export const REJECTED: string;
201
- export const CANCELLED: string;
202
- export const COMPLETED: string;
203
- export const NONE: string;
95
+ const ACCEPTED: string;
96
+ const REJECTED: string;
97
+ const CANCELLED: string;
98
+ const COMPLETED: string;
99
+ const NONE: string;
204
100
  }
205
101
  export namespace AnnotationStateModelType {
206
102
  const MARKED_1: string;
@@ -236,45 +132,212 @@ export namespace AnnotationType {
236
132
  export const THREED: number;
237
133
  export const REDACT: number;
238
134
  }
239
- export namespace FontType {
240
- export const UNKNOWN: string;
241
- export const TYPE1: string;
242
- export const TYPE1C: string;
243
- export const CIDFONTTYPE0: string;
244
- export const CIDFONTTYPE0C: string;
245
- export const TRUETYPE: string;
246
- export const CIDFONTTYPE2: string;
247
- export const TYPE3: string;
248
- export const OPENTYPE: string;
249
- export const TYPE0: string;
250
- export const MMTYPE1: string;
251
- }
252
- export namespace ImageKind {
253
- export const GRAYSCALE_1BPP: number;
254
- export const RGB_24BPP: number;
255
- export const RGBA_32BPP: number;
256
- }
135
+ /**
136
+ * Gets length of the array (Array, Uint8Array, or string) in bytes.
137
+ * @param {Array<any>|Uint8Array|string} arr
138
+ * @returns {number}
139
+ */
140
+ export function arrayByteLength(arr: Array<any> | Uint8Array | string): number;
141
+ /**
142
+ * Combines array items (arrays) into single Uint8Array object.
143
+ * @param {Array<Array<any>|Uint8Array|string>} arr - the array of the arrays
144
+ * (Array, Uint8Array, or string).
145
+ * @returns {Uint8Array}
146
+ */
147
+ export function arraysToBytes(arr: Array<Array<any> | Uint8Array | string>): Uint8Array;
148
+ export function assert(cond: any, msg: any): void;
149
+ /**
150
+ * @type {any}
151
+ */
152
+ export const BaseException: any;
153
+ export function bytesToString(bytes: any): string;
257
154
  export namespace CMapCompressionType {
258
155
  const NONE_1: number;
259
156
  export { NONE_1 as NONE };
260
157
  export const BINARY: number;
261
158
  export const STREAM: number;
262
159
  }
263
- declare const AbortException_base: any;
160
+ export function createObjectURL(data: any, contentType: any, forceDataSchema?: boolean): string;
264
161
  /**
265
- * Error used to indicate task cancellation.
162
+ * Promise Capability object.
163
+ *
164
+ * @typedef {Object} PromiseCapability
165
+ * @property {Promise<any>} promise - A Promise object.
166
+ * @property {boolean} settled - If the Promise has been fulfilled/rejected.
167
+ * @property {function} resolve - Fulfills the Promise.
168
+ * @property {function} reject - Rejects the Promise.
266
169
  */
267
- export class AbortException extends AbortException_base {
170
+ /**
171
+ * Creates a promise capability object.
172
+ * @alias createPromiseCapability
173
+ *
174
+ * @returns {PromiseCapability}
175
+ */
176
+ export function createPromiseCapability(): PromiseCapability;
177
+ /**
178
+ * Attempts to create a valid absolute URL.
179
+ *
180
+ * @param {URL|string} url - An absolute, or relative, URL.
181
+ * @param {URL|string} baseUrl - An absolute URL.
182
+ * @returns Either a valid {URL}, or `null` otherwise.
183
+ */
184
+ export function createValidAbsoluteUrl(url: URL | string, baseUrl: URL | string): URL | null;
185
+ export namespace DocumentActionEventType {
186
+ const WC: string;
187
+ const WS: string;
188
+ const DS: string;
189
+ const WP: string;
190
+ const DP: string;
191
+ }
192
+ export function encodeToXmlString(str: any): any;
193
+ export function escapeString(str: any): any;
194
+ export const FONT_IDENTITY_MATRIX: number[];
195
+ export namespace FontType {
196
+ const UNKNOWN: string;
197
+ const TYPE1: string;
198
+ const TYPE1C: string;
199
+ const CIDFONTTYPE0: string;
200
+ const CIDFONTTYPE0C: string;
201
+ const TRUETYPE: string;
202
+ const CIDFONTTYPE2: string;
203
+ const TYPE3: string;
204
+ const OPENTYPE: string;
205
+ const TYPE0: string;
206
+ const MMTYPE1: string;
207
+ }
208
+ declare const FormatError_base: any;
209
+ /**
210
+ * Error caused during parsing PDF data.
211
+ */
212
+ export class FormatError extends FormatError_base {
268
213
  [x: string]: any;
269
214
  }
215
+ export function getModificationDate(date?: Date): string;
216
+ export function getVerbosityLevel(): number;
217
+ export const IDENTITY_MATRIX: number[];
218
+ export namespace ImageKind {
219
+ const GRAYSCALE_1BPP: number;
220
+ const RGB_24BPP: number;
221
+ const RGBA_32BPP: number;
222
+ }
223
+ export function info(msg: any): void;
270
224
  declare const InvalidPDFException_base: any;
271
225
  export class InvalidPDFException extends InvalidPDFException_base {
272
226
  [x: string]: any;
273
227
  }
228
+ export function isArrayBuffer(v: any): boolean;
229
+ export function isArrayEqual(arr1: any, arr2: any): any;
230
+ export function isAscii(str: any): boolean;
231
+ export function isBool(v: any): boolean;
232
+ export namespace IsEvalSupportedCached { }
233
+ export namespace IsLittleEndianCached { }
234
+ export function isNum(v: any): boolean;
235
+ export function isSameOrigin(baseUrl: any, otherUrl: any): boolean;
236
+ export function isString(v: any): boolean;
274
237
  declare const MissingPDFException_base: any;
275
238
  export class MissingPDFException extends MissingPDFException_base {
276
239
  [x: string]: any;
277
240
  }
241
+ export function objectFromEntries(iterable: any): any;
242
+ export function objectSize(obj: any): number;
243
+ export namespace OPS {
244
+ const dependency: number;
245
+ const setLineWidth: number;
246
+ const setLineCap: number;
247
+ const setLineJoin: number;
248
+ const setMiterLimit: number;
249
+ const setDash: number;
250
+ const setRenderingIntent: number;
251
+ const setFlatness: number;
252
+ const setGState: number;
253
+ const save: number;
254
+ const restore: number;
255
+ const transform: number;
256
+ const moveTo: number;
257
+ const lineTo: number;
258
+ const curveTo: number;
259
+ const curveTo2: number;
260
+ const curveTo3: number;
261
+ const closePath: number;
262
+ const rectangle: number;
263
+ const stroke: number;
264
+ const closeStroke: number;
265
+ const fill: number;
266
+ const eoFill: number;
267
+ const fillStroke: number;
268
+ const eoFillStroke: number;
269
+ const closeFillStroke: number;
270
+ const closeEOFillStroke: number;
271
+ const endPath: number;
272
+ const clip: number;
273
+ const eoClip: number;
274
+ const beginText: number;
275
+ const endText: number;
276
+ const setCharSpacing: number;
277
+ const setWordSpacing: number;
278
+ const setHScale: number;
279
+ const setLeading: number;
280
+ const setFont: number;
281
+ const setTextRenderingMode: number;
282
+ const setTextRise: number;
283
+ const moveText: number;
284
+ const setLeadingMoveText: number;
285
+ const setTextMatrix: number;
286
+ const nextLine: number;
287
+ const showText: number;
288
+ const showSpacedText: number;
289
+ const nextLineShowText: number;
290
+ const nextLineSetSpacingShowText: number;
291
+ const setCharWidth: number;
292
+ const setCharWidthAndBounds: number;
293
+ const setStrokeColorSpace: number;
294
+ const setFillColorSpace: number;
295
+ const setStrokeColor: number;
296
+ const setStrokeColorN: number;
297
+ const setFillColor: number;
298
+ const setFillColorN: number;
299
+ const setStrokeGray: number;
300
+ const setFillGray: number;
301
+ const setStrokeRGBColor: number;
302
+ const setFillRGBColor: number;
303
+ const setStrokeCMYKColor: number;
304
+ const setFillCMYKColor: number;
305
+ const shadingFill: number;
306
+ const beginInlineImage: number;
307
+ const beginImageData: number;
308
+ const endInlineImage: number;
309
+ const paintXObject: number;
310
+ const markPoint: number;
311
+ const markPointProps: number;
312
+ const beginMarkedContent: number;
313
+ const beginMarkedContentProps: number;
314
+ const endMarkedContent: number;
315
+ const beginCompat: number;
316
+ const endCompat: number;
317
+ const paintFormXObjectBegin: number;
318
+ const paintFormXObjectEnd: number;
319
+ const beginGroup: number;
320
+ const endGroup: number;
321
+ const beginAnnotations: number;
322
+ const endAnnotations: number;
323
+ const beginAnnotation: number;
324
+ const endAnnotation: number;
325
+ const paintJpegXObject: number;
326
+ const paintImageMaskXObject: number;
327
+ const paintImageMaskXObjectGroup: number;
328
+ const paintImageXObject: number;
329
+ const paintInlineImageXObject: number;
330
+ const paintInlineImageXObjectGroup: number;
331
+ const paintImageXObjectRepeat: number;
332
+ const paintImageMaskXObjectRepeat: number;
333
+ const paintSolidColorImageMask: number;
334
+ const constructPath: number;
335
+ }
336
+ export namespace PageActionEventType {
337
+ export const O: string;
338
+ const C_1: string;
339
+ export { C_1 as C };
340
+ }
278
341
  declare const PasswordException_base: any;
279
342
  export class PasswordException extends PasswordException_base {
280
343
  [x: string]: any;
@@ -282,8 +345,8 @@ export class PasswordException extends PasswordException_base {
282
345
  code: any;
283
346
  }
284
347
  export namespace PasswordResponses {
285
- export const NEED_PASSWORD: number;
286
- export const INCORRECT_PASSWORD: number;
348
+ const NEED_PASSWORD: number;
349
+ const INCORRECT_PASSWORD: number;
287
350
  }
288
351
  export namespace PermissionFlag {
289
352
  const PRINT_1: number;
@@ -296,6 +359,12 @@ export namespace PermissionFlag {
296
359
  export const ASSEMBLE: number;
297
360
  export const PRINT_HIGH_QUALITY: number;
298
361
  }
362
+ /**
363
+ * @param {string} str
364
+ */
365
+ export function removeNullCharacters(str: string): string;
366
+ export function setVerbosityLevel(level: any): void;
367
+ export function shadow(obj: any, prop: any, value: any): any;
299
368
  export namespace StreamType {
300
369
  const UNKNOWN_1: string;
301
370
  export { UNKNOWN_1 as UNKNOWN };
@@ -309,6 +378,11 @@ export namespace StreamType {
309
378
  export const CCF: string;
310
379
  export const RLX: string;
311
380
  }
381
+ export function string32(value: any): string;
382
+ export function stringToBytes(str: any): Uint8Array;
383
+ export function stringToPDFString(str: any): string;
384
+ export function stringToUTF16BEString(str: any): string;
385
+ export function stringToUTF8String(str: any): string;
312
386
  export namespace TextRenderingMode {
313
387
  export const FILL: number;
314
388
  export const STROKE: number;
@@ -334,8 +408,31 @@ export class UnknownErrorException extends UnknownErrorException_base {
334
408
  constructor(msg: any, details: any);
335
409
  details: any;
336
410
  }
411
+ export function unreachable(msg: any): void;
412
+ export namespace UNSUPPORTED_FEATURES {
413
+ const unknown: string;
414
+ const forms: string;
415
+ const javaScript: string;
416
+ const smask: string;
417
+ const shadingPattern: string;
418
+ const font: string;
419
+ const errorTilingPattern: string;
420
+ const errorExtGState: string;
421
+ const errorXObject: string;
422
+ const errorFontLoadType3: string;
423
+ const errorFontState: string;
424
+ const errorFontMissing: string;
425
+ const errorFontTranslate: string;
426
+ const errorColorSpace: string;
427
+ const errorOperatorList: string;
428
+ const errorFontToUnicode: string;
429
+ const errorFontLoadNative: string;
430
+ const errorFontGetPath: string;
431
+ const errorMarkedContent: string;
432
+ }
433
+ export function utf8StringToString(str: any): string;
337
434
  export class Util {
338
- static makeCssRgb(r: any, g: any, b: any): string;
435
+ static makeHexColor(r: any, g: any, b: any): string;
339
436
  static transform(m1: any, m2: any): any[];
340
437
  static applyTransform(p: any, m: any): any[];
341
438
  static applyInverseTransform(p: any, m: any): number[];
@@ -346,76 +443,10 @@ export class Util {
346
443
  static normalizeRect(rect: any): any;
347
444
  static intersect(rect1: any, rect2: any): any[] | null;
348
445
  }
349
- declare const FormatError_base: any;
350
- /**
351
- * Error caused during parsing PDF data.
352
- */
353
- export class FormatError extends FormatError_base {
354
- [x: string]: any;
446
+ export namespace VerbosityLevel {
447
+ const ERRORS: number;
448
+ const WARNINGS: number;
449
+ const INFOS: number;
355
450
  }
356
- /**
357
- * Gets length of the array (Array, Uint8Array, or string) in bytes.
358
- * @param {Array<any>|Uint8Array|string} arr
359
- * @returns {number}
360
- */
361
- export function arrayByteLength(arr: Array<any> | Uint8Array | string): number;
362
- /**
363
- * Combines array items (arrays) into single Uint8Array object.
364
- * @param {Array<Array<any>|Uint8Array|string>} arr - the array of the arrays
365
- * (Array, Uint8Array, or string).
366
- * @returns {Uint8Array}
367
- */
368
- export function arraysToBytes(arr: Array<Array<any> | Uint8Array | string>): Uint8Array;
369
- export function assert(cond: any, msg: any): void;
370
- export function bytesToString(bytes: any): string;
371
- /**
372
- * Promise Capability object.
373
- *
374
- * @typedef {Object} PromiseCapability
375
- * @property {Promise<any>} promise - A Promise object.
376
- * @property {boolean} settled - If the Promise has been fulfilled/rejected.
377
- * @property {function} resolve - Fulfills the Promise.
378
- * @property {function} reject - Rejects the Promise.
379
- */
380
- /**
381
- * Creates a promise capability object.
382
- * @alias createPromiseCapability
383
- *
384
- * @returns {PromiseCapability}
385
- */
386
- export function createPromiseCapability(): PromiseCapability;
387
- export function createObjectURL(data: any, contentType: any, forceDataSchema?: boolean): string;
388
- export function escapeString(str: any): any;
389
- export function getModificationDate(date?: Date): string;
390
- export function getVerbosityLevel(): number;
391
- export function info(msg: any): void;
392
- export function isArrayBuffer(v: any): boolean;
393
- export function isArrayEqual(arr1: any, arr2: any): any;
394
- export function isBool(v: any): boolean;
395
- export function isNum(v: any): boolean;
396
- export function isString(v: any): boolean;
397
- export function isSameOrigin(baseUrl: any, otherUrl: any): boolean;
398
- /**
399
- * Attempts to create a valid absolute URL.
400
- *
401
- * @param {URL|string} url - An absolute, or relative, URL.
402
- * @param {URL|string} baseUrl - An absolute URL.
403
- * @returns Either a valid {URL}, or `null` otherwise.
404
- */
405
- export function createValidAbsoluteUrl(url: URL | string, baseUrl: URL | string): URL | null;
406
- export namespace IsLittleEndianCached { }
407
- export namespace IsEvalSupportedCached { }
408
- /**
409
- * @param {string} str
410
- */
411
- export function removeNullCharacters(str: string): string;
412
- export function setVerbosityLevel(level: any): void;
413
- export function shadow(obj: any, prop: any, value: any): any;
414
- export function string32(value: any): string;
415
- export function stringToBytes(str: any): Uint8Array;
416
- export function stringToPDFString(str: any): string;
417
- export function stringToUTF8String(str: any): string;
418
- export function utf8StringToString(str: any): string;
419
451
  export function warn(msg: any): void;
420
- export function unreachable(msg: any): void;
421
452
  export {};
@@ -0,0 +1,64 @@
1
+ export class SimpleDOMNode {
2
+ constructor(nodeName: any, nodeValue: any);
3
+ nodeName: any;
4
+ nodeValue: any;
5
+ get firstChild(): any;
6
+ get nextSibling(): any;
7
+ get textContent(): any;
8
+ hasChildNodes(): any;
9
+ /**
10
+ * Search a node in the tree with the given path
11
+ * foo.bar[nnn], i.e. find the nnn-th node named
12
+ * bar under a node named foo.
13
+ *
14
+ * @param {Array} paths - an array of objects as
15
+ * returned by {parseXFAPath}.
16
+ * @param {number} pos - the current position in
17
+ * the paths array.
18
+ * @returns {SimpleDOMNode} The node corresponding
19
+ * to the path or null if not found.
20
+ */
21
+ searchNode(paths: any[], pos: number): SimpleDOMNode;
22
+ dump(buffer: any): void;
23
+ }
24
+ export class SimpleXMLParser extends XMLParserBase {
25
+ constructor({ hasAttributes, lowerCaseName }: {
26
+ hasAttributes?: boolean | undefined;
27
+ lowerCaseName?: boolean | undefined;
28
+ });
29
+ _currentFragment: any;
30
+ _stack: any[] | null;
31
+ _errorCode: number;
32
+ _hasAttributes: boolean;
33
+ _lowerCaseName: boolean;
34
+ parseFromString(data: any): {
35
+ documentElement: any;
36
+ } | undefined;
37
+ }
38
+ declare class XMLParserBase {
39
+ _resolveEntities(s: any): any;
40
+ _parseContent(s: any, start: any): {
41
+ name: any;
42
+ attributes: {
43
+ name: string;
44
+ value: any;
45
+ }[];
46
+ parsed: number;
47
+ } | null;
48
+ _parseProcessingInstruction(s: any, start: any): {
49
+ name: any;
50
+ value: any;
51
+ parsed: number;
52
+ };
53
+ parseXml(s: any): void;
54
+ onResolveEntity(name: any): string;
55
+ onPi(name: any, value: any): void;
56
+ onComment(text: any): void;
57
+ onCdata(text: any): void;
58
+ onDoctype(doctypeContent: any): void;
59
+ onText(text: any): void;
60
+ onBeginElement(name: any, attributes: any, isEmpty: any): void;
61
+ onEndElement(name: any): void;
62
+ onError(code: any): void;
63
+ }
64
+ export {};