@vue-pdf-viewer/annotation 1.3.0-beta.0 → 1.3.0-beta.2

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.
@@ -1,9 +1,23 @@
1
+ import { type DeletedAnnotationData } from "@vue-pdf-viewer/shared";
1
2
  import type { Annotation } from "../types";
2
3
  export declare class AnnotationPdfSerializer {
3
4
  /**
4
5
  * Serialize annotations into a PDF document
6
+ * @param originalBytes - The original PDF bytes
7
+ * @param annotations - Annotations to add to the PDF
8
+ * @param deletedAnnotations - Annotation data for removal (supports both string IDs and full objects)
5
9
  */
6
- static serializeAnnotationsToPdf(originalBytes: Uint8Array, annotations: Annotation[]): Promise<Uint8Array>;
10
+ static serializeAnnotationsToPdf(originalBytes: Uint8Array, annotations: Annotation[], deletedAnnotations?: DeletedAnnotationData[] | string[]): Promise<Uint8Array>;
11
+ /**
12
+ * Remove annotations from the PDF
13
+ * Supports both ID-based matching (via /NM field) and position-based matching as fallback
14
+ */
15
+ private static removeAnnotations;
16
+ /**
17
+ * Check if a PDF annotation matches any of the deleted annotations
18
+ * First tries to match by /NM (ID), then falls back to position matching
19
+ */
20
+ private static matchesDeletedAnnotation;
7
21
  private static addTextMarkupAnnotation;
8
22
  /**
9
23
  * Add a rectangle (square) annotation to the PDF
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue-pdf-viewer/annotation",
3
3
  "private": false,
4
- "version": "1.3.0-beta.0",
4
+ "version": "1.3.0-beta.2",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
7
7
  "module": "./dist/index.js",
@@ -30,8 +30,8 @@
30
30
  "vue": "^3.2.37"
31
31
  },
32
32
  "dependencies": {
33
- "@pdf-viewer/pdf": "1.0.0",
34
- "@vue-pdf-viewer/shared": "1.2.0-rc.11",
33
+ "@pdf-viewer/pdf": "1.1.0",
34
+ "@vue-pdf-viewer/shared": "1.2.0-rc.16",
35
35
  "vite-plugin-css-injected-by-js": "^3.5.2",
36
36
  "vue": "^3.2.37"
37
37
  },