@vue-pdf-viewer/viewer 3.0.0-alpha.20 → 3.0.0-alpha.22

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.
@@ -54,6 +54,25 @@ export declare function getSelectionBoxes(textLayer: HTMLElement): {
54
54
  * @param {PageViewport} viewport - PDF page viewport
55
55
  * @returns {number[]} Array of quadPoints in PDF coordinate system
56
56
  */
57
+ /**
58
+ * Convert selection boxes to PDF quadPoints coordinates
59
+ *
60
+ * In PDF, quadPoints are used to define the coordinates of a quadrilateral.
61
+ * Each quadrilateral requires 8 numbers representing 4 points (x,y pairs).
62
+ * The points MUST be specified in the following order (x,y pairs):
63
+ * - (x1,y1): left x, bottom y - bottom left
64
+ * - (x2,y2): right x, bottom y - bottom right
65
+ * - (x3,y3): left x, top y - top left
66
+ * - (x4,y4): right x, top y - top right
67
+ *
68
+ * This order is based on PDF.js implementation and real-world PDF files,
69
+ * which differs slightly from the PDF specification (which suggests a different order).
70
+ *
71
+ * @param boxes Array of normalized boxes (coordinates in 0-1 range)
72
+ * @param viewport PDF page viewport for coordinate conversion
73
+ * @returns Array of quadPoints in PDF coordinate system
74
+ * @throws Error if boxes array is empty
75
+ */
57
76
  export declare function boxesToQuadPoints(boxes: Array<{
58
77
  x: number;
59
78
  y: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue-pdf-viewer/viewer",
3
3
  "private": false,
4
- "version": "3.0.0-alpha.20",
4
+ "version": "3.0.0-alpha.22",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
7
7
  "module": "./dist/index.js",
@@ -59,7 +59,7 @@
59
59
  "prepare": "husky"
60
60
  },
61
61
  "dependencies": {
62
- "@vue-pdf-viewer/shared": "1.0.0-alpha.3",
62
+ "@vue-pdf-viewer/shared": "1.0.0-alpha.4",
63
63
  "@vueuse/core": "^13.6.0",
64
64
  "pdfjs-dist": "4.10.38",
65
65
  "reka-ui": "^2.4.1",