pdfjs-dist 2.5.207 → 2.6.347

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 (133) hide show
  1. package/bower.json +1 -1
  2. package/build/pdf.js +867 -216
  3. package/build/pdf.js.map +1 -1
  4. package/build/pdf.min.js +1 -1
  5. package/build/pdf.worker.js +10214 -8547
  6. package/build/pdf.worker.js.map +1 -1
  7. package/build/pdf.worker.min.js +1 -1
  8. package/es5/build/pdf.js +2023 -1046
  9. package/es5/build/pdf.js.map +1 -1
  10. package/es5/build/pdf.min.js +22 -0
  11. package/es5/build/pdf.worker.js +11136 -8144
  12. package/es5/build/pdf.worker.js.map +1 -1
  13. package/es5/build/pdf.worker.min.js +22 -0
  14. package/es5/image_decoders/pdf.image_decoders.js +12529 -0
  15. package/es5/image_decoders/pdf.image_decoders.js.map +1 -0
  16. package/es5/image_decoders/pdf.image_decoders.min.js +22 -0
  17. package/es5/web/images/shadow.png +0 -0
  18. package/es5/web/pdf_viewer.css +8 -5
  19. package/es5/web/pdf_viewer.js +195 -51
  20. package/es5/web/pdf_viewer.js.map +1 -1
  21. package/image_decoders/pdf.image_decoders.js +24 -16
  22. package/image_decoders/pdf.image_decoders.js.map +1 -1
  23. package/image_decoders/pdf.image_decoders.min.js +1 -1
  24. package/lib/core/annotation.js +479 -43
  25. package/lib/core/cff_parser.js +643 -615
  26. package/lib/core/chunked_stream.js +64 -50
  27. package/lib/core/colorspace.js +126 -104
  28. package/lib/core/crypto.js +37 -0
  29. package/lib/core/document.js +128 -75
  30. package/lib/core/evaluator.js +3015 -2754
  31. package/lib/core/fonts.js +47 -46
  32. package/lib/core/function.js +79 -6
  33. package/lib/core/image.js +364 -357
  34. package/lib/core/image_utils.js +109 -8
  35. package/lib/core/jpg.js +8 -3
  36. package/lib/core/obj.js +255 -34
  37. package/lib/core/operator_list.js +17 -15
  38. package/lib/core/parser.js +40 -3
  39. package/lib/core/pattern.js +24 -11
  40. package/lib/core/primitives.js +112 -53
  41. package/lib/core/type1_parser.js +2 -0
  42. package/lib/core/worker.js +102 -37
  43. package/lib/core/writer.js +242 -0
  44. package/lib/display/annotation_layer.js +51 -10
  45. package/lib/display/annotation_storage.js +89 -0
  46. package/lib/display/api.js +140 -54
  47. package/lib/display/canvas.js +215 -46
  48. package/lib/display/display_utils.js +55 -18
  49. package/lib/display/fetch_stream.js +6 -0
  50. package/lib/display/font_loader.js +26 -15
  51. package/lib/display/metadata.js +1 -7
  52. package/lib/display/network.js +0 -14
  53. package/lib/display/node_utils.js +87 -0
  54. package/lib/display/optional_content_config.js +184 -0
  55. package/lib/display/svg.js +1 -1
  56. package/lib/display/text_layer.js +4 -1
  57. package/lib/pdf.js +2 -2
  58. package/lib/pdf.worker.js +2 -2
  59. package/lib/shared/is_node.js +1 -1
  60. package/lib/shared/util.js +13 -10
  61. package/lib/test/unit/annotation_spec.js +520 -50
  62. package/lib/test/unit/annotation_storage_spec.js +83 -0
  63. package/lib/test/unit/api_spec.js +16 -6
  64. package/lib/test/unit/cmap_spec.js +4 -4
  65. package/lib/test/unit/colorspace_spec.js +216 -24
  66. package/lib/test/unit/crypto_spec.js +51 -4
  67. package/lib/test/unit/custom_spec.js +129 -1
  68. package/lib/test/unit/document_spec.js +112 -1
  69. package/lib/test/unit/evaluator_spec.js +29 -10
  70. package/lib/test/unit/jasmine-boot.js +1 -1
  71. package/lib/test/unit/metadata_spec.js +3 -3
  72. package/lib/test/unit/primitives_spec.js +242 -63
  73. package/lib/test/unit/test_utils.js +42 -89
  74. package/lib/test/unit/testreporter.js +17 -6
  75. package/lib/test/unit/util_spec.js +13 -12
  76. package/lib/test/unit/writer_spec.js +84 -0
  77. package/lib/web/annotation_layer_builder.js +13 -9
  78. package/lib/web/app.js +231 -26
  79. package/lib/web/app_options.js +1 -6
  80. package/lib/web/base_tree_viewer.js +100 -0
  81. package/lib/web/base_viewer.js +53 -4
  82. package/lib/web/download_manager.js +3 -10
  83. package/lib/web/firefox_print_service.js +32 -12
  84. package/lib/web/firefoxcom.js +20 -6
  85. package/lib/web/interfaces.js +1 -1
  86. package/lib/web/pdf_attachment_viewer.js +80 -38
  87. package/lib/web/pdf_find_controller.js +2 -1
  88. package/lib/web/pdf_layer_viewer.js +208 -0
  89. package/lib/web/pdf_outline_viewer.js +24 -57
  90. package/lib/web/pdf_page_view.js +29 -6
  91. package/lib/web/pdf_print_service.js +13 -11
  92. package/lib/web/pdf_sidebar.js +46 -25
  93. package/lib/web/pdf_thumbnail_view.js +16 -3
  94. package/lib/web/pdf_thumbnail_viewer.js +17 -1
  95. package/lib/web/pdf_viewer.component.js +2 -2
  96. package/lib/web/preferences.js +1 -1
  97. package/lib/web/toolbar.js +1 -1
  98. package/lib/web/ui_utils.js +7 -1
  99. package/package.json +3 -1
  100. package/types/display/annotation_layer.d.ts +61 -0
  101. package/types/display/annotation_storage.d.ts +36 -0
  102. package/types/display/api.d.ts +1107 -0
  103. package/types/display/api_compatibility.d.ts +1 -0
  104. package/types/display/canvas.d.ts +4 -0
  105. package/types/display/content_disposition.d.ts +7 -0
  106. package/types/display/display_utils.d.ts +243 -0
  107. package/types/display/fetch_stream.d.ts +67 -0
  108. package/types/display/font_loader.d.ts +19 -0
  109. package/types/display/metadata.d.ts +9 -0
  110. package/types/display/network.d.ts +80 -0
  111. package/types/display/network_utils.d.ts +14 -0
  112. package/types/display/node_stream.d.ts +72 -0
  113. package/types/display/node_utils.d.ts +6 -0
  114. package/types/display/optional_content_config.d.ts +12 -0
  115. package/types/display/pattern_helper.d.ts +5 -0
  116. package/types/display/svg.d.ts +2 -0
  117. package/types/display/text_layer.d.ts +83 -0
  118. package/types/display/transport_stream.d.ts +57 -0
  119. package/types/display/webgl.d.ts +20 -0
  120. package/types/display/worker_options.d.ts +27 -0
  121. package/types/display/xml_parser.d.ts +35 -0
  122. package/types/pdf.d.ts +33 -0
  123. package/types/shared/compatibility.d.ts +1 -0
  124. package/types/shared/is_node.d.ts +1 -0
  125. package/types/shared/message_handler.d.ts +62 -0
  126. package/types/shared/util.d.ts +421 -0
  127. package/web/images/shadow.png +0 -0
  128. package/web/pdf_viewer.css +8 -5
  129. package/web/pdf_viewer.js +109 -33
  130. package/web/pdf_viewer.js.map +1 -1
  131. package/webpack.js +1 -9
  132. package/es5/web/images/texture.png +0 -0
  133. package/web/images/texture.png +0 -0
