@monime/pdfio 0.1.18 → 0.1.20

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.
@@ -0,0 +1,35 @@
1
+ export interface WatermarkConfig {
2
+ text: string;
3
+ /** CSS color string — default: "rgba(0,0,0,0.12)" */
4
+ color?: string;
5
+ /** Font size in px at scale=1 — default: 28 */
6
+ fontSize?: number;
7
+ /** Rotation angle in degrees — default: -35 */
8
+ angle?: number;
9
+ /** Horizontal gap between repeated labels in px — default: 80 */
10
+ gapX?: number;
11
+ /** Vertical gap between repeated labels in px — default: fontSize * 2 */
12
+ gapY?: number;
13
+ /** @deprecated Use `gapX` instead */
14
+ gap?: number;
15
+ /** Font family — default: "sans-serif" */
16
+ fontFamily?: string;
17
+ /** Font weight — default: "600" */
18
+ fontWeight?: string;
19
+ }
20
+ export type WatermarkJob = {
21
+ pdfBytes: ArrayBuffer;
22
+ watermark?: ResolvedWatermarkConfig;
23
+ };
24
+ export type ResolvedWatermarkConfig = {
25
+ text: string;
26
+ rgba: [number, number, number, number];
27
+ fontSize: number;
28
+ angle: number;
29
+ gapX: number;
30
+ gapY: number;
31
+ fontWeight: string;
32
+ };
33
+ export declare function resolveWatermarkConfig(watermark?: WatermarkConfig | string, rgba?: [number, number, number, number]): ResolvedWatermarkConfig | undefined;
34
+ export declare function watermarkPdfBytes(job: WatermarkJob): Promise<Uint8Array>;
35
+ //# sourceMappingURL=watermarkPdfCore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watermarkPdfCore.d.ts","sourceRoot":"","sources":["../src/lib/watermarkPdfCore.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE,uBAAuB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,SAAS,CAAC,EAAE,eAAe,GAAG,MAAM,EACpC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GACtC,uBAAuB,GAAG,SAAS,CA0BrC;AAoID,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CA8C9E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monime/pdfio",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "description": "A simple custom PDF viewer component for React.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -21,15 +21,6 @@
21
21
  "sideEffects": [
22
22
  "*.css"
23
23
  ],
24
- "scripts": {
25
- "dev": "vite",
26
- "build": "vite build && tsc -p tsconfig.build.json",
27
- "build:demo": "vite build --mode demo",
28
- "preview": "vite preview --mode demo",
29
- "typecheck": "tsc --noEmit",
30
- "deploy": "pnpm build && pnpm publish",
31
- "patch": "pnpm version patch"
32
- },
33
24
  "keywords": [
34
25
  "pdf",
35
26
  "viewer",
@@ -57,5 +48,14 @@
57
48
  },
58
49
  "publishConfig": {
59
50
  "access": "public"
51
+ },
52
+ "scripts": {
53
+ "dev": "vite",
54
+ "build": "vite build && tsc -p tsconfig.build.json",
55
+ "build:demo": "vite build --mode demo",
56
+ "preview": "vite preview --mode demo",
57
+ "typecheck": "tsc --noEmit",
58
+ "deploy": "pnpm build && pnpm publish",
59
+ "patch": "pnpm version patch"
60
60
  }
61
- }
61
+ }