pdfjs-serverless 0.3.2 → 0.4.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 +90 -12
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +1 -1
- package/dist/types/src/display/api.d.ts +8 -7
- package/dist/types/src/display/display_utils.d.ts +3 -2
- package/dist/types/src/display/draw_layer.d.ts +40 -0
- package/dist/types/src/display/editor/alt_text.d.ts +21 -0
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +23 -2
- package/dist/types/src/display/editor/color_picker.d.ts +19 -0
- package/dist/types/src/display/editor/editor.d.ts +29 -15
- package/dist/types/src/display/editor/highlight.d.ts +54 -0
- package/dist/types/src/display/editor/ink.d.ts +3 -3
- package/dist/types/src/display/editor/outliner.d.ts +26 -0
- package/dist/types/src/display/editor/toolbar.d.ts +11 -0
- package/dist/types/src/display/editor/tools.d.ts +3 -1
- package/dist/types/src/pdf.d.ts +5 -1
- package/dist/types/src/shared/util.d.ts +5 -1
- package/dist/types/web/annotation_editor_layer_builder.d.ts +4 -0
- package/dist/types/web/draw_layer_builder.d.ts +23 -0
- package/dist/types/web/genericl10n.d.ts +3 -3
- package/dist/types/web/interfaces.d.ts +3 -3
- package/dist/types/web/l10n.d.ts +4 -2
- package/dist/types/web/pdf_link_service.d.ts +5 -5
- package/dist/types/web/pdf_page_view.d.ts +2 -1
- package/dist/types/web/pdf_scripting_manager.d.ts +6 -6
- package/dist/types/web/pdf_single_page_viewer.d.ts +2 -2
- package/dist/types/web/pdf_thumbnail_view.d.ts +1 -1
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +1 -1
- package/dist/types/web/pdf_viewer.d.ts +52 -13
- package/dist/types/web/ui_utils.d.ts +1 -1
- package/package.json +16 -11
|
@@ -75,7 +75,7 @@ export namespace LinkTarget {
|
|
|
75
75
|
* @implements {IPDFLinkService}
|
|
76
76
|
*/
|
|
77
77
|
export class PDFLinkService implements IPDFLinkService {
|
|
78
|
-
static "__#
|
|
78
|
+
static "__#49@#isValidExplicitDestination"(dest: any): boolean;
|
|
79
79
|
/**
|
|
80
80
|
* @param {PDFLinkServiceOptions} options
|
|
81
81
|
*/
|
|
@@ -99,7 +99,7 @@ export class PDFLinkService implements IPDFLinkService {
|
|
|
99
99
|
/**
|
|
100
100
|
* @param {number} value
|
|
101
101
|
*/
|
|
102
|
-
set page(
|
|
102
|
+
set page(value: number);
|
|
103
103
|
/**
|
|
104
104
|
* @type {number}
|
|
105
105
|
*/
|
|
@@ -107,7 +107,7 @@ export class PDFLinkService implements IPDFLinkService {
|
|
|
107
107
|
/**
|
|
108
108
|
* @param {number} value
|
|
109
109
|
*/
|
|
110
|
-
set rotation(
|
|
110
|
+
set rotation(value: number);
|
|
111
111
|
/**
|
|
112
112
|
* @type {number}
|
|
113
113
|
*/
|
|
@@ -182,7 +182,7 @@ export class SimpleLinkService implements IPDFLinkService {
|
|
|
182
182
|
/**
|
|
183
183
|
* @param {number} value
|
|
184
184
|
*/
|
|
185
|
-
set page(
|
|
185
|
+
set page(value: number);
|
|
186
186
|
/**
|
|
187
187
|
* @type {number}
|
|
188
188
|
*/
|
|
@@ -190,7 +190,7 @@ export class SimpleLinkService implements IPDFLinkService {
|
|
|
190
190
|
/**
|
|
191
191
|
* @param {number} value
|
|
192
192
|
*/
|
|
193
|
-
set rotation(
|
|
193
|
+
set rotation(value: number);
|
|
194
194
|
/**
|
|
195
195
|
* @type {number}
|
|
196
196
|
*/
|
|
@@ -123,8 +123,9 @@ export class PDFPageView implements IRenderableView {
|
|
|
123
123
|
zoomLayer: ParentNode | null;
|
|
124
124
|
xfaLayer: XfaLayerBuilder | null;
|
|
125
125
|
structTreeLayer: any;
|
|
126
|
+
drawLayer: any;
|
|
126
127
|
div: HTMLDivElement;
|
|
127
|
-
set renderingState(
|
|
128
|
+
set renderingState(state: number);
|
|
128
129
|
get renderingState(): number;
|
|
129
130
|
setPdfPage(pdfPage: any): void;
|
|
130
131
|
destroy(): void;
|
|
@@ -5,10 +5,10 @@ export type PDFScriptingManagerOptions = {
|
|
|
5
5
|
*/
|
|
6
6
|
eventBus: EventBus;
|
|
7
7
|
/**
|
|
8
|
-
* - The path and filename of the
|
|
9
|
-
* bundle.
|
|
8
|
+
* - The path and filename of the
|
|
9
|
+
* scripting bundle.
|
|
10
10
|
*/
|
|
11
|
-
sandboxBundleSrc
|
|
11
|
+
sandboxBundleSrc?: string | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* - The factory that is used when
|
|
14
14
|
* initializing scripting; must contain a `createScripting` method.
|
|
@@ -24,8 +24,8 @@ export type PDFScriptingManagerOptions = {
|
|
|
24
24
|
/**
|
|
25
25
|
* @typedef {Object} PDFScriptingManagerOptions
|
|
26
26
|
* @property {EventBus} eventBus - The application event bus.
|
|
27
|
-
* @property {string} sandboxBundleSrc - The path and filename of the
|
|
28
|
-
* bundle.
|
|
27
|
+
* @property {string} [sandboxBundleSrc] - The path and filename of the
|
|
28
|
+
* scripting bundle.
|
|
29
29
|
* @property {Object} [externalServices] - The factory that is used when
|
|
30
30
|
* initializing scripting; must contain a `createScripting` method.
|
|
31
31
|
* PLEASE NOTE: Primarily intended for the default viewer use-case.
|
|
@@ -36,7 +36,7 @@ export class PDFScriptingManager {
|
|
|
36
36
|
/**
|
|
37
37
|
* @param {PDFScriptingManagerOptions} options
|
|
38
38
|
*/
|
|
39
|
-
constructor({ eventBus,
|
|
39
|
+
constructor({ eventBus, externalServices, docProperties }: PDFScriptingManagerOptions);
|
|
40
40
|
setViewer(pdfViewer: any): void;
|
|
41
41
|
setDocument(pdfDocument: any): Promise<void>;
|
|
42
42
|
dispatchWillSave(): Promise<any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export class PDFSinglePageViewer extends PDFViewer {
|
|
2
|
-
set scrollMode(
|
|
2
|
+
set scrollMode(mode: any);
|
|
3
3
|
_updateScrollMode(): void;
|
|
4
|
-
set spreadMode(
|
|
4
|
+
set spreadMode(mode: any);
|
|
5
5
|
_updateSpreadMode(): void;
|
|
6
6
|
}
|
|
7
7
|
import { PDFViewer } from "./pdf_viewer.js";
|
|
@@ -118,7 +118,7 @@ export class PDFThumbnailView implements IRenderableView {
|
|
|
118
118
|
* mode.
|
|
119
119
|
*/
|
|
120
120
|
export class TempImageFactory {
|
|
121
|
-
static "__#
|
|
121
|
+
static "__#62@#tempCanvas": null;
|
|
122
122
|
static getCanvas(width: any, height: any): (HTMLCanvasElement | CanvasRenderingContext2D | null)[];
|
|
123
123
|
static destroyCanvas(): void;
|
|
124
124
|
}
|
|
@@ -70,7 +70,7 @@ export class PDFThumbnailViewer {
|
|
|
70
70
|
private _getVisibleThumbs;
|
|
71
71
|
scrollThumbnailIntoView(pageNumber: any): void;
|
|
72
72
|
_currentPageNumber: any;
|
|
73
|
-
set pagesRotation(
|
|
73
|
+
set pagesRotation(rotation: any);
|
|
74
74
|
get pagesRotation(): any;
|
|
75
75
|
_pagesRotation: any;
|
|
76
76
|
cleanup(): void;
|
|
@@ -69,6 +69,11 @@ export type PDFViewerOptions = {
|
|
|
69
69
|
* be used. The default value is `AnnotationEditorType.NONE`.
|
|
70
70
|
*/
|
|
71
71
|
annotationEditorMode?: number | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* - A comma separated list
|
|
74
|
+
* of colors to propose to highlight some text in the pdf.
|
|
75
|
+
*/
|
|
76
|
+
annotationEditorHighlightColors?: string | undefined;
|
|
72
77
|
/**
|
|
73
78
|
* - Path for image resources, mainly
|
|
74
79
|
* mainly for annotation icons. Include trailing slash.
|
|
@@ -137,6 +142,8 @@ export namespace PagesCountLimit {
|
|
|
137
142
|
* @property {number} [annotationEditorMode] - Enables the creation and editing
|
|
138
143
|
* of new Annotations. The constants from {@link AnnotationEditorType} should
|
|
139
144
|
* be used. The default value is `AnnotationEditorType.NONE`.
|
|
145
|
+
* @property {string} [annotationEditorHighlightColors] - A comma separated list
|
|
146
|
+
* of colors to propose to highlight some text in the pdf.
|
|
140
147
|
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
|
141
148
|
* mainly for annotation icons. Include trailing slash.
|
|
142
149
|
* @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of
|
|
@@ -227,7 +234,7 @@ export class PDFViewer {
|
|
|
227
234
|
/**
|
|
228
235
|
* @param {number} val - The page number.
|
|
229
236
|
*/
|
|
230
|
-
set currentPageNumber(
|
|
237
|
+
set currentPageNumber(val: number);
|
|
231
238
|
/**
|
|
232
239
|
* @type {number}
|
|
233
240
|
*/
|
|
@@ -241,7 +248,7 @@ export class PDFViewer {
|
|
|
241
248
|
/**
|
|
242
249
|
* @param {string} val - The page label.
|
|
243
250
|
*/
|
|
244
|
-
set currentPageLabel(
|
|
251
|
+
set currentPageLabel(val: string | null);
|
|
245
252
|
/**
|
|
246
253
|
* @type {string|null} Returns the current page label, or `null` if no page
|
|
247
254
|
* labels exist.
|
|
@@ -250,7 +257,7 @@ export class PDFViewer {
|
|
|
250
257
|
/**
|
|
251
258
|
* @param {number} val - Scale of the pages in percents.
|
|
252
259
|
*/
|
|
253
|
-
set currentScale(
|
|
260
|
+
set currentScale(val: number);
|
|
254
261
|
/**
|
|
255
262
|
* @type {number}
|
|
256
263
|
*/
|
|
@@ -258,7 +265,7 @@ export class PDFViewer {
|
|
|
258
265
|
/**
|
|
259
266
|
* @param val - The scale of the pages (in percent or predefined value).
|
|
260
267
|
*/
|
|
261
|
-
set currentScaleValue(
|
|
268
|
+
set currentScaleValue(val: string);
|
|
262
269
|
/**
|
|
263
270
|
* @type {string}
|
|
264
271
|
*/
|
|
@@ -266,7 +273,7 @@ export class PDFViewer {
|
|
|
266
273
|
/**
|
|
267
274
|
* @param {number} rotation - The rotation of the pages (0, 90, 180, 270).
|
|
268
275
|
*/
|
|
269
|
-
set pagesRotation(
|
|
276
|
+
set pagesRotation(rotation: number);
|
|
270
277
|
/**
|
|
271
278
|
* @type {number}
|
|
272
279
|
*/
|
|
@@ -378,7 +385,7 @@ export class PDFViewer {
|
|
|
378
385
|
* @param {Promise<OptionalContentConfig>} promise - A promise that is
|
|
379
386
|
* resolved with an {@link OptionalContentConfig} instance.
|
|
380
387
|
*/
|
|
381
|
-
set optionalContentConfigPromise(
|
|
388
|
+
set optionalContentConfigPromise(promise: Promise<import("../src/display/optional_content_config").OptionalContentConfig | null>);
|
|
382
389
|
/**
|
|
383
390
|
* @type {Promise<OptionalContentConfig | null>}
|
|
384
391
|
*/
|
|
@@ -388,7 +395,7 @@ export class PDFViewer {
|
|
|
388
395
|
* laid out within the scrolling container.
|
|
389
396
|
* The constants from {ScrollMode} should be used.
|
|
390
397
|
*/
|
|
391
|
-
set scrollMode(
|
|
398
|
+
set scrollMode(mode: number);
|
|
392
399
|
/**
|
|
393
400
|
* @type {number} One of the values in {ScrollMode}.
|
|
394
401
|
*/
|
|
@@ -399,7 +406,7 @@ export class PDFViewer {
|
|
|
399
406
|
* even-number pages (unless `SpreadMode.NONE` is used).
|
|
400
407
|
* The constants from {SpreadMode} should be used.
|
|
401
408
|
*/
|
|
402
|
-
set spreadMode(
|
|
409
|
+
set spreadMode(mode: number);
|
|
403
410
|
/**
|
|
404
411
|
* @type {number} One of the values in {SpreadMode}.
|
|
405
412
|
*/
|
|
@@ -445,14 +452,46 @@ export class PDFViewer {
|
|
|
445
452
|
} | undefined): void;
|
|
446
453
|
get containerTopLeft(): number[];
|
|
447
454
|
/**
|
|
448
|
-
* @
|
|
455
|
+
* @typedef {Object} AnnotationEditorModeOptions
|
|
456
|
+
* @property {number} mode - The editor mode (none, FreeText, ink, ...).
|
|
457
|
+
* @property {string|null} [editId] - ID of the existing annotation to edit.
|
|
458
|
+
* @property {boolean} [isFromKeyboard] - True if the mode change is due to a
|
|
459
|
+
* keyboard action.
|
|
449
460
|
*/
|
|
450
|
-
set annotationEditorMode(arg: number);
|
|
451
461
|
/**
|
|
452
|
-
* @
|
|
462
|
+
* @param {AnnotationEditorModeOptions} options
|
|
453
463
|
*/
|
|
454
|
-
|
|
455
|
-
|
|
464
|
+
set annotationEditorMode({ mode, editId, isFromKeyboard }: {
|
|
465
|
+
/**
|
|
466
|
+
* - The editor mode (none, FreeText, ink, ...).
|
|
467
|
+
*/
|
|
468
|
+
mode: number;
|
|
469
|
+
/**
|
|
470
|
+
* - ID of the existing annotation to edit.
|
|
471
|
+
*/
|
|
472
|
+
editId?: string | null | undefined;
|
|
473
|
+
/**
|
|
474
|
+
* - True if the mode change is due to a
|
|
475
|
+
* keyboard action.
|
|
476
|
+
*/
|
|
477
|
+
isFromKeyboard?: boolean | undefined;
|
|
478
|
+
});
|
|
479
|
+
get annotationEditorMode(): {
|
|
480
|
+
/**
|
|
481
|
+
* - The editor mode (none, FreeText, ink, ...).
|
|
482
|
+
*/
|
|
483
|
+
mode: number;
|
|
484
|
+
/**
|
|
485
|
+
* - ID of the existing annotation to edit.
|
|
486
|
+
*/
|
|
487
|
+
editId?: string | null | undefined;
|
|
488
|
+
/**
|
|
489
|
+
* - True if the mode change is due to a
|
|
490
|
+
* keyboard action.
|
|
491
|
+
*/
|
|
492
|
+
isFromKeyboard?: boolean | undefined;
|
|
493
|
+
};
|
|
494
|
+
set annotationEditorParams({ type, value }: any);
|
|
456
495
|
refresh(noUpdate?: boolean, updateArgs?: any): void;
|
|
457
496
|
#private;
|
|
458
497
|
}
|
|
@@ -201,7 +201,7 @@ export namespace PresentationModeState {
|
|
|
201
201
|
}
|
|
202
202
|
export class ProgressBar {
|
|
203
203
|
constructor(bar: any);
|
|
204
|
-
set percent(
|
|
204
|
+
set percent(val: number);
|
|
205
205
|
get percent(): number;
|
|
206
206
|
setWidth(viewer: any): void;
|
|
207
207
|
setDisableAutoFetch(delay?: number): void;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pdfjs-serverless",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@8.
|
|
4
|
+
"version": "0.4.1",
|
|
5
|
+
"packageManager": "pnpm@8.14.3",
|
|
6
6
|
"description": "Serverless build of PDF.js for Deno, workers, and other nodeless environments",
|
|
7
7
|
"author": "Johann Schopplich <pkg@johannschopplich.com>",
|
|
8
8
|
"license": "MIT",
|
|
@@ -42,21 +42,26 @@
|
|
|
42
42
|
"release": "bumpp --commit --push --tag"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@antfu/eslint-config": "^
|
|
46
|
-
"@rollup/plugin-alias": "^5.0
|
|
45
|
+
"@antfu/eslint-config": "^2.6.3",
|
|
46
|
+
"@rollup/plugin-alias": "^5.1.0",
|
|
47
47
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
48
48
|
"@rollup/plugin-inject": "^5.0.5",
|
|
49
49
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
50
50
|
"@rollup/plugin-replace": "^5.0.5",
|
|
51
51
|
"@rollup/plugin-terser": "^0.4.4",
|
|
52
|
-
"@rollup/plugin-typescript": "^11.1.
|
|
53
|
-
"@types/node": "^20.
|
|
54
|
-
"bumpp": "^9.
|
|
55
|
-
"eslint": "^8.
|
|
56
|
-
"pdfjs-dist": "^4.0.
|
|
57
|
-
"rollup": "^4.
|
|
52
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
53
|
+
"@types/node": "^20.11.6",
|
|
54
|
+
"bumpp": "^9.3.0",
|
|
55
|
+
"eslint": "^8.56.0",
|
|
56
|
+
"pdfjs-dist": "^4.0.379",
|
|
57
|
+
"rollup": "^4.9.6",
|
|
58
58
|
"tslib": "^2.6.2",
|
|
59
59
|
"typescript": "5.2.2",
|
|
60
|
-
"unenv": "^1.
|
|
60
|
+
"unenv": "^1.9.0"
|
|
61
|
+
},
|
|
62
|
+
"pnpm": {
|
|
63
|
+
"patchedDependencies": {
|
|
64
|
+
"pdfjs-dist@4.0.379": "patches/pdfjs-dist@4.0.379.patch"
|
|
65
|
+
}
|
|
61
66
|
}
|
|
62
67
|
}
|