@@ -0,0 +1 @@
1
+ export const apiCompatibilityParams: any;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @type {any}
3
+ */
4
+ export var CanvasGraphics: any;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Extract file name from the Content-Disposition HTTP response header.
3
+ *
4
+ * @param {string} contentDisposition
5
+ * @returns {string} Filename, if found in the Content-Disposition header.
6
+ */
7
+ export function getFilenameFromContentDispositionHeader(contentDisposition: string): string;
@@ -0,0 +1,243 @@
1
+ export type ExternalLinkParameters = any;
2
+ export type PageViewportParameters = {
3
+ /**
4
+ * - The xMin, yMin, xMax and
5
+ * yMax coordinates.
6
+ */
7
+ viewBox: Array<number>;
8
+ /**
9
+ * - The scale of the viewport.
10
+ */
11
+ scale: number;
12
+ /**
13
+ * - The rotation, in degrees, of the viewport.
14
+ */
15
+ rotation: number;
16
+ /**
17
+ * - The horizontal, i.e. x-axis, offset. The
18
+ * default value is `0`.
19
+ */
20
+ offsetX?: number;
21
+ /**
22
+ * - The vertical, i.e. y-axis, offset. The
23
+ * default value is `0`.
24
+ */
25
+ offsetY?: number;
26
+ /**
27
+ * - If true, the y-axis will not be flipped.
28
+ * The default value is `false`.
29
+ */
30
+ dontFlip?: boolean;
31
+ };
32
+ export type PageViewportCloneParameters = {
33
+ /**
34
+ * - The scale, overriding the one in the cloned
35
+ * viewport. The default value is `this.scale`.
36
+ */
37
+ scale?: number;
38
+ /**
39
+ * - The rotation, in degrees, overriding the one
40
+ * in the cloned viewport. The default value is `this.rotation`.
41
+ */
42
+ rotation?: number;
43
+ /**
44
+ * - The horizontal, i.e. x-axis, offset.
45
+ * The default value is `this.offsetX`.
46
+ */
47
+ offsetX?: number;
48
+ /**
49
+ * - The vertical, i.e. y-axis, offset.
50
+ * The default value is `this.offsetY`.
51
+ */
52
+ offsetY?: number;
53
+ /**
54
+ * - If true, the x-axis will not be flipped.
55
+ * The default value is `false`.
56
+ */
57
+ dontFlip?: boolean;
58
+ };
59
+ /**
60
+ * @typedef {Object} PageViewportParameters
61
+ * @property {Array<number>} viewBox - The xMin, yMin, xMax and
62
+ * yMax coordinates.
63
+ * @property {number} scale - The scale of the viewport.
64
+ * @property {number} rotation - The rotation, in degrees, of the viewport.
65
+ * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset. The
66
+ * default value is `0`.
67
+ * @property {number} [offsetY] - The vertical, i.e. y-axis, offset. The
68
+ * default value is `0`.
69
+ * @property {boolean} [dontFlip] - If true, the y-axis will not be flipped.
70
+ * The default value is `false`.
71
+ */
72
+ /**
73
+ * @typedef {Object} PageViewportCloneParameters
74
+ * @property {number} [scale] - The scale, overriding the one in the cloned
75
+ * viewport. The default value is `this.scale`.
76
+ * @property {number} [rotation] - The rotation, in degrees, overriding the one
77
+ * in the cloned viewport. The default value is `this.rotation`.
78
+ * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.
79
+ * The default value is `this.offsetX`.
80
+ * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.
81
+ * The default value is `this.offsetY`.
82
+ * @property {boolean} [dontFlip] - If true, the x-axis will not be flipped.
83
+ * The default value is `false`.
84
+ */
85
+ /**
86
+ * PDF page viewport created based on scale, rotation and offset.
87
+ */
88
+ export class PageViewport {
89
+ /**
90
+ * @param {PageViewportParameters}
91
+ */
92
+ constructor({ viewBox, scale, rotation, offsetX, offsetY, dontFlip, }: PageViewportParameters);
93
+ viewBox: number[];
94
+ scale: number;
95
+ rotation: number;
96
+ offsetX: number;
97
+ offsetY: number;
98
+ transform: number[];
99
+ width: number;
100
+ height: number;
101
+ /**
102
+ * Clones viewport, with optional additional properties.
103
+ * @param {PageViewportCloneParameters} [params]
104
+ * @returns {PageViewport} Cloned viewport.
105
+ */
106
+ clone({ scale, rotation, offsetX, offsetY, dontFlip, }?: PageViewportCloneParameters | undefined): PageViewport;
107
+ /**
108
+ * Converts PDF point to the viewport coordinates. For examples, useful for
109
+ * converting PDF location into canvas pixel coordinates.
110
+ * @param {number} x - The x-coordinate.
111
+ * @param {number} y - The y-coordinate.
112
+ * @returns {Object} Object containing `x` and `y` properties of the
113
+ * point in the viewport coordinate space.
114
+ * @see {@link convertToPdfPoint}
115
+ * @see {@link convertToViewportRectangle}
116
+ */
117
+ convertToViewportPoint(x: number, y: number): Object;
118
+ /**
119
+ * Converts PDF rectangle to the viewport coordinates.
120
+ * @param {Array} rect - The xMin, yMin, xMax and yMax coordinates.
121
+ * @returns {Array} Array containing corresponding coordinates of the
122
+ * rectangle in the viewport coordinate space.
123
+ * @see {@link convertToViewportPoint}
124
+ */
125
+ convertToViewportRectangle(rect: any[]): any[];
126
+ /**
127
+ * Converts viewport coordinates to the PDF location. For examples, useful
128
+ * for converting canvas pixel location into PDF one.
129
+ * @param {number} x - The x-coordinate.
130
+ * @param {number} y - The y-coordinate.
131
+ * @returns {Object} Object containing `x` and `y` properties of the
132
+ * point in the PDF coordinate space.
133
+ * @see {@link convertToViewportPoint}
134
+ */
135
+ convertToPdfPoint(x: number, y: number): Object;
136
+ }
137
+ declare const RenderingCancelledException_base: any;
138
+ export class RenderingCancelledException extends RenderingCancelledException_base {
139
+ [x: string]: any;
140
+ constructor(msg: any, type: any);
141
+ type: any;
142
+ }
143
+ /**
144
+ * @typedef ExternalLinkParameters
145
+ * @typedef {Object} ExternalLinkParameters
146
+ * @property {string} url - An absolute URL.
147
+ * @property {LinkTarget} [target] - The link target. The default value is
148
+ * `LinkTarget.NONE`.
149
+ * @property {string} [rel] - The link relationship. The default value is
150
+ * `DEFAULT_LINK_REL`.
151
+ * @property {boolean} [enabled] - Whether the link should be enabled. The
152
+ * default value is true.
153
+ */
154
+ /**
155
+ * Adds various attributes (href, title, target, rel) to hyperlinks.
156
+ * @param {HTMLLinkElement} link - The link element.
157
+ * @param {ExternalLinkParameters} params
158
+ */
159
+ export function addLinkAttributes(link: HTMLLinkElement, { url, target, rel, enabled }?: any): void;
160
+ /**
161
+ * Gets the file name from a given URL.
162
+ * @param {string} url
163
+ */
164
+ export function getFilenameFromUrl(url: string): string;
165
+ export namespace LinkTarget {
166
+ export const NONE: number;
167
+ export const SELF: number;
168
+ export const BLANK: number;
169
+ export const PARENT: number;
170
+ export const TOP: number;
171
+ }
172
+ export const DEFAULT_LINK_REL: "noopener noreferrer nofollow";
173
+ export class BaseCanvasFactory {
174
+ create(width: any, height: any): void;
175
+ reset(canvasAndContext: any, width: any, height: any): void;
176
+ destroy(canvasAndContext: any): void;
177
+ }
178
+ export class DOMCanvasFactory extends BaseCanvasFactory {
179
+ constructor({ ownerDocument }?: {
180
+ ownerDocument?: Document | undefined;
181
+ });
182
+ _document: Document;
183
+ }
184
+ export class BaseCMapReaderFactory {
185
+ constructor({ baseUrl, isCompressed }: {
186
+ baseUrl?: any;
187
+ isCompressed?: boolean | undefined;
188
+ });
189
+ baseUrl: any;
190
+ isCompressed: boolean;
191
+ fetch({ name }: {
192
+ name: any;
193
+ }): Promise<any>;
194
+ /**
195
+ * @private
196
+ */
197
+ private _fetchData;
198
+ }
199
+ export class DOMCMapReaderFactory extends BaseCMapReaderFactory {
200
+ constructor({ baseUrl, isCompressed }: {
201
+ baseUrl?: any;
202
+ isCompressed?: boolean | undefined;
203
+ });
204
+ }
205
+ export class DOMSVGFactory {
206
+ create(width: any, height: any): SVGElement;
207
+ createElement(type: any): any;
208
+ }
209
+ export class StatTimer {
210
+ started: any;
211
+ times: any[];
212
+ time(name: any): void;
213
+ timeEnd(name: any): void;
214
+ toString(): string;
215
+ }
216
+ export function isFetchSupported(): boolean;
217
+ export function isValidFetchUrl(url: any, baseUrl: any): boolean;
218
+ /**
219
+ * @param {string} src
220
+ * @returns {Promise<void>}
221
+ */
222
+ export function loadScript(src: string): Promise<void>;
223
+ export function deprecated(details: any): void;
224
+ export class PDFDateString {
225
+ /**
226
+ * Convert a PDF date string to a JavaScript `Date` object.
227
+ *
228
+ * The PDF date string format is described in section 7.9.4 of the official
229
+ * PDF 32000-1:2008 specification. However, in the PDF 1.7 reference (sixth
230
+ * edition) Adobe describes the same format including a trailing apostrophe.
231
+ * This syntax in incorrect, but Adobe Acrobat creates PDF files that contain
232
+ * them. We ignore all apostrophes as they are not necessary for date parsing.
233
+ *
234
+ * Moreover, Adobe Acrobat doesn't handle changing the date to universal time
235
+ * and doesn't use the user's time zone (effectively ignoring the HH' and mm'
236
+ * parts of the date string).
237
+ *
238
+ * @param {string} input
239
+ * @returns {Date|null}
240
+ */
241
+ static toDateObject(input: string): Date | null;
242
+ }
243
+ export {};
@@ -0,0 +1,67 @@
1
+ /** @implements {IPDFStream} */
2
+ export class PDFFetchStream {
3
+ constructor(source: any);
4
+ source: any;
5
+ isHttp: boolean;
6
+ httpHeaders: any;
7
+ _fullRequestReader: PDFFetchStreamReader | null;
8
+ _rangeRequestReaders: any[];
9
+ get _progressiveDataLength(): number;
10
+ getFullReader(): PDFFetchStreamReader;
11
+ getRangeReader(begin: any, end: any): PDFFetchStreamRangeReader | null;
12
+ cancelAllRequests(reason: any): void;
13
+ }
14
+ /** @implements {IPDFStreamReader} */
15
+ declare class PDFFetchStreamReader {
16
+ constructor(stream: any);
17
+ _stream: any;
18
+ _reader: ReadableStreamDefaultReader<Uint8Array> | null;
19
+ _loaded: number;
20
+ _filename: string | null;
21
+ _withCredentials: any;
22
+ _contentLength: any;
23
+ _headersCapability: import("../shared/util.js").PromiseCapability;
24
+ _disableRange: any;
25
+ _rangeChunkSize: any;
26
+ _abortController: AbortController;
27
+ _isStreamingSupported: boolean;
28
+ _isRangeSupported: boolean;
29
+ _headers: Headers;
30
+ onProgress: any;
31
+ get headersReady(): Promise<any>;
32
+ get filename(): string | null;
33
+ get contentLength(): any;
34
+ get isRangeSupported(): boolean;
35
+ get isStreamingSupported(): boolean;
36
+ read(): Promise<{
37
+ value: Uint8Array | undefined;
38
+ done: true;
39
+ } | {
40
+ value: ArrayBufferLike;
41
+ done: boolean;
42
+ }>;
43
+ cancel(reason: any): void;
44
+ }
45
+ /** @implements {IPDFStreamRangeReader} */
46
+ declare class PDFFetchStreamRangeReader {
47
+ constructor(stream: any, begin: any, end: any);
48
+ _stream: any;
49
+ _reader: ReadableStreamDefaultReader<Uint8Array> | null;
50
+ _loaded: number;
51
+ _withCredentials: any;
52
+ _readCapability: import("../shared/util.js").PromiseCapability;
53
+ _isStreamingSupported: boolean;
54
+ _abortController: AbortController;
55
+ _headers: Headers;
56
+ onProgress: any;
57
+ get isStreamingSupported(): boolean;
58
+ read(): Promise<{
59
+ value: Uint8Array | undefined;
60
+ done: true;
61
+ } | {
62
+ value: ArrayBufferLike;
63
+ done: boolean;
64
+ }>;
65
+ cancel(reason: any): void;
66
+ }
67
+ export {};
@@ -0,0 +1,19 @@
1
+ export class FontFaceObject {
2
+ constructor(translatedData: any, { isEvalSupported, disableFontFace, ignoreErrors, onUnsupportedFeature, fontRegistry, }: {
3
+ isEvalSupported?: boolean | undefined;
4
+ disableFontFace?: boolean | undefined;
5
+ ignoreErrors?: boolean | undefined;
6
+ onUnsupportedFeature?: any;
7
+ fontRegistry?: any;
8
+ });
9
+ compiledGlyphs: any;
10
+ isEvalSupported: boolean;
11
+ disableFontFace: boolean;
12
+ ignoreErrors: boolean;
13
+ _onUnsupportedFeature: any;
14
+ fontRegistry: any;
15
+ createNativeFontFace(): any;
16
+ createFontFaceRule(): string | null;
17
+ getPathGenerator(objs: any, character: any): any;
18
+ }
19
+ export let FontLoader: any;
@@ -0,0 +1,9 @@
1
+ export class Metadata {
2
+ constructor(data: any);
3
+ _metadataMap: Map<any, any>;
4
+ _repair(data: any): any;
5
+ _parse(xmlDocument: any): void;
6
+ get(name: any): any;
7
+ getAll(): any;
8
+ has(name: any): boolean;
9
+ }
@@ -0,0 +1,80 @@
1
+ /** @implements {IPDFStream} */
2
+ export class PDFNetworkStream {
3
+ constructor(source: any);
4
+ _source: any;
5
+ _manager: NetworkManager;
6
+ _rangeChunkSize: any;
7
+ _fullRequestReader: PDFNetworkStreamFullRequestReader | null;
8
+ _rangeRequestReaders: any[];
9
+ _onRangeRequestReaderClosed(reader: any): void;
10
+ getFullReader(): PDFNetworkStreamFullRequestReader;
11
+ getRangeReader(begin: any, end: any): PDFNetworkStreamRangeRequestReader;
12
+ cancelAllRequests(reason: any): void;
13
+ }
14
+ declare class NetworkManager {
15
+ constructor(url: any, args: any);
16
+ url: any;
17
+ isHttp: boolean;
18
+ httpHeaders: any;
19
+ withCredentials: any;
20
+ getXhr: any;
21
+ currXhrId: number;
22
+ pendingRequests: any;
23
+ requestRange(begin: any, end: any, listeners: any): number;
24
+ requestFull(listeners: any): number;
25
+ request(args: any): number;
26
+ onProgress(xhrId: any, evt: any): void;
27
+ onStateChange(xhrId: any, evt: any): void;
28
+ getRequestXhr(xhrId: any): any;
29
+ isPendingRequest(xhrId: any): boolean;
30
+ abortRequest(xhrId: any): void;
31
+ }
32
+ /** @implements {IPDFStreamReader} */
33
+ declare class PDFNetworkStreamFullRequestReader {
34
+ constructor(manager: any, source: any);
35
+ _manager: any;
36
+ _url: any;
37
+ _fullRequestId: any;
38
+ _headersReceivedCapability: import("../shared/util.js").PromiseCapability;
39
+ _disableRange: any;
40
+ _contentLength: any;
41
+ _rangeChunkSize: any;
42
+ _isStreamingSupported: boolean;
43
+ _isRangeSupported: boolean;
44
+ _cachedChunks: any[];
45
+ _requests: any[];
46
+ _done: boolean;
47
+ _storedError: import("../shared/util.js").MissingPDFException | import("../shared/util.js").UnexpectedResponseException | undefined;
48
+ _filename: string | null;
49
+ onProgress: any;
50
+ _onHeadersReceived(): void;
51
+ _onDone(args: any): void;
52
+ _onError(status: any): void;
53
+ _onProgress(data: any): void;
54
+ get filename(): string | null;
55
+ get isRangeSupported(): boolean;
56
+ get isStreamingSupported(): boolean;
57
+ get contentLength(): any;
58
+ get headersReady(): Promise<any>;
59
+ read(): Promise<any>;
60
+ cancel(reason: any): void;
61
+ _fullRequestReader: any;
62
+ }
63
+ /** @implements {IPDFStreamRangeReader} */
64
+ declare class PDFNetworkStreamRangeRequestReader {
65
+ constructor(manager: any, begin: any, end: any);
66
+ _manager: any;
67
+ _requestId: any;
68
+ _requests: any[];
69
+ _queuedChunk: any;
70
+ _done: boolean;
71
+ onProgress: any;
72
+ onClosed: any;
73
+ _close(): void;
74
+ _onDone(data: any): void;
75
+ _onProgress(evt: any): void;
76
+ get isStreamingSupported(): boolean;
77
+ read(): Promise<any>;
78
+ cancel(reason: any): void;
79
+ }
80
+ export {};
@@ -0,0 +1,14 @@
1
+ export function createResponseStatusError(status: any, url: any): MissingPDFException | UnexpectedResponseException;
2
+ export function extractFilenameFromHeader(getResponseHeader: any): string | null;
3
+ export function validateRangeRequestCapabilities({ getResponseHeader, isHttp, rangeChunkSize, disableRange, }: {
4
+ getResponseHeader: any;
5
+ isHttp: any;
6
+ rangeChunkSize: any;
7
+ disableRange: any;
8
+ }): {
9
+ allowRangeRequests: boolean;
10
+ suggestedLength: undefined;
11
+ };
12
+ export function validateResponseStatus(status: any): boolean;
13
+ import { MissingPDFException } from "../shared/util.js";
14
+ import { UnexpectedResponseException } from "../shared/util.js";
@@ -0,0 +1,72 @@
1
+ export class PDFNodeStream {
2
+ constructor(source: any);
3
+ source: any;
4
+ url: any;
5
+ isHttp: boolean;
6
+ isFsUrl: boolean;
7
+ httpHeaders: any;
8
+ _fullRequestReader: PDFNodeStreamFsFullReader | PDFNodeStreamFullReader | null;
9
+ _rangeRequestReaders: any[];
10
+ get _progressiveDataLength(): number;
11
+ getFullReader(): PDFNodeStreamFsFullReader | PDFNodeStreamFullReader;
12
+ getRangeReader(start: any, end: any): PDFNodeStreamFsRangeReader | PDFNodeStreamRangeReader | null;
13
+ cancelAllRequests(reason: any): void;
14
+ }
15
+ declare class PDFNodeStreamFsFullReader extends BaseFullReader {
16
+ constructor(stream: any);
17
+ }
18
+ declare class PDFNodeStreamFullReader extends BaseFullReader {
19
+ constructor(stream: any);
20
+ _request: any;
21
+ }
22
+ declare class PDFNodeStreamFsRangeReader extends BaseRangeReader {
23
+ constructor(stream: any, start: any, end: any);
24
+ }
25
+ declare class PDFNodeStreamRangeReader extends BaseRangeReader {
26
+ constructor(stream: any, start: any, end: any);
27
+ _httpHeaders: {};
28
+ _request: any;
29
+ }
30
+ declare class BaseFullReader {
31
+ constructor(stream: any);
32
+ _url: any;
33
+ _done: boolean;
34
+ _storedError: any;
35
+ onProgress: any;
36
+ _contentLength: any;
37
+ _loaded: number;
38
+ _filename: any;
39
+ _disableRange: any;
40
+ _rangeChunkSize: any;
41
+ _isStreamingSupported: boolean;
42
+ _isRangeSupported: boolean;
43
+ _readableStream: any;
44
+ _readCapability: import("../shared/util.js").PromiseCapability;
45
+ _headersCapability: import("../shared/util.js").PromiseCapability;
46
+ get headersReady(): Promise<any>;
47
+ get filename(): any;
48
+ get contentLength(): any;
49
+ get isRangeSupported(): boolean;
50
+ get isStreamingSupported(): boolean;
51
+ read(): any;
52
+ cancel(reason: any): void;
53
+ _error(reason: any): void;
54
+ _setReadableStream(readableStream: any): void;
55
+ }
56
+ declare class BaseRangeReader {
57
+ constructor(stream: any);
58
+ _url: any;
59
+ _done: boolean;
60
+ _storedError: any;
61
+ onProgress: any;
62
+ _loaded: number;
63
+ _readableStream: any;
64
+ _readCapability: import("../shared/util.js").PromiseCapability;
65
+ _isStreamingSupported: boolean;
66
+ get isStreamingSupported(): boolean;
67
+ read(): any;
68
+ cancel(reason: any): void;
69
+ _error(reason: any): void;
70
+ _setReadableStream(readableStream: any): void;
71
+ }
72
+ export {};
@@ -0,0 +1,6 @@
1
+ export let NodeCanvasFactory: {
2
+ new (): {};
3
+ };
4
+ export let NodeCMapReaderFactory: {
5
+ new (): {};
6
+ };
@@ -0,0 +1,12 @@
1
+ export class OptionalContentConfig {
2
+ constructor(data: any);
3
+ name: any;
4
+ creator: any;
5
+ _order: any;
6
+ _groups: Map<any, any>;
7
+ isVisible(group: any): any;
8
+ setVisibility(id: any, visible?: boolean): void;
9
+ getOrder(): any;
10
+ getGroups(): any;
11
+ getGroup(id: any): any;
12
+ }
@@ -0,0 +1,5 @@
1
+ export function getShadingPatternFromIR(raw: any): any;
2
+ /**
3
+ * @type {any}
4
+ */
5
+ export var TilingPattern: any;
@@ -0,0 +1,2 @@
1
+ /** @type {any} */
2
+ export let SVGGraphics: any;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Text layer render parameters.
3
+ */
4
+ export type TextLayerRenderParameters = {
5
+ /**
6
+ * - Text content to
7
+ * render (the object is returned by the page's `getTextContent` method).
8
+ */
9
+ textContent?: import("./api").TextContent;
10
+ /**
11
+ * - Text content stream to
12
+ * render (the stream is returned by the page's `streamTextContent` method).
13
+ */
14
+ textContentStream?: ReadableStream;
15
+ /**
16
+ * - HTML element that will contain text runs.
17
+ */
18
+ container: HTMLElement;
19
+ /**
20
+ * - The target
21
+ * viewport to properly layout the text runs.
22
+ */
23
+ viewport: import("./display_utils").PageViewport;
24
+ /**
25
+ * - HTML elements that are correspond
26
+ * to the text items of the textContent input. This is output and shall be
27
+ * initially be set to empty array.
28
+ */
29
+ textDivs?: Array<HTMLElement>;
30
+ /**
31
+ * - Strings that correspond to
32
+ * the `str` property of the text items of textContent input. This is output
33
+ * and shall be initially be set to empty array.
34
+ */
35
+ textContentItemsStr?: Array<string>;
36
+ /**
37
+ * - Delay in milliseconds before rendering of the
38
+ * text runs occurs.
39
+ */
40
+ timeout?: number;
41
+ /**
42
+ * - Whether to turn on the text
43
+ * selection enhancement.
44
+ */
45
+ enhanceTextSelection?: boolean;
46
+ };
47
+ export type TextLayerRenderTask = {
48
+ promise: Promise<void>;
49
+ cancel: () => void;
50
+ expandTextDivs: (expandDivs: boolean) => void;
51
+ };
52
+ /**
53
+ * Text layer render parameters.
54
+ *
55
+ * @typedef {Object} TextLayerRenderParameters
56
+ * @property {import("./api").TextContent} [textContent] - Text content to
57
+ * render (the object is returned by the page's `getTextContent` method).
58
+ * @property {ReadableStream} [textContentStream] - Text content stream to
59
+ * render (the stream is returned by the page's `streamTextContent` method).
60
+ * @property {HTMLElement} container - HTML element that will contain text runs.
61
+ * @property {import("./display_utils").PageViewport} viewport - The target
62
+ * viewport to properly layout the text runs.
63
+ * @property {Array<HTMLElement>} [textDivs] - HTML elements that are correspond
64
+ * to the text items of the textContent input. This is output and shall be
65
+ * initially be set to empty array.
66
+ * @property {Array<string>} [textContentItemsStr] - Strings that correspond to
67
+ * the `str` property of the text items of textContent input. This is output
68
+ * and shall be initially be set to empty array.
69
+ * @property {number} [timeout] - Delay in milliseconds before rendering of the
70
+ * text runs occurs.
71
+ * @property {boolean} [enhanceTextSelection] - Whether to turn on the text
72
+ * selection enhancement.
73
+ */
74
+ /**
75
+ * @typedef {Object} TextLayerRenderTask
76
+ * @property {Promise<void>} promise
77
+ * @property {() => void} cancel
78
+ * @property {(expandDivs: boolean) => void} expandTextDivs
79
+ */
80
+ /**
81
+ * @type {(renderParameters: TextLayerRenderParameters) => TextLayerRenderTask}
82
+ */
83
+ export var renderTextLayer: (renderParameters: TextLayerRenderParameters) => TextLayerRenderTask;