pdfjs-serverless 0.7.0 → 1.0.1
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 +66 -82
- package/dist/index.d.mts +17 -0
- package/dist/index.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +14 -0
- package/dist/types/src/display/annotation_storage.d.ts +1 -8
- package/dist/types/src/display/api.d.ts +80 -34
- package/dist/types/src/display/canvas.d.ts +19 -27
- package/dist/types/src/display/display_utils.d.ts +11 -0
- package/dist/types/src/display/draw_layer.d.ts +2 -1
- package/dist/types/src/display/editor/alt_text.d.ts +1 -1
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +4 -3
- package/dist/types/src/display/editor/draw.d.ts +2 -1
- package/dist/types/src/display/editor/drawers/contour.d.ts +3 -0
- package/dist/types/src/display/editor/drawers/inkdraw.d.ts +2 -1
- package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +79 -0
- package/dist/types/src/display/editor/editor.d.ts +5 -2
- package/dist/types/src/display/editor/highlight.d.ts +1 -0
- package/dist/types/src/display/editor/ink.d.ts +8 -2
- package/dist/types/src/display/editor/signature.d.ts +80 -0
- package/dist/types/src/display/editor/stamp.d.ts +3 -5
- package/dist/types/src/display/editor/toolbar.d.ts +2 -0
- package/dist/types/src/display/editor/tools.d.ts +5 -7
- package/dist/types/src/display/font_loader.d.ts +3 -8
- package/dist/types/src/display/metadata.d.ts +1 -2
- package/dist/types/src/display/network.d.ts +1 -1
- package/dist/types/src/display/network_utils.d.ts +2 -3
- package/dist/types/src/display/node_utils.d.ts +7 -0
- package/dist/types/src/display/optional_content_config.d.ts +1 -1
- package/dist/types/src/display/pattern_helper.d.ts +4 -2
- package/dist/types/src/display/text_layer.d.ts +9 -9
- package/dist/types/src/display/touch_manager.d.ts +5 -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/pdf.d.ts +9 -3
- package/dist/types/src/shared/message_handler.d.ts +2 -3
- package/dist/types/src/shared/util.d.ts +128 -109
- package/dist/types/web/annotation_editor_layer_builder.d.ts +15 -3
- package/dist/types/web/annotation_layer_builder.d.ts +35 -5
- 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/pdf_find_controller.d.ts +2 -0
- package/dist/types/web/pdf_link_service.d.ts +0 -1
- package/dist/types/web/pdf_page_detail_view.d.ts +32 -0
- package/dist/types/web/pdf_page_view.d.ts +41 -14
- 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 +31 -0
- package/dist/types/web/struct_tree_layer_builder.d.ts +17 -1
- package/dist/types/web/text_layer_builder.d.ts +25 -17
- package/dist/types/web/xfa_layer_builder.d.ts +14 -3
- package/package.json +13 -21
- package/dist/index.d.ts +0 -4
|
@@ -60,6 +60,20 @@ export type PDFPageViewOptions = {
|
|
|
60
60
|
* CSS-only zooming. The default value is 4096 * 8192 (32 mega-pixels).
|
|
61
61
|
*/
|
|
62
62
|
maxCanvasPixels?: number | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* - The maximum supported canvas dimension,
|
|
65
|
+
* in either width or height. Use `-1` for no limit.
|
|
66
|
+
* The default value is 32767.
|
|
67
|
+
*/
|
|
68
|
+
maxCanvasDim?: number | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* - When enabled, if the rendered
|
|
71
|
+
* pages would need a canvas that is larger than `maxCanvasPixels` or
|
|
72
|
+
* `maxCanvasDim`, it will draw a second canvas on top of the CSS-zoomed one,
|
|
73
|
+
* that only renders the part of the page that is close to the viewport.
|
|
74
|
+
* The default value is `true`.
|
|
75
|
+
*/
|
|
76
|
+
enableDetailCanvas?: boolean | undefined;
|
|
63
77
|
/**
|
|
64
78
|
* - Overwrites background and foreground colors
|
|
65
79
|
* with user defined ones in order to improve readability in high contrast
|
|
@@ -80,16 +94,20 @@ export type PDFPageViewOptions = {
|
|
|
80
94
|
* rendering. The default value is `false`.
|
|
81
95
|
*/
|
|
82
96
|
enableHWA?: boolean | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* - Enable creation of hyperlinks from
|
|
99
|
+
* text that look like URLs. The default value is `true`.
|
|
100
|
+
*/
|
|
101
|
+
enableAutoLinking?: boolean | undefined;
|
|
83
102
|
};
|
|
84
103
|
/**
|
|
85
104
|
* @implements {IRenderableView}
|
|
86
105
|
*/
|
|
87
|
-
export class PDFPageView implements IRenderableView {
|
|
106
|
+
export class PDFPageView extends BasePDFPageView implements IRenderableView {
|
|
88
107
|
/**
|
|
89
108
|
* @param {PDFPageViewOptions} options
|
|
90
109
|
*/
|
|
91
110
|
constructor(options: PDFPageViewOptions);
|
|
92
|
-
id: number;
|
|
93
111
|
renderingId: string;
|
|
94
112
|
pdfPage: any;
|
|
95
113
|
pageLabel: string | null;
|
|
@@ -99,13 +117,10 @@ export class PDFPageView implements IRenderableView {
|
|
|
99
117
|
pdfPageRotate: number;
|
|
100
118
|
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null;
|
|
101
119
|
imageResourcesPath: string;
|
|
120
|
+
enableDetailCanvas: boolean;
|
|
102
121
|
maxCanvasPixels: any;
|
|
103
|
-
|
|
104
|
-
eventBus: import("./event_utils").EventBus;
|
|
105
|
-
renderingQueue: import("./pdf_rendering_queue").PDFRenderingQueue | undefined;
|
|
122
|
+
maxCanvasDim: any;
|
|
106
123
|
l10n: import("./interfaces").IL10n | GenericL10n | undefined;
|
|
107
|
-
renderTask: any;
|
|
108
|
-
resume: (() => void) | null;
|
|
109
124
|
_isStandalone: boolean | undefined;
|
|
110
125
|
_container: HTMLDivElement | undefined;
|
|
111
126
|
_annotationCanvasMap: any;
|
|
@@ -115,22 +130,22 @@ export class PDFPageView implements IRenderableView {
|
|
|
115
130
|
xfaLayer: XfaLayerBuilder | null;
|
|
116
131
|
structTreeLayer: any;
|
|
117
132
|
drawLayer: any;
|
|
133
|
+
detailView: any;
|
|
118
134
|
div: HTMLDivElement;
|
|
119
|
-
set renderingState(state: number);
|
|
120
|
-
get renderingState(): number;
|
|
121
135
|
setPdfPage(pdfPage: any): void;
|
|
122
136
|
destroy(): void;
|
|
123
137
|
hasEditableAnnotations(): boolean;
|
|
124
138
|
get _textHighlighter(): any;
|
|
125
|
-
|
|
126
|
-
reset({ keepAnnotationLayer, keepAnnotationEditorLayer, keepXfaLayer, keepTextLayer, keepCanvasWrapper, }?: {
|
|
139
|
+
reset({ keepAnnotationLayer, keepAnnotationEditorLayer, keepXfaLayer, keepTextLayer, keepCanvasWrapper, preserveDetailViewState, }?: {
|
|
127
140
|
keepAnnotationLayer?: boolean | undefined;
|
|
128
141
|
keepAnnotationEditorLayer?: boolean | undefined;
|
|
129
142
|
keepXfaLayer?: boolean | undefined;
|
|
130
143
|
keepTextLayer?: boolean | undefined;
|
|
131
144
|
keepCanvasWrapper?: boolean | undefined;
|
|
145
|
+
preserveDetailViewState?: boolean | undefined;
|
|
132
146
|
}): void;
|
|
133
147
|
toggleEditingMode(isEditing: any): void;
|
|
148
|
+
updateVisibleArea(visibleArea: any): void;
|
|
134
149
|
/**
|
|
135
150
|
* @typedef {Object} PDFPageViewUpdateParameters
|
|
136
151
|
* @property {number} [scale] The new scale, if specified.
|
|
@@ -159,6 +174,7 @@ export class PDFPageView implements IRenderableView {
|
|
|
159
174
|
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | undefined;
|
|
160
175
|
drawingDelay?: number | undefined;
|
|
161
176
|
}): void;
|
|
177
|
+
outputScale: OutputScale | undefined;
|
|
162
178
|
/**
|
|
163
179
|
* PLEASE NOTE: Most likely you want to use the `this.reset()` method,
|
|
164
180
|
* rather than calling this one directly.
|
|
@@ -180,8 +196,18 @@ export class PDFPageView implements IRenderableView {
|
|
|
180
196
|
get width(): number;
|
|
181
197
|
get height(): number;
|
|
182
198
|
getPagePoint(x: any, y: any): any[];
|
|
183
|
-
|
|
184
|
-
|
|
199
|
+
_ensureCanvasWrapper(): null;
|
|
200
|
+
_getRenderingContext(canvasContext: any, transform: any): {
|
|
201
|
+
canvasContext: any;
|
|
202
|
+
transform: any;
|
|
203
|
+
viewport: import("../src/display/display_utils").PageViewport;
|
|
204
|
+
annotationMode: number;
|
|
205
|
+
optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null;
|
|
206
|
+
annotationCanvasMap: any;
|
|
207
|
+
pageColors: null;
|
|
208
|
+
isEditing: boolean;
|
|
209
|
+
};
|
|
210
|
+
draw(): Promise<void>;
|
|
185
211
|
/**
|
|
186
212
|
* @param {string|null} label
|
|
187
213
|
*/
|
|
@@ -190,9 +216,10 @@ export class PDFPageView implements IRenderableView {
|
|
|
190
216
|
* For use by the `PDFThumbnailView.setImage`-method.
|
|
191
217
|
* @ignore
|
|
192
218
|
*/
|
|
193
|
-
get thumbnailCanvas():
|
|
219
|
+
get thumbnailCanvas(): null;
|
|
194
220
|
#private;
|
|
195
221
|
}
|
|
222
|
+
import { BasePDFPageView } from "./base_pdf_page_view.js";
|
|
196
223
|
import { GenericL10n } from "./genericl10n";
|
|
197
224
|
import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";
|
|
198
225
|
import { TextLayerBuilder } from "./text_layer_builder.js";
|
|
@@ -35,8 +35,9 @@ export class PDFRenderingQueue {
|
|
|
35
35
|
* @param {Array} views
|
|
36
36
|
* @param {boolean} scrolledDown
|
|
37
37
|
* @param {boolean} [preRenderExtra]
|
|
38
|
+
* @param {boolean} [ignoreDetailViews]
|
|
38
39
|
*/
|
|
39
|
-
getHighestPriority(visible: Object, views: any[], scrolledDown: boolean, preRenderExtra?: boolean): any;
|
|
40
|
+
getHighestPriority(visible: Object, views: any[], scrolledDown: boolean, preRenderExtra?: boolean, ignoreDetailViews?: boolean): any;
|
|
40
41
|
/**
|
|
41
42
|
* @param {IRenderableView} view
|
|
42
43
|
* @returns {boolean}
|
|
@@ -35,6 +35,18 @@ export type PDFThumbnailViewOptions = {
|
|
|
35
35
|
* - The rendering queue object.
|
|
36
36
|
*/
|
|
37
37
|
renderingQueue: PDFRenderingQueue;
|
|
38
|
+
/**
|
|
39
|
+
* - The maximum supported canvas size in
|
|
40
|
+
* total pixels, i.e. width * height. Use `-1` for no limit, or `0` for
|
|
41
|
+
* CSS-only zooming. The default value is 4096 * 8192 (32 mega-pixels).
|
|
42
|
+
*/
|
|
43
|
+
maxCanvasPixels?: number | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* - The maximum supported canvas dimension,
|
|
46
|
+
* in either width or height. Use `-1` for no limit.
|
|
47
|
+
* The default value is 32767.
|
|
48
|
+
*/
|
|
49
|
+
maxCanvasDim?: number | undefined;
|
|
38
50
|
/**
|
|
39
51
|
* - Overwrites background and foreground colors
|
|
40
52
|
* with user defined ones in order to improve readability in high contrast
|
|
@@ -54,7 +66,7 @@ export class PDFThumbnailView implements IRenderableView {
|
|
|
54
66
|
/**
|
|
55
67
|
* @param {PDFThumbnailViewOptions} options
|
|
56
68
|
*/
|
|
57
|
-
constructor({ container, eventBus, id, defaultViewport, optionalContentConfigPromise, linkService, renderingQueue, pageColors, enableHWA, }: PDFThumbnailViewOptions);
|
|
69
|
+
constructor({ container, eventBus, id, defaultViewport, optionalContentConfigPromise, linkService, renderingQueue, maxCanvasPixels, maxCanvasDim, pageColors, enableHWA, }: PDFThumbnailViewOptions);
|
|
58
70
|
id: number;
|
|
59
71
|
renderingId: string;
|
|
60
72
|
pageLabel: string | null;
|
|
@@ -63,6 +75,8 @@ export class PDFThumbnailView implements IRenderableView {
|
|
|
63
75
|
viewport: import("../src/display/display_utils").PageViewport;
|
|
64
76
|
pdfPageRotate: number;
|
|
65
77
|
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null;
|
|
78
|
+
maxCanvasPixels: any;
|
|
79
|
+
maxCanvasDim: any;
|
|
66
80
|
pageColors: Object | null;
|
|
67
81
|
enableHWA: boolean;
|
|
68
82
|
eventBus: import("./event_utils").EventBus;
|
|
@@ -88,7 +102,7 @@ export class PDFThumbnailView implements IRenderableView {
|
|
|
88
102
|
*/
|
|
89
103
|
cancelRendering(): void;
|
|
90
104
|
image: HTMLImageElement | undefined;
|
|
91
|
-
draw(): Promise<
|
|
105
|
+
draw(): Promise<void>;
|
|
92
106
|
setImage(pageView: any): void;
|
|
93
107
|
/**
|
|
94
108
|
* @param {string|null} label
|
|
@@ -107,6 +121,12 @@ export class PDFThumbnailView implements IRenderableView {
|
|
|
107
121
|
* The default value is `null`.
|
|
108
122
|
* @property {IPDFLinkService} linkService - The navigation/linking service.
|
|
109
123
|
* @property {PDFRenderingQueue} renderingQueue - The rendering queue object.
|
|
124
|
+
* @property {number} [maxCanvasPixels] - The maximum supported canvas size in
|
|
125
|
+
* total pixels, i.e. width * height. Use `-1` for no limit, or `0` for
|
|
126
|
+
* CSS-only zooming. The default value is 4096 * 8192 (32 mega-pixels).
|
|
127
|
+
* @property {number} [maxCanvasDim] - The maximum supported canvas dimension,
|
|
128
|
+
* in either width or height. Use `-1` for no limit.
|
|
129
|
+
* The default value is 32767.
|
|
110
130
|
* @property {Object} [pageColors] - Overwrites background and foreground colors
|
|
111
131
|
* with user defined ones in order to improve readability in high contrast
|
|
112
132
|
* mode.
|
|
@@ -114,7 +134,7 @@ export class PDFThumbnailView implements IRenderableView {
|
|
|
114
134
|
* rendering. The default value is `false`.
|
|
115
135
|
*/
|
|
116
136
|
export class TempImageFactory {
|
|
117
|
-
static "__#
|
|
137
|
+
static "__#82@#tempCanvas": null;
|
|
118
138
|
static getCanvas(width: any, height: any): (HTMLCanvasElement | CanvasRenderingContext2D | null)[];
|
|
119
139
|
static destroyCanvas(): void;
|
|
120
140
|
}
|
|
@@ -21,6 +21,18 @@ export type PDFThumbnailViewerOptions = {
|
|
|
21
21
|
* - The rendering queue object.
|
|
22
22
|
*/
|
|
23
23
|
renderingQueue: PDFRenderingQueue;
|
|
24
|
+
/**
|
|
25
|
+
* - The maximum supported canvas size in
|
|
26
|
+
* total pixels, i.e. width * height. Use `-1` for no limit, or `0` for
|
|
27
|
+
* CSS-only zooming. The default value is 4096 * 8192 (32 mega-pixels).
|
|
28
|
+
*/
|
|
29
|
+
maxCanvasPixels?: number | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* - The maximum supported canvas dimension,
|
|
32
|
+
* in either width or height. Use `-1` for no limit.
|
|
33
|
+
* The default value is 32767.
|
|
34
|
+
*/
|
|
35
|
+
maxCanvasDim?: number | undefined;
|
|
24
36
|
/**
|
|
25
37
|
* - Overwrites background and foreground colors
|
|
26
38
|
* with user defined ones in order to improve readability in high contrast
|
|
@@ -45,6 +57,12 @@ export type PDFThumbnailViewerOptions = {
|
|
|
45
57
|
* @property {EventBus} eventBus - The application event bus.
|
|
46
58
|
* @property {IPDFLinkService} linkService - The navigation/linking service.
|
|
47
59
|
* @property {PDFRenderingQueue} renderingQueue - The rendering queue object.
|
|
60
|
+
* @property {number} [maxCanvasPixels] - The maximum supported canvas size in
|
|
61
|
+
* total pixels, i.e. width * height. Use `-1` for no limit, or `0` for
|
|
62
|
+
* CSS-only zooming. The default value is 4096 * 8192 (32 mega-pixels).
|
|
63
|
+
* @property {number} [maxCanvasDim] - The maximum supported canvas dimension,
|
|
64
|
+
* in either width or height. Use `-1` for no limit.
|
|
65
|
+
* The default value is 32767.
|
|
48
66
|
* @property {Object} [pageColors] - Overwrites background and foreground colors
|
|
49
67
|
* with user defined ones in order to improve readability in high contrast
|
|
50
68
|
* mode.
|
|
@@ -60,11 +78,13 @@ export class PDFThumbnailViewer {
|
|
|
60
78
|
/**
|
|
61
79
|
* @param {PDFThumbnailViewerOptions} options
|
|
62
80
|
*/
|
|
63
|
-
constructor({ container, eventBus, linkService, renderingQueue, pageColors, abortSignal, enableHWA, }: PDFThumbnailViewerOptions);
|
|
81
|
+
constructor({ container, eventBus, linkService, renderingQueue, maxCanvasPixels, maxCanvasDim, pageColors, abortSignal, enableHWA, }: PDFThumbnailViewerOptions);
|
|
64
82
|
container: HTMLDivElement;
|
|
65
83
|
eventBus: import("./event_utils").EventBus;
|
|
66
84
|
linkService: import("./interfaces").IPDFLinkService;
|
|
67
85
|
renderingQueue: import("./pdf_rendering_queue").PDFRenderingQueue;
|
|
86
|
+
maxCanvasPixels: number | undefined;
|
|
87
|
+
maxCanvasDim: number | undefined;
|
|
68
88
|
pageColors: Object | null;
|
|
69
89
|
enableHWA: boolean;
|
|
70
90
|
scroll: {
|
|
@@ -90,6 +90,20 @@ export type PDFViewerOptions = {
|
|
|
90
90
|
* CSS-only zooming. The default value is 4096 * 8192 (32 mega-pixels).
|
|
91
91
|
*/
|
|
92
92
|
maxCanvasPixels?: number | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* - The maximum supported canvas dimension,
|
|
95
|
+
* in either width or height. Use `-1` for no limit.
|
|
96
|
+
* The default value is 32767.
|
|
97
|
+
*/
|
|
98
|
+
maxCanvasDim?: number | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* - When enabled, if the rendered
|
|
101
|
+
* pages would need a canvas that is larger than `maxCanvasPixels` or
|
|
102
|
+
* `maxCanvasDim`, it will draw a second canvas on top of the CSS-zoomed one,
|
|
103
|
+
* that only renders the part of the page that is close to the viewport.
|
|
104
|
+
* The default value is `true`.
|
|
105
|
+
*/
|
|
106
|
+
enableDetailCanvas?: boolean | undefined;
|
|
93
107
|
/**
|
|
94
108
|
* - Localization service.
|
|
95
109
|
*/
|
|
@@ -115,6 +129,11 @@ export type PDFViewerOptions = {
|
|
|
115
129
|
* The default value is `true`.
|
|
116
130
|
*/
|
|
117
131
|
supportsPinchToZoom?: boolean | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* - Enable creation of hyperlinks from
|
|
134
|
+
* text that look like URLs. The default value is `true`.
|
|
135
|
+
*/
|
|
136
|
+
enableAutoLinking?: boolean | undefined;
|
|
118
137
|
};
|
|
119
138
|
export namespace PagesCountLimit {
|
|
120
139
|
let FORCE_SCROLL_MODE_PAGE: number;
|
|
@@ -156,6 +175,14 @@ export namespace PagesCountLimit {
|
|
|
156
175
|
* @property {number} [maxCanvasPixels] - The maximum supported canvas size in
|
|
157
176
|
* total pixels, i.e. width * height. Use `-1` for no limit, or `0` for
|
|
158
177
|
* CSS-only zooming. The default value is 4096 * 8192 (32 mega-pixels).
|
|
178
|
+
* @property {number} [maxCanvasDim] - The maximum supported canvas dimension,
|
|
179
|
+
* in either width or height. Use `-1` for no limit.
|
|
180
|
+
* The default value is 32767.
|
|
181
|
+
* @property {boolean} [enableDetailCanvas] - When enabled, if the rendered
|
|
182
|
+
* pages would need a canvas that is larger than `maxCanvasPixels` or
|
|
183
|
+
* `maxCanvasDim`, it will draw a second canvas on top of the CSS-zoomed one,
|
|
184
|
+
* that only renders the part of the page that is close to the viewport.
|
|
185
|
+
* The default value is `true`.
|
|
159
186
|
* @property {IL10n} [l10n] - Localization service.
|
|
160
187
|
* @property {boolean} [enablePermissions] - Enables PDF document permissions,
|
|
161
188
|
* when they exist. The default value is `false`.
|
|
@@ -166,6 +193,8 @@ export namespace PagesCountLimit {
|
|
|
166
193
|
* rendering. The default value is `false`.
|
|
167
194
|
* @property {boolean} [supportsPinchToZoom] - Enable zooming on pinch gesture.
|
|
168
195
|
* The default value is `true`.
|
|
196
|
+
* @property {boolean} [enableAutoLinking] - Enable creation of hyperlinks from
|
|
197
|
+
* text that look like URLs. The default value is `true`.
|
|
169
198
|
*/
|
|
170
199
|
export class PDFPageViewBuffer {
|
|
171
200
|
constructor(size: any);
|
|
@@ -201,6 +230,8 @@ export class PDFViewer {
|
|
|
201
230
|
enablePrintAutoRotate: boolean;
|
|
202
231
|
removePageBorders: boolean | undefined;
|
|
203
232
|
maxCanvasPixels: number | undefined;
|
|
233
|
+
maxCanvasDim: number | undefined;
|
|
234
|
+
enableDetailCanvas: boolean;
|
|
204
235
|
l10n: import("./interfaces").IL10n | GenericL10n | undefined;
|
|
205
236
|
pageColors: Object | null;
|
|
206
237
|
defaultRenderingQueue: boolean;
|
|
@@ -1,6 +1,22 @@
|
|
|
1
|
+
export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
|
|
2
|
+
export type StructTreeLayerBuilderOptions = {
|
|
3
|
+
pdfPage: PDFPageProxy;
|
|
4
|
+
rawDims: Object;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} StructTreeLayerBuilderOptions
|
|
8
|
+
* @property {PDFPageProxy} pdfPage
|
|
9
|
+
* @property {Object} rawDims
|
|
10
|
+
*/
|
|
1
11
|
export class StructTreeLayerBuilder {
|
|
12
|
+
/**
|
|
13
|
+
* @param {StructTreeLayerBuilderOptions} options
|
|
14
|
+
*/
|
|
2
15
|
constructor(pdfPage: any, rawDims: any);
|
|
3
|
-
|
|
16
|
+
/**
|
|
17
|
+
* @returns {Promise<void>}
|
|
18
|
+
*/
|
|
19
|
+
render(): Promise<void>;
|
|
4
20
|
getAriaAttributes(annotationId: any): Promise<any>;
|
|
5
21
|
hide(): void;
|
|
6
22
|
show(): void;
|
|
@@ -10,43 +10,51 @@ export type TextLayerBuilderOptions = {
|
|
|
10
10
|
*/
|
|
11
11
|
highlighter?: import("./text_highlighter").TextHighlighter | undefined;
|
|
12
12
|
accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
|
|
13
|
+
enablePermissions?: boolean | undefined;
|
|
13
14
|
onAppend?: Function | undefined;
|
|
14
15
|
};
|
|
16
|
+
export type TextLayerBuilderRenderOptions = {
|
|
17
|
+
viewport: PageViewport;
|
|
18
|
+
textContentParams?: Object | undefined;
|
|
19
|
+
};
|
|
15
20
|
/**
|
|
16
21
|
* @typedef {Object} TextLayerBuilderOptions
|
|
17
22
|
* @property {PDFPageProxy} pdfPage
|
|
18
23
|
* @property {TextHighlighter} [highlighter] - Optional object that will handle
|
|
19
24
|
* highlighting text from the find controller.
|
|
20
25
|
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
26
|
+
* @property {boolean} [enablePermissions]
|
|
21
27
|
* @property {function} [onAppend]
|
|
22
28
|
*/
|
|
29
|
+
/**
|
|
30
|
+
* @typedef {Object} TextLayerBuilderRenderOptions
|
|
31
|
+
* @property {PageViewport} viewport
|
|
32
|
+
* @property {Object} [textContentParams]
|
|
33
|
+
*/
|
|
23
34
|
/**
|
|
24
35
|
* The text layer builder provides text selection functionality for the PDF.
|
|
25
36
|
* It does this by creating overlay divs over the PDF's text. These divs
|
|
26
37
|
* contain text that matches the PDF text they are overlaying.
|
|
27
38
|
*/
|
|
28
39
|
export class TextLayerBuilder {
|
|
29
|
-
static "__#
|
|
30
|
-
static "__#
|
|
31
|
-
static "__#
|
|
32
|
-
static "__#
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
pdfPage: any;
|
|
41
|
-
highlighter: any;
|
|
42
|
-
accessibilityManager: any;
|
|
40
|
+
static "__#78@#textLayers": Map<any, any>;
|
|
41
|
+
static "__#78@#selectionChangeAbortController": null;
|
|
42
|
+
static "__#78@#removeGlobalSelectionListener"(textLayerDiv: any): void;
|
|
43
|
+
static "__#78@#enableGlobalSelectionListener"(): void;
|
|
44
|
+
/**
|
|
45
|
+
* @param {TextLayerBuilderOptions} options
|
|
46
|
+
*/
|
|
47
|
+
constructor({ pdfPage, highlighter, accessibilityManager, enablePermissions, onAppend, }: TextLayerBuilderOptions);
|
|
48
|
+
pdfPage: import("../src/display/api").PDFPageProxy;
|
|
49
|
+
highlighter: import("./text_highlighter").TextHighlighter;
|
|
50
|
+
accessibilityManager: import("./text_accessibility.js").TextAccessibilityManager;
|
|
43
51
|
div: HTMLDivElement;
|
|
44
52
|
/**
|
|
45
53
|
* Renders the text layer.
|
|
46
|
-
* @param {
|
|
47
|
-
* @
|
|
54
|
+
* @param {TextLayerBuilderRenderOptions} options
|
|
55
|
+
* @returns {Promise<void>}
|
|
48
56
|
*/
|
|
49
|
-
render(viewport
|
|
57
|
+
render({ viewport, textContentParams }: TextLayerBuilderRenderOptions): Promise<void>;
|
|
50
58
|
hide(): void;
|
|
51
59
|
show(): void;
|
|
52
60
|
/**
|
|
@@ -8,6 +8,13 @@ export type XfaLayerBuilderOptions = {
|
|
|
8
8
|
linkService: IPDFLinkService;
|
|
9
9
|
xfaHtml?: Object | undefined;
|
|
10
10
|
};
|
|
11
|
+
export type XfaLayerBuilderRenderOptions = {
|
|
12
|
+
viewport: PageViewport;
|
|
13
|
+
/**
|
|
14
|
+
* - The default value is "display".
|
|
15
|
+
*/
|
|
16
|
+
intent?: string | undefined;
|
|
17
|
+
};
|
|
11
18
|
/**
|
|
12
19
|
* @typedef {Object} XfaLayerBuilderOptions
|
|
13
20
|
* @property {PDFPageProxy} pdfPage
|
|
@@ -15,6 +22,11 @@ export type XfaLayerBuilderOptions = {
|
|
|
15
22
|
* @property {IPDFLinkService} linkService
|
|
16
23
|
* @property {Object} [xfaHtml]
|
|
17
24
|
*/
|
|
25
|
+
/**
|
|
26
|
+
* @typedef {Object} XfaLayerBuilderRenderOptions
|
|
27
|
+
* @property {PageViewport} viewport
|
|
28
|
+
* @property {string} [intent] - The default value is "display".
|
|
29
|
+
*/
|
|
18
30
|
export class XfaLayerBuilder {
|
|
19
31
|
/**
|
|
20
32
|
* @param {XfaLayerBuilderOptions} options
|
|
@@ -27,13 +39,12 @@ export class XfaLayerBuilder {
|
|
|
27
39
|
div: HTMLDivElement | null;
|
|
28
40
|
_cancelled: boolean;
|
|
29
41
|
/**
|
|
30
|
-
* @param {
|
|
31
|
-
* @param {string} intent (default value is 'display')
|
|
42
|
+
* @param {XfaLayerBuilderRenderOptions} viewport
|
|
32
43
|
* @returns {Promise<Object | void>} A promise that is resolved when rendering
|
|
33
44
|
* of the XFA layer is complete. The first rendering will return an object
|
|
34
45
|
* with a `textDivs` property that can be used with the TextHighlighter.
|
|
35
46
|
*/
|
|
36
|
-
render(viewport
|
|
47
|
+
render({ viewport, intent }: XfaLayerBuilderRenderOptions): Promise<Object | void>;
|
|
37
48
|
cancel(): void;
|
|
38
49
|
hide(): void;
|
|
39
50
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pdfjs-serverless",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@10.
|
|
6
|
-
"description": "Serverless
|
|
4
|
+
"version": "1.0.1",
|
|
5
|
+
"packageManager": "pnpm@10.12.1",
|
|
6
|
+
"description": "Serverless redistribution of PDF.js for edge environments",
|
|
7
7
|
"author": "Johann Schopplich <hello@johannschopplich.com>",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"homepage": "https://github.com/johannschopplich/pdfjs-serverless#readme",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
28
|
"types": "./dist/index.d.mts",
|
|
29
|
-
"
|
|
29
|
+
"default": "./dist/index.mjs"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
-
"types": "./dist/index.d.
|
|
32
|
+
"types": "./dist/index.d.mts",
|
|
33
33
|
"files": [
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
@@ -42,26 +42,18 @@
|
|
|
42
42
|
"release": "bumpp"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@antfu/eslint-config": "^4.
|
|
46
|
-
"@rollup/plugin-alias": "^5.1.1",
|
|
47
|
-
"@rollup/plugin-commonjs": "^28.0.2",
|
|
45
|
+
"@antfu/eslint-config": "^4.14.1",
|
|
48
46
|
"@rollup/plugin-inject": "^5.0.5",
|
|
49
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
47
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
50
48
|
"@rollup/plugin-replace": "^6.0.2",
|
|
51
49
|
"@rollup/plugin-terser": "^0.4.4",
|
|
52
50
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
53
|
-
"@types/node": "^22.
|
|
54
|
-
"bumpp": "^10.
|
|
55
|
-
"eslint": "^9.
|
|
56
|
-
"pdfjs-dist": "
|
|
57
|
-
"rollup": "^4.
|
|
51
|
+
"@types/node": "^22.15.31",
|
|
52
|
+
"bumpp": "^10.1.1",
|
|
53
|
+
"eslint": "^9.28.0",
|
|
54
|
+
"pdfjs-dist": "~5.2.133",
|
|
55
|
+
"rollup": "^4.42.0",
|
|
58
56
|
"tslib": "^2.8.1",
|
|
59
|
-
"typescript": "^5.
|
|
60
|
-
"unenv": "^1.10.0"
|
|
61
|
-
},
|
|
62
|
-
"pnpm": {
|
|
63
|
-
"patchedDependencies": {
|
|
64
|
-
"pdfjs-dist@4.10.38": "patches/pdfjs-dist@4.10.38.patch"
|
|
65
|
-
}
|
|
57
|
+
"typescript": "^5.8.3"
|
|
66
58
|
}
|
|
67
59
|
}
|
package/dist/index.d.ts
DELETED