@polotno/pdf-export 0.1.20 → 0.1.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.
- package/package.json +7 -4
- package/patches/pdfkit+0.17.2.patch +19 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polotno/pdf-export",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Convert Polotno JSON into vector PDF",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"author": "Anton Lavrenov",
|
|
23
23
|
"files": [
|
|
24
24
|
"lib",
|
|
25
|
-
"README.md"
|
|
25
|
+
"README.md",
|
|
26
|
+
"patches"
|
|
26
27
|
],
|
|
27
28
|
"dependencies": {
|
|
28
29
|
"canvas": "^3.2.0",
|
|
@@ -37,14 +38,16 @@
|
|
|
37
38
|
"sharp": "^0.34.4",
|
|
38
39
|
"string-strip-html": "^13.5.0",
|
|
39
40
|
"svg-to-pdfkit": "^0.1.8",
|
|
40
|
-
"xmldom": "^0.6.0"
|
|
41
|
+
"xmldom": "^0.6.0",
|
|
42
|
+
"patch-package": "^8.0.1"
|
|
41
43
|
},
|
|
42
44
|
"devDependencies": {
|
|
45
|
+
"@types/react": "18.3.12",
|
|
46
|
+
"@types/react-dom": "18.3.2",
|
|
43
47
|
"@types/node": "^24.10.0",
|
|
44
48
|
"@types/parse-color": "^1.0.3",
|
|
45
49
|
"@types/pdfkit": "^0.17.3",
|
|
46
50
|
"jest-image-snapshot": "^6.5.1",
|
|
47
|
-
"patch-package": "^8.0.1",
|
|
48
51
|
"pdf-img-convert": "^2.0.0",
|
|
49
52
|
"pdf-to-png-converter": "^3.10.0",
|
|
50
53
|
"pixelmatch": "^7.1.0",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
diff --git a/node_modules/pdfkit/js/pdfkit.js b/node_modules/pdfkit/js/pdfkit.js
|
|
2
|
+
index bba8028..66fd060 100644
|
|
3
|
+
--- a/node_modules/pdfkit/js/pdfkit.js
|
|
4
|
+
+++ b/node_modules/pdfkit/js/pdfkit.js
|
|
5
|
+
@@ -3423,7 +3423,13 @@ var TextMixin = {
|
|
6
|
+
}
|
|
7
|
+
const lineWidth = this._fontSize < 10 ? 0.5 : Math.floor(this._fontSize / 10);
|
|
8
|
+
this.lineWidth(lineWidth);
|
|
9
|
+
- let lineY = y + this.currentLineHeight() - lineWidth;
|
|
10
|
+
+ let lineY;
|
|
11
|
+
+ if (options.baseline === 'alphabetic') {
|
|
12
|
+
+ lineY = y + this.currentLineHeight() - lineWidth;
|
|
13
|
+
+ lineY -= (this._font.ascender / 1000) * this._fontSize
|
|
14
|
+
+ } else {
|
|
15
|
+
+ lineY = y + this.currentLineHeight() - lineWidth;
|
|
16
|
+
+ }
|
|
17
|
+
this.moveTo(x, lineY);
|
|
18
|
+
this.lineTo(x + renderedWidth, lineY);
|
|
19
|
+
this.stroke();
|