unpdf 0.12.2 → 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.
- package/README.md +147 -79
- package/dist/index.cjs +118 -73
- package/dist/index.d.cts +24 -41
- package/dist/index.d.mts +24 -41
- package/dist/index.d.ts +24 -41
- package/dist/index.mjs +117 -72
- package/dist/pdfjs.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +25 -1
- package/dist/types/src/display/annotation_storage.d.ts +1 -8
- package/dist/types/src/display/api.d.ts +147 -57
- package/dist/types/src/display/canvas.d.ts +21 -28
- package/dist/types/src/display/canvas_factory.d.ts +27 -0
- package/dist/types/src/display/cmap_reader_factory.d.ts +25 -0
- package/dist/types/src/display/display_utils.d.ts +40 -60
- package/dist/types/src/display/draw_layer.d.ts +7 -19
- package/dist/types/src/display/editor/alt_text.d.ts +3 -2
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +16 -11
- package/dist/types/src/display/editor/color_picker.d.ts +1 -0
- package/dist/types/src/display/editor/draw.d.ts +121 -0
- package/dist/types/src/display/editor/drawers/contour.d.ts +3 -0
- package/dist/types/src/display/editor/drawers/freedraw.d.ts +31 -0
- package/dist/types/src/display/editor/drawers/highlight.d.ts +36 -0
- package/dist/types/src/display/editor/drawers/inkdraw.d.ts +129 -0
- package/dist/types/src/display/editor/drawers/outline.d.ts +19 -0
- package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +79 -0
- package/dist/types/src/display/editor/editor.d.ts +55 -13
- package/dist/types/src/display/editor/freetext.d.ts +5 -16
- package/dist/types/src/display/editor/highlight.d.ts +8 -25
- package/dist/types/src/display/editor/ink.d.ts +21 -74
- package/dist/types/src/display/editor/signature.d.ts +80 -0
- package/dist/types/src/display/editor/stamp.d.ts +16 -22
- package/dist/types/src/display/editor/toolbar.d.ts +5 -2
- package/dist/types/src/display/editor/tools.d.ts +17 -9
- package/dist/types/src/display/fetch_stream.d.ts +6 -13
- package/dist/types/src/display/filter_factory.d.ts +29 -0
- package/dist/types/src/display/font_loader.d.ts +3 -6
- package/dist/types/src/display/metadata.d.ts +1 -2
- package/dist/types/src/display/network.d.ts +11 -7
- package/dist/types/src/display/network_utils.d.ts +7 -6
- package/dist/types/src/display/node_stream.d.ts +6 -22
- package/dist/types/src/display/node_utils.d.ts +15 -11
- package/dist/types/src/display/optional_content_config.d.ts +2 -2
- package/dist/types/src/display/pattern_helper.d.ts +4 -2
- package/dist/types/src/display/standard_fontdata_factory.d.ts +20 -0
- package/dist/types/src/display/svg_factory.d.ts +14 -0
- package/dist/types/src/display/text_layer.d.ts +12 -9
- package/dist/types/src/display/touch_manager.d.ts +18 -0
- package/dist/types/src/display/transport_stream.d.ts +1 -1
- package/dist/types/src/display/wasm_factory.d.ts +20 -0
- package/dist/types/src/display/worker_options.d.ts +2 -2
- package/dist/types/src/interfaces.d.ts +4 -0
- package/dist/types/src/pdf.d.ts +13 -5
- package/dist/types/src/shared/message_handler.d.ts +9 -4
- package/dist/types/src/shared/util.d.ts +137 -129
- package/dist/types/web/annotation_editor_layer_builder.d.ts +20 -5
- package/dist/types/web/annotation_layer_builder.d.ts +35 -4
- package/dist/types/web/app_options.d.ts +1 -1
- package/dist/types/web/autolinker.d.ts +28 -0
- package/dist/types/web/base_pdf_page_view.d.ts +27 -0
- package/dist/types/web/draw_layer_builder.d.ts +13 -2
- package/dist/types/web/event_utils.d.ts +2 -2
- package/dist/types/web/genericl10n.d.ts +5 -5
- package/dist/types/web/interfaces.d.ts +5 -5
- package/dist/types/web/l10n.d.ts +2 -2
- package/dist/types/web/pdf_find_controller.d.ts +2 -0
- package/dist/types/web/pdf_link_service.d.ts +1 -2
- package/dist/types/web/pdf_page_detail_view.d.ts +32 -0
- package/dist/types/web/pdf_page_view.d.ts +44 -23
- package/dist/types/web/pdf_rendering_queue.d.ts +2 -1
- package/dist/types/web/pdf_thumbnail_view.d.ts +23 -3
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +21 -1
- package/dist/types/web/pdf_viewer.d.ts +44 -16
- package/dist/types/web/struct_tree_layer_builder.d.ts +20 -2
- package/dist/types/web/text_accessibility.d.ts +1 -1
- package/dist/types/web/text_layer_builder.d.ts +25 -17
- package/dist/types/web/ui_utils.d.ts +3 -19
- package/dist/types/web/xfa_layer_builder.d.ts +14 -3
- package/package.json +31 -28
- package/dist/types/src/display/base_factory.d.ts +0 -60
- package/dist/types/src/display/editor/outliner.d.ts +0 -70
|
@@ -12,7 +12,8 @@ export class AnnotationEditorUIManager {
|
|
|
12
12
|
static TRANSLATE_SMALL: number;
|
|
13
13
|
static TRANSLATE_BIG: number;
|
|
14
14
|
static get _keyboardManager(): any;
|
|
15
|
-
constructor(container: any, viewer: any, altTextManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, enableUpdatedAddImage: any, enableNewAltTextWhenAddingImage: any, mlManager: any);
|
|
15
|
+
constructor(container: any, viewer: any, altTextManager: any, signatureManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, enableUpdatedAddImage: any, enableNewAltTextWhenAddingImage: any, mlManager: any, editorUndoBar: any, supportsPinchToZoom: any);
|
|
16
|
+
_editorUndoBar: null;
|
|
16
17
|
_signal: AbortSignal;
|
|
17
18
|
_eventBus: any;
|
|
18
19
|
viewParameters: {
|
|
@@ -20,6 +21,7 @@ export class AnnotationEditorUIManager {
|
|
|
20
21
|
rotation: number;
|
|
21
22
|
};
|
|
22
23
|
isShiftKeyDown: boolean;
|
|
24
|
+
_supportsPinchToZoom: boolean;
|
|
23
25
|
destroy(): void;
|
|
24
26
|
combinedSignal(ac: any): AbortSignal;
|
|
25
27
|
get mlManager(): null;
|
|
@@ -29,8 +31,15 @@ export class AnnotationEditorUIManager {
|
|
|
29
31
|
get direction(): any;
|
|
30
32
|
get highlightColors(): any;
|
|
31
33
|
get highlightColorNames(): any;
|
|
34
|
+
/**
|
|
35
|
+
* Set the current drawing session.
|
|
36
|
+
* @param {AnnotationEditorLayer} layer
|
|
37
|
+
*/
|
|
38
|
+
setCurrentDrawingSession(layer: AnnotationEditorLayer): void;
|
|
32
39
|
setMainHighlightColorPicker(colorPicker: any): void;
|
|
33
40
|
editAltText(editor: any, firstTime?: boolean): void;
|
|
41
|
+
getSignature(editor: any): void;
|
|
42
|
+
get signatureManager(): null;
|
|
34
43
|
switchToMode(mode: any, callback: any): void;
|
|
35
44
|
setPreference(name: any, value: any): void;
|
|
36
45
|
onSetPreference({ name, value }: {
|
|
@@ -81,7 +90,7 @@ export class AnnotationEditorUIManager {
|
|
|
81
90
|
* Paste callback.
|
|
82
91
|
* @param {ClipboardEvent} event
|
|
83
92
|
*/
|
|
84
|
-
paste(event: ClipboardEvent): void
|
|
93
|
+
paste(event: ClipboardEvent): Promise<void>;
|
|
85
94
|
/**
|
|
86
95
|
* Keydown callback.
|
|
87
96
|
* @param {KeyboardEvent} event
|
|
@@ -133,7 +142,7 @@ export class AnnotationEditorUIManager {
|
|
|
133
142
|
* @param {boolean} [isFromKeyboard] - true if the mode change is due to a
|
|
134
143
|
* keyboard action.
|
|
135
144
|
*/
|
|
136
|
-
updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean
|
|
145
|
+
updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean): Promise<void>;
|
|
137
146
|
addNewEditorFromKeyboard(): void;
|
|
138
147
|
/**
|
|
139
148
|
* Update the toolbar if it's required to reflect the tool currently used.
|
|
@@ -197,6 +206,7 @@ export class AnnotationEditorUIManager {
|
|
|
197
206
|
* @param {AnnotationEditor} editor
|
|
198
207
|
*/
|
|
199
208
|
updateUI(editor: AnnotationEditor): void;
|
|
209
|
+
updateUIForDefaultProperties(editorType: any): void;
|
|
200
210
|
/**
|
|
201
211
|
* Add or remove an editor the current selection.
|
|
202
212
|
* @param {AnnotationEditor} editor
|
|
@@ -233,6 +243,7 @@ export class AnnotationEditorUIManager {
|
|
|
233
243
|
* @param {Object} params
|
|
234
244
|
*/
|
|
235
245
|
addCommands(params: Object): void;
|
|
246
|
+
cleanUndoStack(type: any): void;
|
|
236
247
|
/**
|
|
237
248
|
* Delete the current editor or all.
|
|
238
249
|
*/
|
|
@@ -301,6 +312,8 @@ export class AnnotationEditorUIManager {
|
|
|
301
312
|
annotationElementId: any;
|
|
302
313
|
}): void;
|
|
303
314
|
renderAnnotationElement(annotation: any): void;
|
|
315
|
+
setMissingCanvas(annotationId: any, annotationElementId: any, canvas: any): void;
|
|
316
|
+
addMissingCanvas(annotationId: any, editor: any): void;
|
|
304
317
|
#private;
|
|
305
318
|
}
|
|
306
319
|
export function bindEvents(obj: any, element: any, names: any): void;
|
|
@@ -374,6 +387,7 @@ export class CommandManager {
|
|
|
374
387
|
* @returns {boolean}
|
|
375
388
|
*/
|
|
376
389
|
hasSomethingToRedo(): boolean;
|
|
390
|
+
cleanType(type: any): void;
|
|
377
391
|
destroy(): void;
|
|
378
392
|
#private;
|
|
379
393
|
}
|
|
@@ -402,9 +416,3 @@ export class KeyboardManager {
|
|
|
402
416
|
exec(self: Object, event: KeyboardEvent): void;
|
|
403
417
|
#private;
|
|
404
418
|
}
|
|
405
|
-
/**
|
|
406
|
-
* Convert a number between 0 and 100 into an hex number between 0 and 255.
|
|
407
|
-
* @param {number} opacity
|
|
408
|
-
* @return {string}
|
|
409
|
-
*/
|
|
410
|
-
export function opacityToHex(opacity: number): string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/** @implements {IPDFStream} */
|
|
2
2
|
export class PDFFetchStream implements IPDFStream {
|
|
3
3
|
constructor(source: any);
|
|
4
|
+
_responseOrigin: null;
|
|
4
5
|
source: any;
|
|
5
6
|
isHttp: boolean;
|
|
6
|
-
|
|
7
|
+
headers: Headers;
|
|
7
8
|
_fullRequestReader: PDFFetchStreamReader | null;
|
|
8
9
|
_rangeRequestReaders: any[];
|
|
9
10
|
get _progressiveDataLength(): number;
|
|
@@ -15,7 +16,7 @@ export class PDFFetchStream implements IPDFStream {
|
|
|
15
16
|
declare class PDFFetchStreamReader implements IPDFStreamReader {
|
|
16
17
|
constructor(stream: any);
|
|
17
18
|
_stream: any;
|
|
18
|
-
_reader: ReadableStreamDefaultReader<Uint8Array
|
|
19
|
+
_reader: ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | null;
|
|
19
20
|
_loaded: number;
|
|
20
21
|
_filename: string | null;
|
|
21
22
|
_withCredentials: any;
|
|
@@ -26,7 +27,6 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
|
|
|
26
27
|
_abortController: AbortController;
|
|
27
28
|
_isStreamingSupported: boolean;
|
|
28
29
|
_isRangeSupported: boolean;
|
|
29
|
-
_headers: Headers;
|
|
30
30
|
onProgress: any;
|
|
31
31
|
get headersReady(): any;
|
|
32
32
|
get filename(): string | null;
|
|
@@ -34,10 +34,7 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
|
|
|
34
34
|
get isRangeSupported(): boolean;
|
|
35
35
|
get isStreamingSupported(): boolean;
|
|
36
36
|
read(): Promise<{
|
|
37
|
-
value:
|
|
38
|
-
done: true;
|
|
39
|
-
} | {
|
|
40
|
-
value: ArrayBufferLike;
|
|
37
|
+
value: any;
|
|
41
38
|
done: boolean;
|
|
42
39
|
}>;
|
|
43
40
|
cancel(reason: any): void;
|
|
@@ -46,20 +43,16 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
|
|
|
46
43
|
declare class PDFFetchStreamRangeReader implements IPDFStreamRangeReader {
|
|
47
44
|
constructor(stream: any, begin: any, end: any);
|
|
48
45
|
_stream: any;
|
|
49
|
-
_reader: ReadableStreamDefaultReader<Uint8Array
|
|
46
|
+
_reader: ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | null;
|
|
50
47
|
_loaded: number;
|
|
51
48
|
_withCredentials: any;
|
|
52
49
|
_readCapability: any;
|
|
53
50
|
_isStreamingSupported: boolean;
|
|
54
51
|
_abortController: AbortController;
|
|
55
|
-
_headers: Headers;
|
|
56
52
|
onProgress: any;
|
|
57
53
|
get isStreamingSupported(): boolean;
|
|
58
54
|
read(): Promise<{
|
|
59
|
-
value:
|
|
60
|
-
done: true;
|
|
61
|
-
} | {
|
|
62
|
-
value: ArrayBufferLike;
|
|
55
|
+
value: any;
|
|
63
56
|
done: boolean;
|
|
64
57
|
}>;
|
|
65
58
|
cancel(reason: any): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export class BaseFilterFactory {
|
|
2
|
+
addFilter(maps: any): string;
|
|
3
|
+
addHCMFilter(fgColor: any, bgColor: any): string;
|
|
4
|
+
addAlphaFilter(map: any): string;
|
|
5
|
+
addLuminosityFilter(map: any): string;
|
|
6
|
+
addHighlightHCMFilter(filterName: any, fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): string;
|
|
7
|
+
destroy(keepHCM?: boolean): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* FilterFactory aims to create some SVG filters we can use when drawing an
|
|
11
|
+
* image (or whatever) on a canvas.
|
|
12
|
+
* Filters aren't applied with ctx.putImageData because it just overwrites the
|
|
13
|
+
* underlying pixels.
|
|
14
|
+
* With these filters, it's possible for example to apply some transfer maps on
|
|
15
|
+
* an image without the need to apply them on the pixel arrays: the renderer
|
|
16
|
+
* does the magic for us.
|
|
17
|
+
*/
|
|
18
|
+
export class DOMFilterFactory extends BaseFilterFactory {
|
|
19
|
+
constructor({ docId, ownerDocument }: {
|
|
20
|
+
docId: any;
|
|
21
|
+
ownerDocument?: Document | undefined;
|
|
22
|
+
});
|
|
23
|
+
addFilter(maps: any): any;
|
|
24
|
+
addHCMFilter(fgColor: any, bgColor: any): any;
|
|
25
|
+
addAlphaFilter(map: any): any;
|
|
26
|
+
addLuminosityFilter(map: any): any;
|
|
27
|
+
addHighlightHCMFilter(filterName: any, fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): any;
|
|
28
|
+
#private;
|
|
29
|
+
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
export class FontFaceObject {
|
|
2
|
-
constructor(translatedData: any,
|
|
3
|
-
disableFontFace?: boolean | undefined;
|
|
4
|
-
inspectFont?: null | undefined;
|
|
5
|
-
});
|
|
2
|
+
constructor(translatedData: any, inspectFont?: null);
|
|
6
3
|
compiledGlyphs: any;
|
|
7
|
-
disableFontFace: boolean;
|
|
8
4
|
_inspectFont: any;
|
|
9
5
|
createNativeFontFace(): FontFace | null;
|
|
10
6
|
createFontFaceRule(): string | null;
|
|
@@ -24,8 +20,9 @@ export class FontLoader {
|
|
|
24
20
|
removeNativeFontFace(nativeFontFace: any): void;
|
|
25
21
|
insertRule(rule: any): void;
|
|
26
22
|
clear(): void;
|
|
27
|
-
loadSystemFont({ systemFontInfo: info, _inspectFont }: {
|
|
23
|
+
loadSystemFont({ systemFontInfo: info, disableFontFace, _inspectFont, }: {
|
|
28
24
|
systemFontInfo: any;
|
|
25
|
+
disableFontFace: any;
|
|
29
26
|
_inspectFont: any;
|
|
30
27
|
}): Promise<void>;
|
|
31
28
|
bind(font: any): Promise<void>;
|
|
@@ -12,15 +12,18 @@ export class PDFNetworkStream implements IPDFStream {
|
|
|
12
12
|
cancelAllRequests(reason: any): void;
|
|
13
13
|
}
|
|
14
14
|
declare class NetworkManager {
|
|
15
|
-
constructor(url
|
|
15
|
+
constructor({ url, httpHeaders, withCredentials }: {
|
|
16
|
+
url: any;
|
|
17
|
+
httpHeaders: any;
|
|
18
|
+
withCredentials: any;
|
|
19
|
+
});
|
|
20
|
+
_responseOrigin: null;
|
|
16
21
|
url: any;
|
|
17
22
|
isHttp: boolean;
|
|
18
|
-
|
|
23
|
+
headers: Headers;
|
|
19
24
|
withCredentials: any;
|
|
20
25
|
currXhrId: number;
|
|
21
26
|
pendingRequests: any;
|
|
22
|
-
requestRange(begin: any, end: any, listeners: any): number;
|
|
23
|
-
requestFull(listeners: any): number;
|
|
24
27
|
request(args: any): number;
|
|
25
28
|
onProgress(xhrId: any, evt: any): void;
|
|
26
29
|
onStateChange(xhrId: any, evt: any): void;
|
|
@@ -34,7 +37,7 @@ declare class PDFNetworkStreamFullRequestReader implements IPDFStreamReader {
|
|
|
34
37
|
_manager: any;
|
|
35
38
|
_url: any;
|
|
36
39
|
_fullRequestId: any;
|
|
37
|
-
|
|
40
|
+
_headersCapability: any;
|
|
38
41
|
_disableRange: any;
|
|
39
42
|
_contentLength: any;
|
|
40
43
|
_rangeChunkSize: any;
|
|
@@ -43,7 +46,7 @@ declare class PDFNetworkStreamFullRequestReader implements IPDFStreamReader {
|
|
|
43
46
|
_cachedChunks: any[];
|
|
44
47
|
_requests: any[];
|
|
45
48
|
_done: boolean;
|
|
46
|
-
_storedError: import("../shared/util.js").
|
|
49
|
+
_storedError: import("../shared/util.js").ResponseException | undefined;
|
|
47
50
|
_filename: string | null;
|
|
48
51
|
onProgress: any;
|
|
49
52
|
_onHeadersReceived(): void;
|
|
@@ -68,9 +71,10 @@ declare class PDFNetworkStreamRangeRequestReader implements IPDFStreamRangeReade
|
|
|
68
71
|
_requests: any[];
|
|
69
72
|
_queuedChunk: any;
|
|
70
73
|
_done: boolean;
|
|
71
|
-
_storedError:
|
|
74
|
+
_storedError: Error | undefined;
|
|
72
75
|
onProgress: any;
|
|
73
76
|
onClosed: any;
|
|
77
|
+
_onHeadersReceived(): void;
|
|
74
78
|
_close(): void;
|
|
75
79
|
_onDone(data: any): void;
|
|
76
80
|
_onError(status: any): void;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export function
|
|
2
|
-
export function
|
|
3
|
-
export function
|
|
4
|
-
|
|
1
|
+
export function createHeaders(isHttp: any, httpHeaders: any): Headers;
|
|
2
|
+
export function createResponseError(status: any, url: any): ResponseException;
|
|
3
|
+
export function extractFilenameFromHeader(responseHeaders: any): string | null;
|
|
4
|
+
export function getResponseOrigin(url: any): string | null;
|
|
5
|
+
export function validateRangeRequestCapabilities({ responseHeaders, isHttp, rangeChunkSize, disableRange, }: {
|
|
6
|
+
responseHeaders: any;
|
|
5
7
|
isHttp: any;
|
|
6
8
|
rangeChunkSize: any;
|
|
7
9
|
disableRange: any;
|
|
@@ -10,5 +12,4 @@ export function validateRangeRequestCapabilities({ getResponseHeader, isHttp, ra
|
|
|
10
12
|
suggestedLength: undefined;
|
|
11
13
|
};
|
|
12
14
|
export function validateResponseStatus(status: any): boolean;
|
|
13
|
-
import {
|
|
14
|
-
import { UnexpectedResponseException } from "../shared/util.js";
|
|
15
|
+
import { ResponseException } from "../shared/util.js";
|
|
@@ -2,30 +2,14 @@ export class PDFNodeStream {
|
|
|
2
2
|
constructor(source: any);
|
|
3
3
|
source: any;
|
|
4
4
|
url: URL;
|
|
5
|
-
|
|
6
|
-
isFsUrl: boolean;
|
|
7
|
-
httpHeaders: any;
|
|
8
|
-
_fullRequestReader: PDFNodeStreamFsFullReader | PDFNodeStreamFullReader | null;
|
|
5
|
+
_fullRequestReader: PDFNodeStreamFsFullReader | null;
|
|
9
6
|
_rangeRequestReaders: any[];
|
|
10
7
|
get _progressiveDataLength(): number;
|
|
11
|
-
getFullReader(): PDFNodeStreamFsFullReader
|
|
12
|
-
getRangeReader(start: any, end: any): PDFNodeStreamFsRangeReader |
|
|
8
|
+
getFullReader(): PDFNodeStreamFsFullReader;
|
|
9
|
+
getRangeReader(start: any, end: any): PDFNodeStreamFsRangeReader | null;
|
|
13
10
|
cancelAllRequests(reason: any): void;
|
|
14
11
|
}
|
|
15
|
-
declare class PDFNodeStreamFsFullReader
|
|
16
|
-
}
|
|
17
|
-
declare class PDFNodeStreamFullReader extends BaseFullReader {
|
|
18
|
-
_request: any;
|
|
19
|
-
}
|
|
20
|
-
declare class PDFNodeStreamFsRangeReader extends BaseRangeReader {
|
|
21
|
-
constructor(stream: any, start: any, end: any);
|
|
22
|
-
}
|
|
23
|
-
declare class PDFNodeStreamRangeReader extends BaseRangeReader {
|
|
24
|
-
constructor(stream: any, start: any, end: any);
|
|
25
|
-
_httpHeaders: {};
|
|
26
|
-
_request: any;
|
|
27
|
-
}
|
|
28
|
-
declare class BaseFullReader {
|
|
12
|
+
declare class PDFNodeStreamFsFullReader {
|
|
29
13
|
constructor(stream: any);
|
|
30
14
|
_url: any;
|
|
31
15
|
_done: boolean;
|
|
@@ -51,8 +35,8 @@ declare class BaseFullReader {
|
|
|
51
35
|
_error(reason: any): void;
|
|
52
36
|
_setReadableStream(readableStream: any): void;
|
|
53
37
|
}
|
|
54
|
-
declare class
|
|
55
|
-
constructor(stream: any);
|
|
38
|
+
declare class PDFNodeStreamFsRangeReader {
|
|
39
|
+
constructor(stream: any, start: any, end: any);
|
|
56
40
|
_url: any;
|
|
57
41
|
_done: boolean;
|
|
58
42
|
_storedError: any;
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
+
export function fetchData(url: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
1
2
|
export class NodeCanvasFactory extends BaseCanvasFactory {
|
|
2
3
|
/**
|
|
3
4
|
* @ignore
|
|
4
5
|
*/
|
|
5
|
-
_createCanvas(width: any, height: any):
|
|
6
|
+
_createCanvas(width: any, height: any): import("@napi-rs/canvas").Canvas;
|
|
6
7
|
}
|
|
7
8
|
export class NodeCMapReaderFactory extends BaseCMapReaderFactory {
|
|
8
9
|
/**
|
|
9
10
|
* @ignore
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
_fetch(url: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
12
13
|
}
|
|
13
14
|
export class NodeFilterFactory extends BaseFilterFactory {
|
|
14
15
|
}
|
|
15
|
-
export class NodePackages {
|
|
16
|
-
static get promise(): any;
|
|
17
|
-
static get(name: any): any;
|
|
18
|
-
}
|
|
19
16
|
export class NodeStandardFontDataFactory extends BaseStandardFontDataFactory {
|
|
20
17
|
/**
|
|
21
18
|
* @ignore
|
|
22
19
|
*/
|
|
23
|
-
|
|
20
|
+
_fetch(url: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
21
|
+
}
|
|
22
|
+
export class NodeWasmFactory extends BaseWasmFactory {
|
|
23
|
+
/**
|
|
24
|
+
* @ignore
|
|
25
|
+
*/
|
|
26
|
+
_fetch(url: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
24
27
|
}
|
|
25
|
-
import { BaseCanvasFactory } from "./
|
|
26
|
-
import { BaseCMapReaderFactory } from "./
|
|
27
|
-
import { BaseFilterFactory } from "./
|
|
28
|
-
import { BaseStandardFontDataFactory } from "./
|
|
28
|
+
import { BaseCanvasFactory } from "./canvas_factory.js";
|
|
29
|
+
import { BaseCMapReaderFactory } from "./cmap_reader_factory.js";
|
|
30
|
+
import { BaseFilterFactory } from "./filter_factory.js";
|
|
31
|
+
import { BaseStandardFontDataFactory } from "./standard_fontdata_factory.js";
|
|
32
|
+
import { BaseWasmFactory } from "./wasm_factory.js";
|
|
@@ -4,15 +4,15 @@ export class OptionalContentConfig {
|
|
|
4
4
|
name: any;
|
|
5
5
|
creator: any;
|
|
6
6
|
isVisible(group: any): any;
|
|
7
|
-
setVisibility(id: any, visible?: boolean): void;
|
|
7
|
+
setVisibility(id: any, visible?: boolean, preserveRB?: boolean): void;
|
|
8
8
|
setOCGState({ state, preserveRB }: {
|
|
9
9
|
state: any;
|
|
10
10
|
preserveRB: any;
|
|
11
11
|
}): void;
|
|
12
12
|
get hasInitialVisibility(): boolean;
|
|
13
13
|
getOrder(): any;
|
|
14
|
-
getGroups(): any;
|
|
15
14
|
getGroup(id: any): any;
|
|
16
15
|
getHash(): string;
|
|
16
|
+
[Symbol.iterator](): MapIterator<[any, any]>;
|
|
17
17
|
#private;
|
|
18
18
|
}
|
|
@@ -6,7 +6,8 @@ export namespace PathType {
|
|
|
6
6
|
}
|
|
7
7
|
export class TilingPattern {
|
|
8
8
|
static MAX_PATTERN_SIZE: number;
|
|
9
|
-
constructor(IR: any,
|
|
9
|
+
constructor(IR: any, ctx: any, canvasGraphicsFactory: any, baseTransform: any);
|
|
10
|
+
color: any;
|
|
10
11
|
operatorList: any;
|
|
11
12
|
matrix: any;
|
|
12
13
|
bbox: any;
|
|
@@ -14,7 +15,6 @@ export class TilingPattern {
|
|
|
14
15
|
ystep: any;
|
|
15
16
|
paintType: any;
|
|
16
17
|
tilingType: any;
|
|
17
|
-
color: any;
|
|
18
18
|
ctx: any;
|
|
19
19
|
canvasGraphicsFactory: any;
|
|
20
20
|
baseTransform: any;
|
|
@@ -31,6 +31,7 @@ export class TilingPattern {
|
|
|
31
31
|
};
|
|
32
32
|
clipBbox(graphics: any, x0: any, y0: any, x1: any, y1: any): void;
|
|
33
33
|
setFillAndStrokeStyleToContext(graphics: any, paintType: any, color: any): void;
|
|
34
|
+
isModifyingCurrentTransform(): boolean;
|
|
34
35
|
getPattern(ctx: any, owner: any, inverse: any, pathType: any): any;
|
|
35
36
|
}
|
|
36
37
|
declare class RadialAxialShadingPattern extends BaseShadingPattern {
|
|
@@ -68,6 +69,7 @@ declare class DummyShadingPattern extends BaseShadingPattern {
|
|
|
68
69
|
getPattern(): string;
|
|
69
70
|
}
|
|
70
71
|
declare class BaseShadingPattern {
|
|
72
|
+
isModifyingCurrentTransform(): boolean;
|
|
71
73
|
getPattern(): void;
|
|
72
74
|
}
|
|
73
75
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class BaseStandardFontDataFactory {
|
|
2
|
+
constructor({ baseUrl }: {
|
|
3
|
+
baseUrl?: null | undefined;
|
|
4
|
+
});
|
|
5
|
+
baseUrl: any;
|
|
6
|
+
fetch({ filename }: {
|
|
7
|
+
filename: any;
|
|
8
|
+
}): Promise<Uint8Array<ArrayBufferLike>>;
|
|
9
|
+
/**
|
|
10
|
+
* @ignore
|
|
11
|
+
* @returns {Promise<Uint8Array>}
|
|
12
|
+
*/
|
|
13
|
+
_fetch(url: any): Promise<Uint8Array>;
|
|
14
|
+
}
|
|
15
|
+
export class DOMStandardFontDataFactory extends BaseStandardFontDataFactory {
|
|
16
|
+
/**
|
|
17
|
+
* @ignore
|
|
18
|
+
*/
|
|
19
|
+
_fetch(url: any): Promise<Uint8Array<any>>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class BaseSVGFactory {
|
|
2
|
+
create(width: any, height: any, skipDimensions?: boolean): void;
|
|
3
|
+
createElement(type: any): void;
|
|
4
|
+
/**
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
7
|
+
_createSVG(type: any): void;
|
|
8
|
+
}
|
|
9
|
+
export class DOMSVGFactory extends BaseSVGFactory {
|
|
10
|
+
/**
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
13
|
+
_createSVG(type: any): any;
|
|
14
|
+
}
|
|
@@ -31,21 +31,24 @@ export type TextLayerUpdateParameters = {
|
|
|
31
31
|
onBefore?: Function | undefined;
|
|
32
32
|
};
|
|
33
33
|
export class TextLayer {
|
|
34
|
-
static "__#
|
|
35
|
-
static "__#
|
|
36
|
-
static "__#
|
|
37
|
-
static "__#
|
|
34
|
+
static "__#54@#ascentCache": Map<any, any>;
|
|
35
|
+
static "__#54@#canvasContexts": Map<any, any>;
|
|
36
|
+
static "__#54@#canvasCtxFonts": WeakMap<object, any>;
|
|
37
|
+
static "__#54@#minFontSize": null;
|
|
38
|
+
static "__#54@#pendingTextLayers": Set<any>;
|
|
39
|
+
static get fontFamilyMap(): any;
|
|
38
40
|
/**
|
|
39
41
|
* Clean-up global textLayer data.
|
|
40
42
|
* @returns {undefined}
|
|
41
43
|
*/
|
|
42
44
|
static cleanup(): undefined;
|
|
43
|
-
static "__#
|
|
45
|
+
static "__#54@#getCtx"(lang?: null): any;
|
|
46
|
+
static "__#54@#ensureCtxFont"(ctx: any, size: any, family: any): void;
|
|
44
47
|
/**
|
|
45
48
|
* Compute the minimum font size enforced by the browser.
|
|
46
49
|
*/
|
|
47
|
-
static "__#
|
|
48
|
-
static "__#
|
|
50
|
+
static "__#54@#ensureMinFontSizeComputed"(): void;
|
|
51
|
+
static "__#54@#getAscent"(fontFamily: any, style: any, lang: any): any;
|
|
49
52
|
/**
|
|
50
53
|
* @param {TextLayerParameters} options
|
|
51
54
|
*/
|
|
@@ -71,12 +74,12 @@ export class TextLayer {
|
|
|
71
74
|
* of the textContent input.
|
|
72
75
|
* This is output and will initially be set to an empty array.
|
|
73
76
|
*/
|
|
74
|
-
get textDivs(): HTMLElement
|
|
77
|
+
get textDivs(): Array<HTMLElement>;
|
|
75
78
|
/**
|
|
76
79
|
* @type {Array<string>} Strings that correspond to the `str` property of
|
|
77
80
|
* the text items of the textContent input.
|
|
78
81
|
* This is output and will initially be set to an empty array
|
|
79
82
|
*/
|
|
80
|
-
get textContentItemsStr(): string
|
|
83
|
+
get textContentItemsStr(): Array<string>;
|
|
81
84
|
#private;
|
|
82
85
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class TouchManager {
|
|
2
|
+
constructor({ container, isPinchingDisabled, isPinchingStopped, onPinchStart, onPinching, onPinchEnd, signal, }: {
|
|
3
|
+
container: any;
|
|
4
|
+
isPinchingDisabled?: null | undefined;
|
|
5
|
+
isPinchingStopped?: null | undefined;
|
|
6
|
+
onPinchStart?: null | undefined;
|
|
7
|
+
onPinching?: null | undefined;
|
|
8
|
+
onPinchEnd?: null | undefined;
|
|
9
|
+
signal: any;
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* NOTE: Don't shadow this value since `devicePixelRatio` may change if the
|
|
13
|
+
* window resolution changes, e.g. if the viewer is moved to another monitor.
|
|
14
|
+
*/
|
|
15
|
+
get MIN_TOUCH_DISTANCE_TO_PINCH(): number;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
#private;
|
|
18
|
+
}
|
|
@@ -7,7 +7,7 @@ export class PDFDataTransportStream implements IPDFStream {
|
|
|
7
7
|
disableRange?: boolean | undefined;
|
|
8
8
|
disableStream?: boolean | undefined;
|
|
9
9
|
});
|
|
10
|
-
_queuedChunks:
|
|
10
|
+
_queuedChunks: any[];
|
|
11
11
|
_progressiveDone: any;
|
|
12
12
|
_contentDispositionFilename: any;
|
|
13
13
|
_pdfDataRangeTransport: any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class BaseWasmFactory {
|
|
2
|
+
constructor({ baseUrl }: {
|
|
3
|
+
baseUrl?: null | undefined;
|
|
4
|
+
});
|
|
5
|
+
baseUrl: any;
|
|
6
|
+
fetch({ filename }: {
|
|
7
|
+
filename: any;
|
|
8
|
+
}): Promise<Uint8Array<ArrayBufferLike>>;
|
|
9
|
+
/**
|
|
10
|
+
* @ignore
|
|
11
|
+
* @returns {Promise<Uint8Array>}
|
|
12
|
+
*/
|
|
13
|
+
_fetch(url: any): Promise<Uint8Array>;
|
|
14
|
+
}
|
|
15
|
+
export class DOMWasmFactory extends BaseWasmFactory {
|
|
16
|
+
/**
|
|
17
|
+
* @ignore
|
|
18
|
+
*/
|
|
19
|
+
_fetch(url: any): Promise<Uint8Array<any>>;
|
|
20
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export class GlobalWorkerOptions {
|
|
2
|
-
static "__#
|
|
3
|
-
static "__#
|
|
2
|
+
static "__#50@#port": null;
|
|
3
|
+
static "__#50@#src": string;
|
|
4
4
|
/**
|
|
5
5
|
* @param {Worker | null} workerPort - Defines global port for worker process.
|
|
6
6
|
* Overrides the `workerSrc` option.
|
|
@@ -12,6 +12,10 @@ export class IPDFStream {
|
|
|
12
12
|
getFullReader(): IPDFStreamReader;
|
|
13
13
|
/**
|
|
14
14
|
* Gets a reader for the range of the PDF data.
|
|
15
|
+
*
|
|
16
|
+
* NOTE: Currently this method is only expected to be invoked *after*
|
|
17
|
+
* the `IPDFStreamReader.prototype.headersReady` promise has resolved.
|
|
18
|
+
*
|
|
15
19
|
* @param {number} begin - the start offset of the data.
|
|
16
20
|
* @param {number} end - the end offset of the data.
|
|
17
21
|
* @returns {IPDFStreamRangeReader}
|
package/dist/types/src/pdf.d.ts
CHANGED
|
@@ -11,27 +11,30 @@ import { AnnotationEditorType } from "./shared/util.js";
|
|
|
11
11
|
import { AnnotationEditorUIManager } from "./display/editor/tools.js";
|
|
12
12
|
import { AnnotationLayer } from "./display/annotation_layer.js";
|
|
13
13
|
import { AnnotationMode } from "./shared/util.js";
|
|
14
|
+
import { AnnotationType } from "./shared/util.js";
|
|
14
15
|
import { build } from "./display/api.js";
|
|
15
|
-
import { CMapCompressionType } from "./shared/util.js";
|
|
16
16
|
import { ColorPicker } from "./display/editor/color_picker.js";
|
|
17
17
|
import { createValidAbsoluteUrl } from "./shared/util.js";
|
|
18
|
-
import { DOMSVGFactory } from "./display/
|
|
18
|
+
import { DOMSVGFactory } from "./display/svg_factory.js";
|
|
19
19
|
import { DrawLayer } from "./display/draw_layer.js";
|
|
20
20
|
import { FeatureTest } from "./shared/util.js";
|
|
21
21
|
import { fetchData } from "./display/display_utils.js";
|
|
22
22
|
import { getDocument } from "./display/api.js";
|
|
23
23
|
import { getFilenameFromUrl } from "./display/display_utils.js";
|
|
24
24
|
import { getPdfFilenameFromUrl } from "./display/display_utils.js";
|
|
25
|
+
import { getUuid } from "./shared/util.js";
|
|
25
26
|
import { getXfaPageViewport } from "./display/display_utils.js";
|
|
26
27
|
import { GlobalWorkerOptions } from "./display/worker_options.js";
|
|
27
28
|
import { ImageKind } from "./shared/util.js";
|
|
28
29
|
import { InvalidPDFException } from "./shared/util.js";
|
|
29
30
|
import { isDataScheme } from "./display/display_utils.js";
|
|
30
31
|
import { isPdfFile } from "./display/display_utils.js";
|
|
31
|
-
import {
|
|
32
|
+
import { isValidExplicitDest } from "./display/api.js";
|
|
33
|
+
import { MathClamp } from "./shared/util.js";
|
|
32
34
|
import { noContextMenu } from "./display/display_utils.js";
|
|
33
35
|
import { normalizeUnicode } from "./shared/util.js";
|
|
34
36
|
import { OPS } from "./shared/util.js";
|
|
37
|
+
import { OutputScale } from "./display/display_utils.js";
|
|
35
38
|
import { PasswordResponses } from "./shared/util.js";
|
|
36
39
|
import { PDFDataRangeTransport } from "./display/api.js";
|
|
37
40
|
import { PDFDateString } from "./display/display_utils.js";
|
|
@@ -39,12 +42,17 @@ import { PDFWorker } from "./display/api.js";
|
|
|
39
42
|
import { PermissionFlag } from "./shared/util.js";
|
|
40
43
|
import { PixelsPerInch } from "./display/display_utils.js";
|
|
41
44
|
import { RenderingCancelledException } from "./display/display_utils.js";
|
|
45
|
+
import { ResponseException } from "./shared/util.js";
|
|
42
46
|
import { setLayerDimensions } from "./display/display_utils.js";
|
|
43
47
|
import { shadow } from "./shared/util.js";
|
|
48
|
+
import { SignatureExtractor } from "./display/editor/drawers/signaturedraw.js";
|
|
49
|
+
import { stopEvent } from "./display/display_utils.js";
|
|
50
|
+
import { SupportedImageMimeTypes } from "./display/display_utils.js";
|
|
44
51
|
import { TextLayer } from "./display/text_layer.js";
|
|
45
|
-
import {
|
|
52
|
+
import { TouchManager } from "./display/touch_manager.js";
|
|
53
|
+
import { updateUrlHash } from "./shared/util.js";
|
|
46
54
|
import { Util } from "./shared/util.js";
|
|
47
55
|
import { VerbosityLevel } from "./shared/util.js";
|
|
48
56
|
import { version } from "./display/api.js";
|
|
49
57
|
import { XfaLayer } from "./display/xfa_layer.js";
|
|
50
|
-
export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode,
|
|
58
|
+
export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, AnnotationType, build, ColorPicker, createValidAbsoluteUrl, DOMSVGFactory, DrawLayer, FeatureTest, fetchData, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getUuid, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, isPdfFile, isValidExplicitDest, MathClamp, noContextMenu, normalizeUnicode, OPS, OutputScale, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, PermissionFlag, PixelsPerInch, RenderingCancelledException, ResponseException, setLayerDimensions, shadow, SignatureExtractor, stopEvent, SupportedImageMimeTypes, TextLayer, TouchManager, updateUrlHash, Util, VerbosityLevel, version, XfaLayer };
|