@embedpdf/models 1.2.0 → 1.3.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/dist/pdf.d.ts CHANGED
@@ -155,7 +155,7 @@ export declare const PdfUnwantedTextRegex: RegExp;
155
155
  */
156
156
  export declare function stripPdfUnwantedMarkers(text: string): string;
157
157
  /**
158
- * zoom mode
158
+ * Zoom mode
159
159
  *
160
160
  * @public
161
161
  */
@@ -170,17 +170,29 @@ export declare enum PdfZoomMode {
170
170
  */
171
171
  FitPage = 2,
172
172
  /**
173
- * Fit the page width.
173
+ * Fit the entire page width to the window.
174
174
  */
175
175
  FitHorizontal = 3,
176
176
  /**
177
- * Fit the page height.
177
+ * Fit the entire page height to the window.
178
178
  */
179
179
  FitVertical = 4,
180
180
  /**
181
181
  * Fit a specific rectangle area within the window.
182
182
  */
183
- FitRectangle = 5
183
+ FitRectangle = 5,
184
+ /**
185
+ * Fit bounding box of the entire page (including annotations).
186
+ */
187
+ FitBoundingBox = 6,
188
+ /**
189
+ * Fit the bounding box width of the page.
190
+ */
191
+ FitBoundingBoxHorizontal = 7,
192
+ /**
193
+ * Fit the bounding box height of the page.
194
+ */
195
+ FitBoundingBoxVertical = 8
184
196
  }
185
197
  /**
186
198
  * Trapped status of the document.
@@ -302,6 +314,12 @@ export interface PdfDestinationObject {
302
314
  mode: PdfZoomMode.FitVertical;
303
315
  } | {
304
316
  mode: PdfZoomMode.FitRectangle;
317
+ } | {
318
+ mode: PdfZoomMode.FitBoundingBox;
319
+ } | {
320
+ mode: PdfZoomMode.FitBoundingBoxHorizontal;
321
+ } | {
322
+ mode: PdfZoomMode.FitBoundingBoxVertical;
305
323
  };
306
324
  view: number[];
307
325
  }
@@ -2300,6 +2318,19 @@ export interface PdfEngine<T = Blob> {
2300
2318
  * @returns task that contains the bookmarks or error
2301
2319
  */
2302
2320
  getBookmarks: (doc: PdfDocumentObject) => PdfTask<PdfBookmarksObject>;
2321
+ /**
2322
+ * Set the bookmarks of the file
2323
+ * @param doc - pdf document
2324
+ * @param payload - bookmarks to set
2325
+ * @returns task that contains whether the bookmarks are set successfully or not
2326
+ */
2327
+ setBookmarks: (doc: PdfDocumentObject, payload: PdfBookmarkObject[]) => PdfTask<boolean>;
2328
+ /**
2329
+ * Remove all bookmarks from the document.
2330
+ * @param doc - pdf document
2331
+ * @returns task that contains whether the bookmarks are removed successfully or not
2332
+ */
2333
+ deleteBookmarks: (doc: PdfDocumentObject) => PdfTask<boolean>;
2303
2334
  /**
2304
2335
  * Render the specified pdf page
2305
2336
  * @param doc - pdf document
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embedpdf/models",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "private": false,
5
5
  "description": "Shared type definitions, data models, and utility helpers (geometry, tasks, logging, PDF primitives) that underpin every package in the EmbedPDF ecosystem.",
6
6
  "type": "module",
@@ -33,7 +33,7 @@
33
33
  "typescript": "^5.0.0",
34
34
  "@types/jest": "^29.5.14",
35
35
  "jest": "^29.7.0",
36
- "@embedpdf/build": "1.0.0"
36
+ "@embedpdf/build": "1.0.1"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"