@pdfme/pdf-lib 1.18.1 → 1.18.4
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/README.md +11 -2
- 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 +1 -0
- package/cjs/api/PDFPage.d.ts.map +1 -1
- package/cjs/api/PDFPage.js +30 -17
- package/cjs/api/PDFPage.js.map +1 -1
- package/cjs/api/PDFPageOptions.d.ts +15 -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 +16 -0
- package/cjs/api/operations.d.ts.map +1 -1
- package/cjs/api/operations.js +53 -5
- 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 +1153 -2590
- 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 +1153 -2590
- 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 +1 -0
- package/es/api/PDFPage.d.ts.map +1 -1
- package/es/api/PDFPage.js +30 -18
- package/es/api/PDFPage.js.map +1 -1
- package/es/api/PDFPageOptions.d.ts +15 -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 +16 -0
- package/es/api/operations.d.ts.map +1 -1
- package/es/api/operations.js +54 -6
- 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 +15 -0
- package/src/api/PDFPageOptions.ts +15 -8
- package/src/api/operations.ts +82 -8
- package/src/api/svg.ts +305 -1086
- package/src/types/index.ts +6 -1
- package/ts3.4/cjs/api/PDFPage.d.ts +1 -0
- package/ts3.4/cjs/api/PDFPageOptions.d.ts +15 -8
- package/ts3.4/cjs/api/operations.d.ts +16 -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/PDFPage.d.ts +1 -0
- package/ts3.4/es/api/PDFPageOptions.d.ts +15 -8
- package/ts3.4/es/api/operations.d.ts +16 -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;
|
|
@@ -105,8 +110,9 @@ export interface PDFPageDrawRectangleOptions {
|
|
|
105
110
|
borderDashPhase?: number;
|
|
106
111
|
borderLineCap?: LineCapStyle;
|
|
107
112
|
blendMode?: BlendMode;
|
|
113
|
+
radius?: number;
|
|
108
114
|
}
|
|
109
|
-
export interface PDFPageDrawSquareOptions {
|
|
115
|
+
export interface PDFPageDrawSquareOptions extends SvgOptions {
|
|
110
116
|
x?: number;
|
|
111
117
|
y?: number;
|
|
112
118
|
size?: number;
|
|
@@ -123,7 +129,7 @@ export interface PDFPageDrawSquareOptions {
|
|
|
123
129
|
borderLineCap?: LineCapStyle;
|
|
124
130
|
blendMode?: BlendMode;
|
|
125
131
|
}
|
|
126
|
-
export interface PDFPageDrawEllipseOptions {
|
|
132
|
+
export interface PDFPageDrawEllipseOptions extends SvgOptions {
|
|
127
133
|
x?: number;
|
|
128
134
|
y?: number;
|
|
129
135
|
xScale?: number;
|
|
@@ -139,7 +145,7 @@ export interface PDFPageDrawEllipseOptions {
|
|
|
139
145
|
borderLineCap?: LineCapStyle;
|
|
140
146
|
blendMode?: BlendMode;
|
|
141
147
|
}
|
|
142
|
-
export interface PDFPageDrawCircleOptions {
|
|
148
|
+
export interface PDFPageDrawCircleOptions extends SvgOptions {
|
|
143
149
|
x?: number;
|
|
144
150
|
y?: number;
|
|
145
151
|
size?: number;
|
|
@@ -163,4 +169,5 @@ export interface PDFPageDrawSVGElementOptions {
|
|
|
163
169
|
[fontName: string]: PDFFont;
|
|
164
170
|
};
|
|
165
171
|
}
|
|
172
|
+
export {};
|
|
166
173
|
//# 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,9 @@ 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[];
|
|
82
|
+
radius?: number | PDFNumber;
|
|
72
83
|
}) => PDFOperator[];
|
|
73
84
|
/** @deprecated */
|
|
74
85
|
export declare const drawEllipsePath: (config: {
|
|
@@ -90,6 +101,8 @@ export declare const drawEllipse: (options: {
|
|
|
90
101
|
borderDashPhase?: number | PDFNumber;
|
|
91
102
|
graphicsState?: string | PDFName;
|
|
92
103
|
borderLineCap?: LineCapStyle;
|
|
104
|
+
matrix?: TransformationMatrix;
|
|
105
|
+
clipSpaces?: Space[];
|
|
93
106
|
}) => PDFOperator[];
|
|
94
107
|
export declare const drawSvgPath: (path: string, options: {
|
|
95
108
|
x: number | PDFNumber;
|
|
@@ -104,6 +117,8 @@ export declare const drawSvgPath: (path: string, options: {
|
|
|
104
117
|
borderLineCap?: LineCapStyle;
|
|
105
118
|
graphicsState?: string | PDFName;
|
|
106
119
|
fillRule?: FillRule;
|
|
120
|
+
matrix?: TransformationMatrix;
|
|
121
|
+
clipSpaces?: Space[];
|
|
107
122
|
}) => PDFOperator[];
|
|
108
123
|
export declare const drawCheckMark: (options: {
|
|
109
124
|
x: number | PDFNumber;
|
|
@@ -210,4 +225,5 @@ export declare const drawOptionList: (options: {
|
|
|
210
225
|
selectedColor: Color;
|
|
211
226
|
padding: number | PDFNumber;
|
|
212
227
|
}) => PDFOperator[];
|
|
228
|
+
export {};
|
|
213
229
|
//# 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;
|
|
@@ -105,8 +110,9 @@ export interface PDFPageDrawRectangleOptions {
|
|
|
105
110
|
borderDashPhase?: number;
|
|
106
111
|
borderLineCap?: LineCapStyle;
|
|
107
112
|
blendMode?: BlendMode;
|
|
113
|
+
radius?: number;
|
|
108
114
|
}
|
|
109
|
-
export interface PDFPageDrawSquareOptions {
|
|
115
|
+
export interface PDFPageDrawSquareOptions extends SvgOptions {
|
|
110
116
|
x?: number;
|
|
111
117
|
y?: number;
|
|
112
118
|
size?: number;
|
|
@@ -123,7 +129,7 @@ export interface PDFPageDrawSquareOptions {
|
|
|
123
129
|
borderLineCap?: LineCapStyle;
|
|
124
130
|
blendMode?: BlendMode;
|
|
125
131
|
}
|
|
126
|
-
export interface PDFPageDrawEllipseOptions {
|
|
132
|
+
export interface PDFPageDrawEllipseOptions extends SvgOptions {
|
|
127
133
|
x?: number;
|
|
128
134
|
y?: number;
|
|
129
135
|
xScale?: number;
|
|
@@ -139,7 +145,7 @@ export interface PDFPageDrawEllipseOptions {
|
|
|
139
145
|
borderLineCap?: LineCapStyle;
|
|
140
146
|
blendMode?: BlendMode;
|
|
141
147
|
}
|
|
142
|
-
export interface PDFPageDrawCircleOptions {
|
|
148
|
+
export interface PDFPageDrawCircleOptions extends SvgOptions {
|
|
143
149
|
x?: number;
|
|
144
150
|
y?: number;
|
|
145
151
|
size?: number;
|
|
@@ -163,4 +169,5 @@ export interface PDFPageDrawSVGElementOptions {
|
|
|
163
169
|
[fontName: string]: PDFFont;
|
|
164
170
|
};
|
|
165
171
|
}
|
|
172
|
+
export {};
|
|
166
173
|
//# 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,9 @@ 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[];
|
|
82
|
+
radius?: number | PDFNumber;
|
|
72
83
|
}) => PDFOperator[];
|
|
73
84
|
/** @deprecated */
|
|
74
85
|
export declare const drawEllipsePath: (config: {
|
|
@@ -90,6 +101,8 @@ export declare const drawEllipse: (options: {
|
|
|
90
101
|
borderDashPhase?: number | PDFNumber;
|
|
91
102
|
graphicsState?: string | PDFName;
|
|
92
103
|
borderLineCap?: LineCapStyle;
|
|
104
|
+
matrix?: TransformationMatrix;
|
|
105
|
+
clipSpaces?: Space[];
|
|
93
106
|
}) => PDFOperator[];
|
|
94
107
|
export declare const drawSvgPath: (path: string, options: {
|
|
95
108
|
x: number | PDFNumber;
|
|
@@ -104,6 +117,8 @@ export declare const drawSvgPath: (path: string, options: {
|
|
|
104
117
|
borderLineCap?: LineCapStyle;
|
|
105
118
|
graphicsState?: string | PDFName;
|
|
106
119
|
fillRule?: FillRule;
|
|
120
|
+
matrix?: TransformationMatrix;
|
|
121
|
+
clipSpaces?: Space[];
|
|
107
122
|
}) => PDFOperator[];
|
|
108
123
|
export declare const drawCheckMark: (options: {
|
|
109
124
|
x: number | PDFNumber;
|
|
@@ -210,4 +225,5 @@ export declare const drawOptionList: (options: {
|
|
|
210
225
|
selectedColor: Color;
|
|
211
226
|
padding: number | PDFNumber;
|
|
212
227
|
}) => PDFOperator[];
|
|
228
|
+
export {};
|
|
213
229
|
//# 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
|