unpdf 1.3.2 → 1.4.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.
Files changed (30) hide show
  1. package/README.md +1 -1
  2. package/dist/pdfjs.mjs +1 -1
  3. package/dist/types/src/display/annotation_layer.d.ts +28 -6
  4. package/dist/types/src/display/annotation_storage.d.ts +2 -0
  5. package/dist/types/src/display/api.d.ts +13 -7
  6. package/dist/types/src/display/canvas.d.ts +1 -1
  7. package/dist/types/src/display/canvas_dependency_tracker.d.ts +36 -20
  8. package/dist/types/src/display/display_utils.d.ts +22 -0
  9. package/dist/types/src/display/editor/annotation_editor_layer.d.ts +4 -2
  10. package/dist/types/src/display/editor/comment.d.ts +20 -5
  11. package/dist/types/src/display/editor/drawers/freedraw.d.ts +1 -0
  12. package/dist/types/src/display/editor/drawers/highlight.d.ts +2 -1
  13. package/dist/types/src/display/editor/editor.d.ts +67 -15
  14. package/dist/types/src/display/editor/freetext.d.ts +1 -1
  15. package/dist/types/src/display/editor/highlight.d.ts +3 -1
  16. package/dist/types/src/display/editor/ink.d.ts +2 -1
  17. package/dist/types/src/display/editor/signature.d.ts +0 -5
  18. package/dist/types/src/display/editor/toolbar.d.ts +3 -1
  19. package/dist/types/src/display/editor/tools.d.ts +21 -3
  20. package/dist/types/src/display/font_loader.d.ts +27 -1
  21. package/dist/types/src/display/pattern_helper.d.ts +2 -2
  22. package/dist/types/src/pdf.d.ts +5 -1
  23. package/dist/types/src/shared/obj-bin-transform.d.ts +64 -0
  24. package/dist/types/web/annotation_layer_builder.d.ts +6 -14
  25. package/dist/types/web/base_pdf_page_view.d.ts +1 -1
  26. package/dist/types/web/comment_manager.d.ts +20 -0
  27. package/dist/types/web/pdf_link_service.d.ts +2 -1
  28. package/dist/types/web/pdf_page_view.d.ts +7 -2
  29. package/dist/types/web/pdf_viewer.d.ts +10 -1
  30. package/package.json +15 -15
@@ -66,15 +66,10 @@ export class SignatureEditor extends DrawingEditor {
66
66
  _drawingOptions: any;
67
67
  /** @inheritdoc */
68
68
  serialize(isForCopying?: boolean): {
69
- annotationType: number;
70
69
  isSignature: boolean;
71
70
  areContours: boolean;
72
71
  color: number[];
73
72
  thickness: any;
74
- pageIndex: number;
75
- rect: any;
76
- rotation: number;
77
- structTreeParentId: any;
78
73
  } | null;
79
74
  #private;
80
75
  }
