@pdfme/pdf-lib 1.18.1 → 1.18.3
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/cjs/api/PDFDocument.js +195 -225
- package/cjs/api/PDFDocument.js.map +1 -1
- package/cjs/api/PDFEmbeddedFile.js +30 -33
- package/cjs/api/PDFEmbeddedFile.js.map +1 -1
- package/cjs/api/PDFEmbeddedPage.js +5 -7
- package/cjs/api/PDFEmbeddedPage.js.map +1 -1
- package/cjs/api/PDFFont.js +6 -8
- package/cjs/api/PDFFont.js.map +1 -1
- package/cjs/api/PDFImage.js +14 -16
- package/cjs/api/PDFImage.js.map +1 -1
- package/cjs/api/PDFJavaScript.js +19 -22
- package/cjs/api/PDFJavaScript.js.map +1 -1
- package/cjs/api/PDFPage.d.ts.map +1 -1
- package/cjs/api/PDFPage.js +26 -16
- package/cjs/api/PDFPage.js.map +1 -1
- package/cjs/api/PDFPageOptions.d.ts +14 -8
- package/cjs/api/PDFPageOptions.d.ts.map +1 -1
- package/cjs/api/PDFPageOptions.js.map +1 -1
- package/cjs/api/form/PDFField.js +1 -1
- package/cjs/api/form/PDFField.js.map +1 -1
- package/cjs/api/form/PDFForm.js +1 -1
- package/cjs/api/form/PDFForm.js.map +1 -1
- package/cjs/api/form/appearances.js +56 -16
- package/cjs/api/form/appearances.js.map +1 -1
- package/cjs/api/operations.d.ts +15 -0
- package/cjs/api/operations.d.ts.map +1 -1
- package/cjs/api/operations.js +22 -0
- package/cjs/api/operations.js.map +1 -1
- package/cjs/api/svg.d.ts +7 -1
- package/cjs/api/svg.d.ts.map +1 -1
- package/cjs/api/svg.js +332 -1016
- package/cjs/api/svg.js.map +1 -1
- package/cjs/core/PDFContext.js +11 -2
- package/cjs/core/PDFContext.js.map +1 -1
- package/cjs/core/embedders/CustomFontEmbedder.js +62 -74
- package/cjs/core/embedders/CustomFontEmbedder.js.map +1 -1
- package/cjs/core/embedders/CustomFontSubsetEmbedder.js +3 -5
- package/cjs/core/embedders/CustomFontSubsetEmbedder.js.map +1 -1
- package/cjs/core/embedders/FileEmbedder.js +30 -32
- package/cjs/core/embedders/FileEmbedder.js.map +1 -1
- package/cjs/core/embedders/JavaScriptEmbedder.js +12 -14
- package/cjs/core/embedders/JavaScriptEmbedder.js.map +1 -1
- package/cjs/core/embedders/JpegEmbedder.js +54 -59
- package/cjs/core/embedders/JpegEmbedder.js.map +1 -1
- package/cjs/core/embedders/PDFPageEmbedder.js +22 -26
- package/cjs/core/embedders/PDFPageEmbedder.js.map +1 -1
- package/cjs/core/embedders/PngEmbedder.js +20 -25
- package/cjs/core/embedders/PngEmbedder.js.map +1 -1
- package/cjs/core/parser/PDFObjectStreamParser.js +15 -17
- package/cjs/core/parser/PDFObjectStreamParser.js.map +1 -1
- package/cjs/core/parser/PDFParser.js +66 -74
- package/cjs/core/parser/PDFParser.js.map +1 -1
- package/cjs/core/writers/PDFStreamWriter.js +53 -55
- package/cjs/core/writers/PDFStreamWriter.js.map +1 -1
- package/cjs/core/writers/PDFWriter.js +62 -66
- package/cjs/core/writers/PDFWriter.js.map +1 -1
- package/cjs/types/index.d.ts +4 -4
- package/cjs/types/index.d.ts.map +1 -1
- package/dist/pdf-lib.esm.js +1123 -2589
- package/dist/pdf-lib.esm.js.map +1 -1
- package/dist/pdf-lib.esm.min.js +1 -15
- package/dist/pdf-lib.esm.min.js.map +1 -1
- package/dist/pdf-lib.js +1123 -2589
- package/dist/pdf-lib.js.map +1 -1
- package/dist/pdf-lib.min.js +1 -15
- package/dist/pdf-lib.min.js.map +1 -1
- package/es/api/PDFDocument.js +195 -226
- package/es/api/PDFDocument.js.map +1 -1
- package/es/api/PDFEmbeddedFile.js +30 -33
- package/es/api/PDFEmbeddedFile.js.map +1 -1
- package/es/api/PDFEmbeddedPage.js +5 -8
- package/es/api/PDFEmbeddedPage.js.map +1 -1
- package/es/api/PDFFont.js +6 -9
- package/es/api/PDFFont.js.map +1 -1
- package/es/api/PDFImage.js +14 -17
- package/es/api/PDFImage.js.map +1 -1
- package/es/api/PDFJavaScript.js +19 -22
- package/es/api/PDFJavaScript.js.map +1 -1
- package/es/api/PDFPage.d.ts.map +1 -1
- package/es/api/PDFPage.js +26 -17
- package/es/api/PDFPage.js.map +1 -1
- package/es/api/PDFPageOptions.d.ts +14 -8
- package/es/api/PDFPageOptions.d.ts.map +1 -1
- package/es/api/PDFPageOptions.js.map +1 -1
- package/es/api/form/PDFField.js +1 -1
- package/es/api/form/PDFField.js.map +1 -1
- package/es/api/form/PDFForm.js +1 -1
- package/es/api/form/PDFForm.js.map +1 -1
- package/es/api/form/appearances.js +56 -16
- package/es/api/form/appearances.js.map +1 -1
- package/es/api/operations.d.ts +15 -0
- package/es/api/operations.d.ts.map +1 -1
- package/es/api/operations.js +23 -1
- package/es/api/operations.js.map +1 -1
- package/es/api/svg.d.ts +7 -1
- package/es/api/svg.d.ts.map +1 -1
- package/es/api/svg.js +333 -1017
- package/es/api/svg.js.map +1 -1
- package/es/core/PDFContext.js +11 -2
- package/es/core/PDFContext.js.map +1 -1
- package/es/core/embedders/CustomFontEmbedder.js +62 -75
- package/es/core/embedders/CustomFontEmbedder.js.map +1 -1
- package/es/core/embedders/CustomFontSubsetEmbedder.js +3 -6
- package/es/core/embedders/CustomFontSubsetEmbedder.js.map +1 -1
- package/es/core/embedders/FileEmbedder.js +30 -33
- package/es/core/embedders/FileEmbedder.js.map +1 -1
- package/es/core/embedders/JavaScriptEmbedder.js +12 -15
- package/es/core/embedders/JavaScriptEmbedder.js.map +1 -1
- package/es/core/embedders/JpegEmbedder.js +54 -59
- package/es/core/embedders/JpegEmbedder.js.map +1 -1
- package/es/core/embedders/PDFPageEmbedder.js +22 -27
- package/es/core/embedders/PDFPageEmbedder.js.map +1 -1
- package/es/core/embedders/PngEmbedder.js +20 -25
- package/es/core/embedders/PngEmbedder.js.map +1 -1
- package/es/core/parser/PDFObjectStreamParser.js +15 -18
- package/es/core/parser/PDFObjectStreamParser.js.map +1 -1
- package/es/core/parser/PDFParser.js +66 -75
- package/es/core/parser/PDFParser.js.map +1 -1
- package/es/core/writers/PDFStreamWriter.js +53 -56
- package/es/core/writers/PDFStreamWriter.js.map +1 -1
- package/es/core/writers/PDFWriter.js +62 -67
- package/es/core/writers/PDFWriter.js.map +1 -1
- package/es/types/index.d.ts +4 -4
- package/es/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/PDFPage.ts +12 -0
- package/src/api/PDFPageOptions.ts +14 -8
- package/src/api/operations.ts +45 -3
- package/src/api/svg.ts +305 -1086
- package/src/types/index.ts +6 -1
- package/ts3.4/cjs/api/PDFPageOptions.d.ts +14 -8
- package/ts3.4/cjs/api/operations.d.ts +15 -0
- package/ts3.4/cjs/api/svg.d.ts +7 -1
- package/ts3.4/cjs/types/index.d.ts +4 -4
- package/ts3.4/es/api/PDFPageOptions.d.ts +14 -8
- package/ts3.4/es/api/operations.d.ts +15 -0
- package/ts3.4/es/api/svg.d.ts +7 -1
- package/ts3.4/es/types/index.d.ts +4 -4
package/src/types/index.ts
CHANGED
|
@@ -28,6 +28,11 @@ export type GraphicElement =
|
|
|
28
28
|
| Rectangle
|
|
29
29
|
| Segment;
|
|
30
30
|
|
|
31
|
-
export type Space = {
|
|
31
|
+
export type Space = {
|
|
32
|
+
topLeft: Coordinates
|
|
33
|
+
topRight: Coordinates
|
|
34
|
+
bottomRight: Coordinates
|
|
35
|
+
bottomLeft: Coordinates
|
|
36
|
+
};
|
|
32
37
|
|
|
33
38
|
export type LinkElement = Rectangle | Ellipse;
|
|
@@ -2,6 +2,11 @@ import { Color } from './colors';
|
|
|
2
2
|
import PDFFont from './PDFFont';
|
|
3
3
|
import { Rotation } from './rotations';
|
|
4
4
|
import { FillRule, LineCapStyle } from './operators';
|
|
5
|
+
import { Space, TransformationMatrix } from '../types';
|
|
6
|
+
interface SvgOptions {
|
|
7
|
+
matrix?: TransformationMatrix;
|
|
8
|
+
clipSpaces?: Space[];
|
|
9
|
+
}
|
|
5
10
|
export declare enum BlendMode {
|
|
6
11
|
Normal = "Normal",
|
|
7
12
|
Multiply = "Multiply",
|
|
@@ -16,7 +21,7 @@ export declare enum BlendMode {
|
|
|
16
21
|
Difference = "Difference",
|
|
17
22
|
Exclusion = "Exclusion"
|
|
18
23
|
}
|
|
19
|
-
export interface PDFPageDrawTextOptions {
|
|
24
|
+
export interface PDFPageDrawTextOptions extends SvgOptions {
|
|
20
25
|
color?: Color;
|
|
21
26
|
opacity?: number;
|
|
22
27
|
blendMode?: BlendMode;
|
|
@@ -31,7 +36,7 @@ export interface PDFPageDrawTextOptions {
|
|
|
31
36
|
maxWidth?: number;
|
|
32
37
|
wordBreaks?: string[];
|
|
33
38
|
}
|
|
34
|
-
export interface PDFPageDrawImageOptions {
|
|
39
|
+
export interface PDFPageDrawImageOptions extends SvgOptions {
|
|
35
40
|
x?: number;
|
|
36
41
|
y?: number;
|
|
37
42
|
width?: number;
|
|
@@ -55,7 +60,7 @@ export interface PDFPageDrawPageOptions {
|
|
|
55
60
|
opacity?: number;
|
|
56
61
|
blendMode?: BlendMode;
|
|
57
62
|
}
|
|
58
|
-
export interface PDFPageDrawSVGOptions {
|
|
63
|
+
export interface PDFPageDrawSVGOptions extends SvgOptions {
|
|
59
64
|
x?: number;
|
|
60
65
|
y?: number;
|
|
61
66
|
scale?: number;
|
|
@@ -71,7 +76,7 @@ export interface PDFPageDrawSVGOptions {
|
|
|
71
76
|
blendMode?: BlendMode;
|
|
72
77
|
fillRule?: FillRule;
|
|
73
78
|
}
|
|
74
|
-
export interface PDFPageDrawLineOptions {
|
|
79
|
+
export interface PDFPageDrawLineOptions extends SvgOptions {
|
|
75
80
|
start: {
|
|
76
81
|
x: number;
|
|
77
82
|
y: number;
|
|
@@ -88,7 +93,7 @@ export interface PDFPageDrawLineOptions {
|
|
|
88
93
|
dashPhase?: number;
|
|
89
94
|
blendMode?: BlendMode;
|
|
90
95
|
}
|
|
91
|
-
export interface PDFPageDrawRectangleOptions {
|
|
96
|
+
export interface PDFPageDrawRectangleOptions extends SvgOptions {
|
|
92
97
|
x?: number;
|
|
93
98
|
y?: number;
|
|
94
99
|
width?: number;
|
|
@@ -106,7 +111,7 @@ export interface PDFPageDrawRectangleOptions {
|
|
|
106
111
|
borderLineCap?: LineCapStyle;
|
|
107
112
|
blendMode?: BlendMode;
|
|
108
113
|
}
|
|
109
|
-
export interface PDFPageDrawSquareOptions {
|
|
114
|
+
export interface PDFPageDrawSquareOptions extends SvgOptions {
|
|
110
115
|
x?: number;
|
|
111
116
|
y?: number;
|
|
112
117
|
size?: number;
|
|
@@ -123,7 +128,7 @@ export interface PDFPageDrawSquareOptions {
|
|
|
123
128
|
borderLineCap?: LineCapStyle;
|
|
124
129
|
blendMode?: BlendMode;
|
|
125
130
|
}
|
|
126
|
-
export interface PDFPageDrawEllipseOptions {
|
|
131
|
+
export interface PDFPageDrawEllipseOptions extends SvgOptions {
|
|
127
132
|
x?: number;
|
|
128
133
|
y?: number;
|
|
129
134
|
xScale?: number;
|
|
@@ -139,7 +144,7 @@ export interface PDFPageDrawEllipseOptions {
|
|
|
139
144
|
borderLineCap?: LineCapStyle;
|
|
140
145
|
blendMode?: BlendMode;
|
|
141
146
|
}
|
|
142
|
-
export interface PDFPageDrawCircleOptions {
|
|
147
|
+
export interface PDFPageDrawCircleOptions extends SvgOptions {
|
|
143
148
|
x?: number;
|
|
144
149
|
y?: number;
|
|
145
150
|
size?: number;
|
|
@@ -163,4 +168,5 @@ export interface PDFPageDrawSVGElementOptions {
|
|
|
163
168
|
[fontName: string]: PDFFont;
|
|
164
169
|
};
|
|
165
170
|
}
|
|
171
|
+
export {};
|
|
166
172
|
//# sourceMappingURL=PDFPageOptions.d.ts.map
|
|
@@ -2,6 +2,7 @@ import { Color } from './colors';
|
|
|
2
2
|
import { scale, LineCapStyle, FillRule } from './operators';
|
|
3
3
|
import { Rotation } from './rotations';
|
|
4
4
|
import { PDFHexString, PDFName, PDFNumber, PDFOperator } from '../core';
|
|
5
|
+
import { Space, TransformationMatrix } from '../types';
|
|
5
6
|
export interface DrawTextOptions {
|
|
6
7
|
color: Color;
|
|
7
8
|
font: string | PDFName;
|
|
@@ -12,7 +13,10 @@ export interface DrawTextOptions {
|
|
|
12
13
|
x: number | PDFNumber;
|
|
13
14
|
y: number | PDFNumber;
|
|
14
15
|
graphicsState?: string | PDFName;
|
|
16
|
+
matrix?: TransformationMatrix;
|
|
17
|
+
clipSpaces?: Space[];
|
|
15
18
|
}
|
|
19
|
+
declare const clipSpaces: (spaces: Space[]) => PDFOperator[];
|
|
16
20
|
export declare const drawText: (line: PDFHexString, options: DrawTextOptions) => PDFOperator[];
|
|
17
21
|
export interface DrawLinesOfTextOptions extends DrawTextOptions {
|
|
18
22
|
lineHeight: number | PDFNumber;
|
|
@@ -27,6 +31,8 @@ export declare const drawImage: (name: string | PDFName, options: {
|
|
|
27
31
|
xSkew: Rotation;
|
|
28
32
|
ySkew: Rotation;
|
|
29
33
|
graphicsState?: string | PDFName;
|
|
34
|
+
matrix?: TransformationMatrix;
|
|
35
|
+
clipSpaces?: Space[];
|
|
30
36
|
}) => PDFOperator[];
|
|
31
37
|
export declare const drawPage: (name: string | PDFName, options: {
|
|
32
38
|
x: number | PDFNumber;
|
|
@@ -53,6 +59,8 @@ export declare const drawLine: (options: {
|
|
|
53
59
|
dashPhase?: number | PDFNumber;
|
|
54
60
|
lineCap?: LineCapStyle;
|
|
55
61
|
graphicsState?: string | PDFName;
|
|
62
|
+
matrix?: TransformationMatrix;
|
|
63
|
+
clipSpaces?: Space[];
|
|
56
64
|
}) => PDFOperator[];
|
|
57
65
|
export declare const drawRectangle: (options: {
|
|
58
66
|
x: number | PDFNumber;
|
|
@@ -69,6 +77,8 @@ export declare const drawRectangle: (options: {
|
|
|
69
77
|
borderDashArray?: (number | PDFNumber)[];
|
|
70
78
|
borderDashPhase?: number | PDFNumber;
|
|
71
79
|
graphicsState?: string | PDFName;
|
|
80
|
+
matrix?: TransformationMatrix;
|
|
81
|
+
clipSpaces?: Space[];
|
|
72
82
|
}) => PDFOperator[];
|
|
73
83
|
/** @deprecated */
|
|
74
84
|
export declare const drawEllipsePath: (config: {
|
|
@@ -90,6 +100,8 @@ export declare const drawEllipse: (options: {
|
|
|
90
100
|
borderDashPhase?: number | PDFNumber;
|
|
91
101
|
graphicsState?: string | PDFName;
|
|
92
102
|
borderLineCap?: LineCapStyle;
|
|
103
|
+
matrix?: TransformationMatrix;
|
|
104
|
+
clipSpaces?: Space[];
|
|
93
105
|
}) => PDFOperator[];
|
|
94
106
|
export declare const drawSvgPath: (path: string, options: {
|
|
95
107
|
x: number | PDFNumber;
|
|
@@ -104,6 +116,8 @@ export declare const drawSvgPath: (path: string, options: {
|
|
|
104
116
|
borderLineCap?: LineCapStyle;
|
|
105
117
|
graphicsState?: string | PDFName;
|
|
106
118
|
fillRule?: FillRule;
|
|
119
|
+
matrix?: TransformationMatrix;
|
|
120
|
+
clipSpaces?: Space[];
|
|
107
121
|
}) => PDFOperator[];
|
|
108
122
|
export declare const drawCheckMark: (options: {
|
|
109
123
|
x: number | PDFNumber;
|
|
@@ -210,4 +224,5 @@ export declare const drawOptionList: (options: {
|
|
|
210
224
|
selectedColor: Color;
|
|
211
225
|
padding: number | PDFNumber;
|
|
212
226
|
}) => PDFOperator[];
|
|
227
|
+
export {};
|
|
213
228
|
//# sourceMappingURL=operations.d.ts.map
|
package/ts3.4/cjs/api/svg.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import { Degrees } from './rotations';
|
|
|
4
4
|
import PDFPage from './PDFPage';
|
|
5
5
|
import { PDFPageDrawSVGElementOptions } from './PDFPageOptions';
|
|
6
6
|
import { LineCapStyle, LineJoinStyle, FillRule } from './operators';
|
|
7
|
+
import { TransformationMatrix } from '../types/matrix';
|
|
8
|
+
import { Space } from '../types';
|
|
7
9
|
interface Position {
|
|
8
10
|
x: number;
|
|
9
11
|
y: number;
|
|
@@ -57,8 +59,12 @@ declare type SVGAttributes = {
|
|
|
57
59
|
dominantBaseline?: string;
|
|
58
60
|
points?: string;
|
|
59
61
|
};
|
|
62
|
+
declare type TransformAttributes = {
|
|
63
|
+
matrix: TransformationMatrix;
|
|
64
|
+
clipSpaces: Space[];
|
|
65
|
+
};
|
|
60
66
|
export declare type SVGElement = HTMLElement & {
|
|
61
|
-
svgAttributes: InheritedAttributes & SVGAttributes;
|
|
67
|
+
svgAttributes: InheritedAttributes & SVGAttributes & TransformAttributes;
|
|
62
68
|
};
|
|
63
69
|
export declare const drawSvg: (page: PDFPage, svg: string, options: PDFPageDrawSVGElementOptions) => Promise<void>;
|
|
64
70
|
export {};
|
|
@@ -17,10 +17,10 @@ export declare type Coordinates = {
|
|
|
17
17
|
};
|
|
18
18
|
export declare type GraphicElement = Arc | Circle | Ellipse | Line | Plot | Point | Rectangle | Segment;
|
|
19
19
|
export declare type Space = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
topLeft: Coordinates;
|
|
21
|
+
topRight: Coordinates;
|
|
22
|
+
bottomRight: Coordinates;
|
|
23
|
+
bottomLeft: Coordinates;
|
|
24
24
|
};
|
|
25
25
|
export declare type LinkElement = Rectangle | Ellipse;
|
|
26
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -2,6 +2,11 @@ import { Color } from './colors';
|
|
|
2
2
|
import PDFFont from './PDFFont';
|
|
3
3
|
import { Rotation } from './rotations';
|
|
4
4
|
import { FillRule, LineCapStyle } from './operators';
|
|
5
|
+
import { Space, TransformationMatrix } from '../types';
|
|
6
|
+
interface SvgOptions {
|
|
7
|
+
matrix?: TransformationMatrix;
|
|
8
|
+
clipSpaces?: Space[];
|
|
9
|
+
}
|
|
5
10
|
export declare enum BlendMode {
|
|
6
11
|
Normal = "Normal",
|
|
7
12
|
Multiply = "Multiply",
|
|
@@ -16,7 +21,7 @@ export declare enum BlendMode {
|
|
|
16
21
|
Difference = "Difference",
|
|
17
22
|
Exclusion = "Exclusion"
|
|
18
23
|
}
|
|
19
|
-
export interface PDFPageDrawTextOptions {
|
|
24
|
+
export interface PDFPageDrawTextOptions extends SvgOptions {
|
|
20
25
|
color?: Color;
|
|
21
26
|
opacity?: number;
|
|
22
27
|
blendMode?: BlendMode;
|
|
@@ -31,7 +36,7 @@ export interface PDFPageDrawTextOptions {
|
|
|
31
36
|
maxWidth?: number;
|
|
32
37
|
wordBreaks?: string[];
|
|
33
38
|
}
|
|
34
|
-
export interface PDFPageDrawImageOptions {
|
|
39
|
+
export interface PDFPageDrawImageOptions extends SvgOptions {
|
|
35
40
|
x?: number;
|
|
36
41
|
y?: number;
|
|
37
42
|
width?: number;
|
|
@@ -55,7 +60,7 @@ export interface PDFPageDrawPageOptions {
|
|
|
55
60
|
opacity?: number;
|
|
56
61
|
blendMode?: BlendMode;
|
|
57
62
|
}
|
|
58
|
-
export interface PDFPageDrawSVGOptions {
|
|
63
|
+
export interface PDFPageDrawSVGOptions extends SvgOptions {
|
|
59
64
|
x?: number;
|
|
60
65
|
y?: number;
|
|
61
66
|
scale?: number;
|
|
@@ -71,7 +76,7 @@ export interface PDFPageDrawSVGOptions {
|
|
|
71
76
|
blendMode?: BlendMode;
|
|
72
77
|
fillRule?: FillRule;
|
|
73
78
|
}
|
|
74
|
-
export interface PDFPageDrawLineOptions {
|
|
79
|
+
export interface PDFPageDrawLineOptions extends SvgOptions {
|
|
75
80
|
start: {
|
|
76
81
|
x: number;
|
|
77
82
|
y: number;
|
|
@@ -88,7 +93,7 @@ export interface PDFPageDrawLineOptions {
|
|
|
88
93
|
dashPhase?: number;
|
|
89
94
|
blendMode?: BlendMode;
|
|
90
95
|
}
|
|
91
|
-
export interface PDFPageDrawRectangleOptions {
|
|
96
|
+
export interface PDFPageDrawRectangleOptions extends SvgOptions {
|
|
92
97
|
x?: number;
|
|
93
98
|
y?: number;
|
|
94
99
|
width?: number;
|
|
@@ -106,7 +111,7 @@ export interface PDFPageDrawRectangleOptions {
|
|
|
106
111
|
borderLineCap?: LineCapStyle;
|
|
107
112
|
blendMode?: BlendMode;
|
|
108
113
|
}
|
|
109
|
-
export interface PDFPageDrawSquareOptions {
|
|
114
|
+
export interface PDFPageDrawSquareOptions extends SvgOptions {
|
|
110
115
|
x?: number;
|
|
111
116
|
y?: number;
|
|
112
117
|
size?: number;
|
|
@@ -123,7 +128,7 @@ export interface PDFPageDrawSquareOptions {
|
|
|
123
128
|
borderLineCap?: LineCapStyle;
|
|
124
129
|
blendMode?: BlendMode;
|
|
125
130
|
}
|
|
126
|
-
export interface PDFPageDrawEllipseOptions {
|
|
131
|
+
export interface PDFPageDrawEllipseOptions extends SvgOptions {
|
|
127
132
|
x?: number;
|
|
128
133
|
y?: number;
|
|
129
134
|
xScale?: number;
|
|
@@ -139,7 +144,7 @@ export interface PDFPageDrawEllipseOptions {
|
|
|
139
144
|
borderLineCap?: LineCapStyle;
|
|
140
145
|
blendMode?: BlendMode;
|
|
141
146
|
}
|
|
142
|
-
export interface PDFPageDrawCircleOptions {
|
|
147
|
+
export interface PDFPageDrawCircleOptions extends SvgOptions {
|
|
143
148
|
x?: number;
|
|
144
149
|
y?: number;
|
|
145
150
|
size?: number;
|
|
@@ -163,4 +168,5 @@ export interface PDFPageDrawSVGElementOptions {
|
|
|
163
168
|
[fontName: string]: PDFFont;
|
|
164
169
|
};
|
|
165
170
|
}
|
|
171
|
+
export {};
|
|
166
172
|
//# sourceMappingURL=PDFPageOptions.d.ts.map
|
|
@@ -2,6 +2,7 @@ import { Color } from './colors';
|
|
|
2
2
|
import { scale, LineCapStyle, FillRule } from './operators';
|
|
3
3
|
import { Rotation } from './rotations';
|
|
4
4
|
import { PDFHexString, PDFName, PDFNumber, PDFOperator } from '../core';
|
|
5
|
+
import { Space, TransformationMatrix } from '../types';
|
|
5
6
|
export interface DrawTextOptions {
|
|
6
7
|
color: Color;
|
|
7
8
|
font: string | PDFName;
|
|
@@ -12,7 +13,10 @@ export interface DrawTextOptions {
|
|
|
12
13
|
x: number | PDFNumber;
|
|
13
14
|
y: number | PDFNumber;
|
|
14
15
|
graphicsState?: string | PDFName;
|
|
16
|
+
matrix?: TransformationMatrix;
|
|
17
|
+
clipSpaces?: Space[];
|
|
15
18
|
}
|
|
19
|
+
declare const clipSpaces: (spaces: Space[]) => PDFOperator[];
|
|
16
20
|
export declare const drawText: (line: PDFHexString, options: DrawTextOptions) => PDFOperator[];
|
|
17
21
|
export interface DrawLinesOfTextOptions extends DrawTextOptions {
|
|
18
22
|
lineHeight: number | PDFNumber;
|
|
@@ -27,6 +31,8 @@ export declare const drawImage: (name: string | PDFName, options: {
|
|
|
27
31
|
xSkew: Rotation;
|
|
28
32
|
ySkew: Rotation;
|
|
29
33
|
graphicsState?: string | PDFName;
|
|
34
|
+
matrix?: TransformationMatrix;
|
|
35
|
+
clipSpaces?: Space[];
|
|
30
36
|
}) => PDFOperator[];
|
|
31
37
|
export declare const drawPage: (name: string | PDFName, options: {
|
|
32
38
|
x: number | PDFNumber;
|
|
@@ -53,6 +59,8 @@ export declare const drawLine: (options: {
|
|
|
53
59
|
dashPhase?: number | PDFNumber;
|
|
54
60
|
lineCap?: LineCapStyle;
|
|
55
61
|
graphicsState?: string | PDFName;
|
|
62
|
+
matrix?: TransformationMatrix;
|
|
63
|
+
clipSpaces?: Space[];
|
|
56
64
|
}) => PDFOperator[];
|
|
57
65
|
export declare const drawRectangle: (options: {
|
|
58
66
|
x: number | PDFNumber;
|
|
@@ -69,6 +77,8 @@ export declare const drawRectangle: (options: {
|
|
|
69
77
|
borderDashArray?: (number | PDFNumber)[];
|
|
70
78
|
borderDashPhase?: number | PDFNumber;
|
|
71
79
|
graphicsState?: string | PDFName;
|
|
80
|
+
matrix?: TransformationMatrix;
|
|
81
|
+
clipSpaces?: Space[];
|
|
72
82
|
}) => PDFOperator[];
|
|
73
83
|
/** @deprecated */
|
|
74
84
|
export declare const drawEllipsePath: (config: {
|
|
@@ -90,6 +100,8 @@ export declare const drawEllipse: (options: {
|
|
|
90
100
|
borderDashPhase?: number | PDFNumber;
|
|
91
101
|
graphicsState?: string | PDFName;
|
|
92
102
|
borderLineCap?: LineCapStyle;
|
|
103
|
+
matrix?: TransformationMatrix;
|
|
104
|
+
clipSpaces?: Space[];
|
|
93
105
|
}) => PDFOperator[];
|
|
94
106
|
export declare const drawSvgPath: (path: string, options: {
|
|
95
107
|
x: number | PDFNumber;
|
|
@@ -104,6 +116,8 @@ export declare const drawSvgPath: (path: string, options: {
|
|
|
104
116
|
borderLineCap?: LineCapStyle;
|
|
105
117
|
graphicsState?: string | PDFName;
|
|
106
118
|
fillRule?: FillRule;
|
|
119
|
+
matrix?: TransformationMatrix;
|
|
120
|
+
clipSpaces?: Space[];
|
|
107
121
|
}) => PDFOperator[];
|
|
108
122
|
export declare const drawCheckMark: (options: {
|
|
109
123
|
x: number | PDFNumber;
|
|
@@ -210,4 +224,5 @@ export declare const drawOptionList: (options: {
|
|
|
210
224
|
selectedColor: Color;
|
|
211
225
|
padding: number | PDFNumber;
|
|
212
226
|
}) => PDFOperator[];
|
|
227
|
+
export {};
|
|
213
228
|
//# sourceMappingURL=operations.d.ts.map
|
package/ts3.4/es/api/svg.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import { Degrees } from './rotations';
|
|
|
4
4
|
import PDFPage from './PDFPage';
|
|
5
5
|
import { PDFPageDrawSVGElementOptions } from './PDFPageOptions';
|
|
6
6
|
import { LineCapStyle, LineJoinStyle, FillRule } from './operators';
|
|
7
|
+
import { TransformationMatrix } from '../types/matrix';
|
|
8
|
+
import { Space } from '../types';
|
|
7
9
|
interface Position {
|
|
8
10
|
x: number;
|
|
9
11
|
y: number;
|
|
@@ -57,8 +59,12 @@ declare type SVGAttributes = {
|
|
|
57
59
|
dominantBaseline?: string;
|
|
58
60
|
points?: string;
|
|
59
61
|
};
|
|
62
|
+
declare type TransformAttributes = {
|
|
63
|
+
matrix: TransformationMatrix;
|
|
64
|
+
clipSpaces: Space[];
|
|
65
|
+
};
|
|
60
66
|
export declare type SVGElement = HTMLElement & {
|
|
61
|
-
svgAttributes: InheritedAttributes & SVGAttributes;
|
|
67
|
+
svgAttributes: InheritedAttributes & SVGAttributes & TransformAttributes;
|
|
62
68
|
};
|
|
63
69
|
export declare const drawSvg: (page: PDFPage, svg: string, options: PDFPageDrawSVGElementOptions) => Promise<void>;
|
|
64
70
|
export {};
|
|
@@ -17,10 +17,10 @@ export declare type Coordinates = {
|
|
|
17
17
|
};
|
|
18
18
|
export declare type GraphicElement = Arc | Circle | Ellipse | Line | Plot | Point | Rectangle | Segment;
|
|
19
19
|
export declare type Space = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
topLeft: Coordinates;
|
|
21
|
+
topRight: Coordinates;
|
|
22
|
+
bottomRight: Coordinates;
|
|
23
|
+
bottomLeft: Coordinates;
|
|
24
24
|
};
|
|
25
25
|
export declare type LinkElement = Rectangle | Ellipse;
|
|
26
26
|
//# sourceMappingURL=index.d.ts.map
|