@@ -8,10 +8,12 @@ export class EditorToolbar {
8
8
  show(): void;
9
9
  addDeleteButton(): void;
10
10
  addAltText(altText: any): Promise<void>;
11
- addComment(comment: any): void;
11
+ addComment(comment: any, beforeElement?: null): void;
12
12
  addColorPicker(colorPicker: any): void;
13
13
  addEditSignatureButton(signatureManager: any): Promise<void>;
14
+ removeButton(name: any): void;
14
15
  addButton(name: any, tool: any): Promise<void>;
16
+ addButtonBefore(name: any, tool: any, beforeSelector: any): Promise<void>;
15
17
  updateEditSignatureButton(description: any): void;
16
18
  remove(): void;
17
19
  #private;
@@ -42,7 +42,15 @@ export class AnnotationEditorUIManager {
42
42
  setMainHighlightColorPicker(colorPicker: any): void;
43
43
  editAltText(editor: any, firstTime?: boolean): void;
44
44
  hasCommentManager(): boolean;
45
- editComment(editor: any, position: any): void;
45
+ editComment(editor: any, posX: any, posY: any, options: any): void;
46
+ selectComment(pageIndex: any, uid: any): void;
47
+ updateComment(editor: any): void;
48
+ updatePopupColor(editor: any): void;
49
+ removeComment(editor: any): void;
50
+ toggleComment(editor: any, isSelected: any, visibility?: undefined): void;
51
+ makeCommentColor(color: any, opacity: any): any;
52
+ getCommentDialogElement(): any;
53
+ waitForEditorsRendered(pageNumber: any): Promise<void>;
46
54
  getSignature(editor: any): void;
47
55
  get signatureManager(): null;
48
56
  switchToMode(mode: any, callback: any): void;
@@ -67,6 +75,15 @@ export class AnnotationEditorUIManager {
67
75
  }): void;
68
76
  highlightSelection(methodOfCreation?: string, comment?: boolean): void;
69
77
  commentSelection(methodOfCreation?: string): void;
78
+ /**
79
+ * Some annotations may have been modified in the annotation layer
80
+ * (e.g. comments added or modified).
81
+ * So this function retrieves the data from the storage and removes
82
+ * them from the storage in order to be able to save them later.
83
+ * @param {string} annotationId
84
+ * @returns {Object|null} The data associated to the annotation or null.
85
+ */
86
+ getAndRemoveDataFromAnnotationStorage(annotationId: string): Object | null;
70
87
  /**
71
88
  * Add an editor in the annotation storage.
72
89
  * @param {AnnotationEditor} editor
@@ -173,9 +190,9 @@ export class AnnotationEditorUIManager {
173
190
  /**
174
191
  * Get all the editors belonging to a given page.
175
192
  * @param {number} pageIndex
176
- * @returns {Array<AnnotationEditor>}
193
+ * @yields {AnnotationEditor}
177
194
  */
178
- getEditors(pageIndex: number): Array<AnnotationEditor>;
195
+ getEditors(pageIndex: number): Generator<any, void, unknown>;
179
196
  /**
180
197
  * Get an editor with the given id.
181
198
  * @param {string} id
@@ -309,6 +326,7 @@ export class AnnotationEditorUIManager {
309
326
  * @returns {number}
310
327
  */
311
328
  getMode(): number;
329
+ isEditingMode(): boolean;
312
330
  get imageManager(): any;
313
331
  getSelectionBoxes(textLayer: any): {
314
332
  x: number;
@@ -1,10 +1,36 @@
1
1
  export class FontFaceObject {
2
- constructor(translatedData: any, inspectFont?: null);
2
+ constructor(translatedData: any, inspectFont: null | undefined, extra: any, charProcOperatorList: any);
3
3
  compiledGlyphs: any;
4
4
  _inspectFont: any;
5
+ charProcOperatorList: any;
5
6
  createNativeFontFace(): FontFace | null;
6
7
  createFontFaceRule(): string | null;
7
8
  getPathGenerator(objs: any, character: any): any;
9
+ get black(): any;
10
+ get bold(): any;
11
+ get disableFontFace(): any;
12
+ get fontExtraProperties(): any;
13
+ get isInvalidPDFjsFont(): any;
14
+ get isType3Font(): any;
15
+ get italic(): any;
16
+ get missingFile(): any;
17
+ get remeasure(): any;
18
+ get vertical(): any;
19
+ get ascent(): any;
20
+ get defaultWidth(): any;
21
+ get descent(): any;
22
+ get bbox(): any;
23
+ get fontMatrix(): any;
24
+ get fallbackName(): any;
25
+ get loadedName(): any;
26
+ get mimetype(): any;
27
+ get name(): any;
28
+ get data(): any;
29
+ clearData(): void;
30
+ get cssFontInfo(): any;
31
+ get systemFontInfo(): any;
32
+ get defaultVMetrics(): any;
33
+ #private;
8
34
  }
9
35
  export class FontLoader {
10
36
  constructor({ ownerDocument, styleElement, }: {
@@ -18,7 +18,7 @@ export class TilingPattern {
18
18
  ctx: any;
19
19
  canvasGraphicsFactory: any;
20
20
  baseTransform: any;
21
- createPatternCanvas(owner: any): {
21
+ createPatternCanvas(owner: any, opIdx: any): {
22
22
  canvas: any;
23
23
  scaleX: any;
24
24
  scaleY: any;
@@ -32,7 +32,7 @@ export class TilingPattern {
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
34
  isModifyingCurrentTransform(): boolean;
35
- getPattern(ctx: any, owner: any, inverse: any, pathType: any): any;
35
+ getPattern(ctx: any, owner: any, inverse: any, pathType: any, opIdx: any): any;
36
36
  }
37
37
  declare class RadialAxialShadingPattern extends BaseShadingPattern {
38
38
  constructor(IR: any);
@@ -12,13 +12,16 @@ 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
14
  import { AnnotationType } from "./shared/util.js";
15
+ import { applyOpacity } from "./display/display_utils.js";
15
16
  import { build } from "./display/api.js";
16
17
  import { ColorPicker } from "./display/editor/color_picker.js";
17
18
  import { createValidAbsoluteUrl } from "./shared/util.js";
19
+ import { CSSConstants } from "./display/display_utils.js";
18
20
  import { DOMSVGFactory } from "./display/svg_factory.js";
19
21
  import { DrawLayer } from "./display/draw_layer.js";
20
22
  import { FeatureTest } from "./shared/util.js";
21
23
  import { fetchData } from "./display/display_utils.js";
24
+ import { findContrastColor } from "./display/display_utils.js";
22
25
  import { getDocument } from "./display/api.js";
23
26
  import { getFilenameFromUrl } from "./display/display_utils.js";
24
27
  import { getPdfFilenameFromUrl } from "./display/display_utils.js";
@@ -43,6 +46,7 @@ import { PDFWorker } from "./display/api.js";
43
46
  import { PermissionFlag } from "./shared/util.js";
44
47
  import { PixelsPerInch } from "./display/display_utils.js";
45
48
  import { RenderingCancelledException } from "./display/display_utils.js";
49
+ import { renderRichText } from "./display/display_utils.js";
46
50
  import { ResponseException } from "./shared/util.js";
47
51
  import { setLayerDimensions } from "./display/display_utils.js";
48
52
  import { shadow } from "./shared/util.js";
@@ -56,4 +60,4 @@ import { Util } from "./shared/util.js";
56
60
  import { VerbosityLevel } from "./shared/util.js";
57
61
  import { version } from "./display/api.js";
58
62
  import { XfaLayer } from "./display/xfa_layer.js";
59
- export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, AnnotationType, build, ColorPicker, createValidAbsoluteUrl, DOMSVGFactory, DrawLayer, FeatureTest, fetchData, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getRGB, 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 };
63
+ export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, AnnotationType, applyOpacity, build, ColorPicker, createValidAbsoluteUrl, CSSConstants, DOMSVGFactory, DrawLayer, FeatureTest, fetchData, findContrastColor, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getRGB, getUuid, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, isPdfFile, isValidExplicitDest, MathClamp, noContextMenu, normalizeUnicode, OPS, OutputScale, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, PermissionFlag, PixelsPerInch, RenderingCancelledException, renderRichText, ResponseException, setLayerDimensions, shadow, SignatureExtractor, stopEvent, SupportedImageMimeTypes, TextLayer, TouchManager, updateUrlHash, Util, VerbosityLevel, version, XfaLayer };
@@ -0,0 +1,64 @@
1
+ export class CssFontInfo {
2
+ static strings: string[];
3
+ static write(info: any): ArrayBuffer;
4
+ constructor(buffer: any);
5
+ get fontFamily(): string;
6
+ get fontWeight(): string;
7
+ get italicAngle(): string;
8
+ #private;
9
+ }
10
+ export class FontInfo {
11
+ static bools: string[];
12
+ static numbers: string[];
13
+ static strings: string[];
14
+ static #OFFSET_NUMBERS: number;
15
+ static #OFFSET_BBOX: number;
16
+ static #OFFSET_FONT_MATRIX: number;
17
+ static #OFFSET_DEFAULT_VMETRICS: number;
18
+ static #OFFSET_STRINGS: number;
19
+ static write(font: any): any;
20
+ constructor({ data, extra }: {
21
+ data: any;
22
+ extra: any;
23
+ });
24
+ get black(): boolean | undefined;
25
+ get bold(): boolean | undefined;
26
+ get disableFontFace(): boolean | undefined;
27
+ get fontExtraProperties(): boolean | undefined;
28
+ get isInvalidPDFjsFont(): boolean | undefined;
29
+ get isType3Font(): boolean | undefined;
30
+ get italic(): boolean | undefined;
31
+ get missingFile(): boolean | undefined;
32
+ get remeasure(): boolean | undefined;
33
+ get vertical(): boolean | undefined;
34
+ get ascent(): number;
35
+ get defaultWidth(): number;
36
+ get descent(): number;
37
+ get bbox(): number[] | undefined;
38
+ get fontMatrix(): number[] | undefined;
39
+ get defaultVMetrics(): number[] | undefined;
40
+ get fallbackName(): string;
41
+ get loadedName(): string;
42
+ get mimetype(): string;
43
+ get name(): string;
44
+ get data(): Uint8Array<any> | undefined;
45
+ clearData(): void;
46
+ get cssFontInfo(): CssFontInfo | null;
47
+ get systemFontInfo(): SystemFontInfo | null;
48
+ #private;
49
+ }
50
+ export class SystemFontInfo {
51
+ static strings: string[];
52
+ static write(info: any): any;
53
+ constructor(buffer: any);
54
+ get guessFallback(): boolean;
55
+ get css(): string;
56
+ get loadedName(): string;
57
+ get baseFontName(): string;
58
+ get src(): string;
59
+ get style(): {
60
+ style: string;
61
+ weight: string;
62
+ };
63
+ #private;
64
+ }
@@ -6,6 +6,7 @@ export type IPDFLinkService = import("./interfaces").IPDFLinkService;
6
6
  export type StructTreeLayerBuilder = import("./struct_tree_layer_builder.js").StructTreeLayerBuilder;
7
7
  export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
8
8
  export type AnnotationEditorUIManager = import("../src/display/editor/tools.js").AnnotationEditorUIManager;
9
+ export type CommentManager = import("./comment_manager.js").CommentManager;
9
10
  export type AnnotationLayerBuilderOptions = {
10
11
  pdfPage: PDFPageProxy;
11
12
  annotationStorage?: import("../src/display/annotation_storage").AnnotationStorage | undefined;
@@ -27,6 +28,7 @@ export type AnnotationLayerBuilderOptions = {
27
28
  accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
28
29
  annotationEditorUIManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
29
30
  onAppend?: Function | undefined;
31
+ commentManager?: import("./comment_manager.js").CommentManager | undefined;
30
32
  };
31
33
  export type AnnotationLayerBuilderRenderOptions = {
32
34
  viewport: PageViewport;
@@ -36,11 +38,6 @@ export type AnnotationLayerBuilderRenderOptions = {
36
38
  intent?: string | undefined;
37
39
  structTreeLayer?: import("./struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
38
40
  };
39
- export type InjectLinkAnnotationsOptions = {
40
- inferredLinks: Array<Object>;
41
- viewport: PageViewport;
42
- structTreeLayer?: import("./struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
43
- };
44
41
  /**
45
42
  * @typedef {Object} AnnotationLayerBuilderOptions
46
43
  * @property {PDFPageProxy} pdfPage
@@ -59,6 +56,7 @@ export type InjectLinkAnnotationsOptions = {
59
56
  * @property {TextAccessibilityManager} [accessibilityManager]
60
57
  * @property {AnnotationEditorUIManager} [annotationEditorUIManager]
61
58
  * @property {function} [onAppend]
59
+ * @property {CommentManager} [commentManager]
62
60
  */
63
61
  /**
64
62
  * @typedef {Object} AnnotationLayerBuilderRenderOptions
@@ -66,17 +64,11 @@ export type InjectLinkAnnotationsOptions = {
66
64
  * @property {string} [intent] - The default value is "display".
67
65
  * @property {StructTreeLayerBuilder} [structTreeLayer]
68
66
  */
69
- /**
70
- * @typedef {Object} InjectLinkAnnotationsOptions
71
- * @property {Array<Object>} inferredLinks
72
- * @property {PageViewport} viewport
73
- * @property {StructTreeLayerBuilder} [structTreeLayer]
74
- */
75
67
  export class AnnotationLayerBuilder {
76
68
  /**
77
69
  * @param {AnnotationLayerBuilderOptions} options
78
70
  */
79
- constructor({ pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableComment, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, annotationEditorUIManager, onAppend, }: AnnotationLayerBuilderOptions);
71
+ constructor({ pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableComment, commentManager, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, annotationEditorUIManager, onAppend, }: AnnotationLayerBuilderOptions);
80
72
  pdfPage: import("../src/display/api").PDFPageProxy;
81
73
  linkService: import("./interfaces").IPDFLinkService;
82
74
  downloadManager: import("./interfaces").IDownloadManager | undefined;
@@ -106,11 +98,11 @@ export class AnnotationLayerBuilder {
106
98
  hide(internal?: boolean): void;
107
99
  hasEditableAnnotations(): boolean;
108
100
  /**
109
- * @param {InjectLinkAnnotationsOptions} options
101
+ * @param {Array<Object>} inferredLinks
110
102
  * @returns {Promise<void>} A promise that is resolved when the inferred links
111
103
  * are added to the annotation layer.
112
104
  */
113
- injectLinkAnnotations({ inferredLinks, viewport, structTreeLayer, }: InjectLinkAnnotationsOptions): Promise<void>;
105
+ injectLinkAnnotations(inferredLinks: Array<Object>): Promise<void>;
114
106
  #private;
115
107
  }
116
108
  import { AnnotationLayer } from "../src/pdf";
@@ -7,7 +7,7 @@ export class BasePDFPageView {
7
7
  eventBus: null;
8
8
  id: null;
9
9
  pageColors: null;
10
- recordedGroups: null;
10
+ recordedBBoxes: null;
11
11
  renderingQueue: null;
12
12
  renderTask: null;
13
13
  resume: null;
@@ -0,0 +1,20 @@
1
+ export class CommentManager {
2
+ static #hasForcedColors: null;
3
+ static _makeCommentColor(color: any, opacity: any): string | null;
4
+ constructor(commentDialog: any, sidebar: any, eventBus: any, linkService: any, overlayManager: any, ltr: any, hasForcedColors: any);
5
+ dialogElement: any;
6
+ setSidebarUiManager(uiManager: any): void;
7
+ showSidebar(annotations: any): void;
8
+ hideSidebar(): void;
9
+ removeComments(ids: any): void;
10
+ selectComment(id: any): void;
11
+ addComment(annotation: any): void;
12
+ updateComment(annotation: any): void;
13
+ toggleCommentPopup(editor: any, isSelected: any, visibility: any, isEditable: any): void;
14
+ destroyPopup(): void;
15
+ updatePopupColor(editor: any): void;
16
+ showDialog(uiManager: any, editor: any, posX: any, posY: any, options: any): Promise<void>;
17
+ makeCommentColor(color: any, opacity: any): string | null;
18
+ destroy(): void;
19
+ #private;
20
+ }
@@ -105,8 +105,9 @@ export class PDFLinkService implements IPDFLinkService {
105
105
  * @param {number} pageNumber - The page number to scroll to.
106
106
  * @param {number} x - The x-coordinate to scroll to in page coordinates.
107
107
  * @param {number} y - The y-coordinate to scroll to in page coordinates.
108
+ * @param {Object} [options]
108
109
  */
109
- goToXY(pageNumber: number, x: number, y: number): void;
110
+ goToXY(pageNumber: number, x: number, y: number, options?: Object): void;
110
111
  /**
111
112
  * Adds various attributes (href, title, target, rel) to hyperlinks.
112
113
  * @param {HTMLAnchorElement} link
@@ -4,6 +4,7 @@ export type EventBus = import("./event_utils").EventBus;
4
4
  export type IL10n = import("./interfaces").IL10n;
5
5
  export type IRenderableView = import("./interfaces").IRenderableView;
6
6
  export type PDFRenderingQueue = import("./pdf_rendering_queue").PDFRenderingQueue;
7
+ export type CommentManager = import("./comment_manager.js").CommentManager;
7
8
  export type PDFPageViewOptions = {
8
9
  /**
9
10
  * - The viewer element.
@@ -108,6 +109,10 @@ export type PDFPageViewOptions = {
108
109
  * text that look like URLs. The default value is `true`.
109
110
  */
110
111
  enableAutoLinking?: boolean | undefined;
112
+ /**
113
+ * - The comment manager instance.
114
+ */
115
+ commentManager?: import("./comment_manager.js").CommentManager | undefined;
111
116
  };
112
117
  /**
113
118
  * @implements {IRenderableView}
@@ -207,7 +212,7 @@ export class PDFPageView extends BasePDFPageView implements IRenderableView {
207
212
  get height(): number;
208
213
  getPagePoint(x: any, y: any): any[];
209
214
  _ensureCanvasWrapper(): null;
210
- _getRenderingContext(canvas: any, transform: any): {
215
+ _getRenderingContext(canvas: any, transform: any, recordOperations: any): {
211
216
  canvas: any;
212
217
  transform: any;
213
218
  viewport: import("../src/display/display_utils").PageViewport;
@@ -216,7 +221,7 @@ export class PDFPageView extends BasePDFPageView implements IRenderableView {
216
221
  annotationCanvasMap: any;
217
222
  pageColors: null;
218
223
  isEditing: boolean;
219
- recordOperations: boolean;
224
+ recordOperations: any;
220
225
  };
221
226
  draw(): Promise<void>;
222
227
  /**
@@ -387,12 +387,15 @@ export class PDFViewer {
387
387
  * The default value is `false`.
388
388
  * @property {boolean} [ignoreDestinationZoom] - Ignore the zoom argument in
389
389
  * the destination array. The default value is `false`.
390
+ * @property {string} [center] - Center the view on the specified coordinates.
391
+ * The default value is `null`. Possible values are: `null` (don't center),
392
+ * `horizontal`, `vertical` and `both`.
390
393
  */
391
394
  /**
392
395
  * Scrolls page into view.
393
396
  * @param {ScrollPageIntoViewParameters} params
394
397
  */
395
- scrollPageIntoView({ pageNumber, destArray, allowNegativeOffset, ignoreDestinationZoom, }: {
398
+ scrollPageIntoView({ pageNumber, destArray, allowNegativeOffset, ignoreDestinationZoom, center, }: {
396
399
  /**
397
400
  * - The page number.
398
401
  */
@@ -412,6 +415,12 @@ export class PDFViewer {
412
415
  * the destination array. The default value is `false`.
413
416
  */
414
417
  ignoreDestinationZoom?: boolean | undefined;
418
+ /**
419
+ * - Center the view on the specified coordinates.
420
+ * The default value is `null`. Possible values are: `null` (don't center),
421
+ * `horizontal`, `vertical` and `both`.
422
+ */
423
+ center?: string | undefined;
415
424
  }): void;
416
425
  _updateLocation(firstPage: any): void;
417
426
  update(): void;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "unpdf",
3
3
  "type": "module",
4
- "version": "1.3.2",
5
- "packageManager": "pnpm@10.17.0",
4
+ "version": "1.4.0",
5
+ "packageManager": "pnpm@10.20.0",
6
6
  "description": "PDF extraction and rendering across all JavaScript runtimes",
7
7
  "author": "Johann Schopplich <hello@johannschopplich.com>",
8
8
  "license": "MIT",
@@ -70,23 +70,23 @@
70
70
  }
71
71
  },
72
72
  "devDependencies": {
73
- "@antfu/eslint-config": "^5.3.0",
74
- "@napi-rs/canvas": "^0.1.80",
75
- "@rollup/plugin-alias": "^5.1.1",
73
+ "@antfu/eslint-config": "^6.2.0",
74
+ "@napi-rs/canvas": "^0.1.81",
75
+ "@rollup/plugin-alias": "^6.0.0",
76
76
  "@rollup/plugin-inject": "^5.0.5",
77
- "@rollup/plugin-node-resolve": "^16.0.1",
78
- "@rollup/plugin-replace": "^6.0.2",
77
+ "@rollup/plugin-node-resolve": "^16.0.3",
78
+ "@rollup/plugin-replace": "^6.0.3",
79
79
  "@rollup/plugin-terser": "^0.4.4",
80
- "@rollup/plugin-typescript": "^12.1.4",
81
- "@types/node": "^24.5.2",
82
- "bumpp": "^10.2.3",
83
- "eslint": "^9.35.0",
80
+ "@rollup/plugin-typescript": "^12.3.0",
81
+ "@types/node": "^24.9.2",
82
+ "bumpp": "^10.3.1",
83
+ "eslint": "^9.38.0",
84
84
  "fast-glob": "^3.3.3",
85
- "pdfjs-dist": "~5.4.149",
86
- "rollup": "^4.51.0",
85
+ "pdfjs-dist": "~5.4.296",
86
+ "rollup": "^4.52.5",
87
87
  "tslib": "^2.8.1",
88
- "typescript": "^5.9.2",
88
+ "typescript": "^5.9.3",
89
89
  "unbuild": "^3.6.1",
90
- "vitest": "^3.2.4"
90
+ "vitest": "^4.0.5"
91
91
  }
92
92
  }