pretext-pdf 0.4.5 → 0.5.1
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/CHANGELOG.md +333 -333
- package/README.md +76 -7
- package/dist/assets.d.ts +3 -0
- package/dist/assets.d.ts.map +1 -1
- package/dist/assets.js +111 -21
- package/dist/assets.js.map +1 -1
- package/dist/builder.d.ts +22 -1
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +38 -1
- package/dist/builder.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/fonts.d.ts.map +1 -1
- package/dist/fonts.js +36 -1
- package/dist/fonts.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +76 -34
- package/dist/index.js.map +1 -1
- package/dist/measure-blocks.d.ts +25 -0
- package/dist/measure-blocks.d.ts.map +1 -0
- package/dist/measure-blocks.js +1019 -0
- package/dist/measure-blocks.js.map +1 -0
- package/dist/measure-text.d.ts +53 -0
- package/dist/measure-text.d.ts.map +1 -0
- package/dist/measure-text.js +435 -0
- package/dist/measure-text.js.map +1 -0
- package/dist/measure.d.ts +15 -35
- package/dist/measure.d.ts.map +1 -1
- package/dist/measure.js +42 -1066
- package/dist/measure.js.map +1 -1
- package/dist/paginate.d.ts.map +1 -1
- package/dist/paginate.js +14 -12
- package/dist/paginate.js.map +1 -1
- package/dist/render-blocks.d.ts +24 -0
- package/dist/render-blocks.d.ts.map +1 -0
- package/dist/render-blocks.js +937 -0
- package/dist/render-blocks.js.map +1 -0
- package/dist/render-extras.d.ts +18 -0
- package/dist/render-extras.d.ts.map +1 -0
- package/dist/render-extras.js +325 -0
- package/dist/render-extras.js.map +1 -0
- package/dist/render-utils.d.ts +59 -0
- package/dist/render-utils.d.ts.map +1 -0
- package/dist/render-utils.js +219 -0
- package/dist/render-utils.js.map +1 -0
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +19 -1375
- package/dist/render.js.map +1 -1
- package/dist/rich-text.d.ts +4 -0
- package/dist/rich-text.d.ts.map +1 -1
- package/dist/rich-text.js +4 -0
- package/dist/rich-text.js.map +1 -1
- package/dist/types.d.ts +108 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +195 -15
- package/dist/validate.js.map +1 -1
- package/docs/screenshots/showcase-invoice.png +0 -0
- package/docs/screenshots/showcase-report.png +0 -0
- package/docs/screenshots/showcase-resume.png +0 -0
- package/package.json +130 -128
package/package.json
CHANGED
|
@@ -1,128 +1,130 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "pretext-pdf",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Declarative JSON → PDF generation with professional typography. Built on pretext's precision text layout engine.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"pdf",
|
|
7
|
-
"pdf-generation",
|
|
8
|
-
"pretext",
|
|
9
|
-
"typography",
|
|
10
|
-
"invoice",
|
|
11
|
-
"report",
|
|
12
|
-
"document",
|
|
13
|
-
"typescript",
|
|
14
|
-
"nodejs",
|
|
15
|
-
"type-safe",
|
|
16
|
-
"forms",
|
|
17
|
-
"rtl",
|
|
18
|
-
"hyphenation"
|
|
19
|
-
],
|
|
20
|
-
"author": "Himanshu Jain <himanshu@antigravity.dev>",
|
|
21
|
-
"license": "MIT",
|
|
22
|
-
"homepage": "https://github.com/Himaan1998Y/pretext-pdf#readme",
|
|
23
|
-
"bugs": {
|
|
24
|
-
"url": "https://github.com/Himaan1998Y/pretext-pdf/issues"
|
|
25
|
-
},
|
|
26
|
-
"repository": {
|
|
27
|
-
"type": "git",
|
|
28
|
-
"url": "https://github.com/Himaan1998Y/pretext-pdf.git"
|
|
29
|
-
},
|
|
30
|
-
"engines": {
|
|
31
|
-
"node": ">=18.0.0"
|
|
32
|
-
},
|
|
33
|
-
"sideEffects": false,
|
|
34
|
-
"type": "module",
|
|
35
|
-
"main": "./dist/index.js",
|
|
36
|
-
"types": "./dist/index.d.ts",
|
|
37
|
-
"files": [
|
|
38
|
-
"dist/",
|
|
39
|
-
"fonts/",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
"test:
|
|
54
|
-
"test:
|
|
55
|
-
"test:
|
|
56
|
-
"test:phase-
|
|
57
|
-
"test:phase-
|
|
58
|
-
"test:
|
|
59
|
-
"test:
|
|
60
|
-
"test:phase-
|
|
61
|
-
"test:
|
|
62
|
-
"test:
|
|
63
|
-
"test:
|
|
64
|
-
"test:
|
|
65
|
-
"test:
|
|
66
|
-
"test": "
|
|
67
|
-
"test
|
|
68
|
-
"test:
|
|
69
|
-
"test:visual
|
|
70
|
-
"
|
|
71
|
-
"example
|
|
72
|
-
"example:
|
|
73
|
-
"example:
|
|
74
|
-
"example:
|
|
75
|
-
"example:
|
|
76
|
-
"example:
|
|
77
|
-
"example:
|
|
78
|
-
"example:
|
|
79
|
-
"example:
|
|
80
|
-
"example:
|
|
81
|
-
"example:
|
|
82
|
-
"example:
|
|
83
|
-
"example:
|
|
84
|
-
"example:
|
|
85
|
-
"example:showcase-
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"@
|
|
93
|
-
"@
|
|
94
|
-
"@
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"@
|
|
116
|
-
"@types/
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
"
|
|
127
|
-
|
|
128
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "pretext-pdf",
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "Declarative JSON → PDF generation with professional typography. Built on pretext's precision text layout engine.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pdf",
|
|
7
|
+
"pdf-generation",
|
|
8
|
+
"pretext",
|
|
9
|
+
"typography",
|
|
10
|
+
"invoice",
|
|
11
|
+
"report",
|
|
12
|
+
"document",
|
|
13
|
+
"typescript",
|
|
14
|
+
"nodejs",
|
|
15
|
+
"type-safe",
|
|
16
|
+
"forms",
|
|
17
|
+
"rtl",
|
|
18
|
+
"hyphenation"
|
|
19
|
+
],
|
|
20
|
+
"author": "Himanshu Jain <himanshu@antigravity.dev>",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"homepage": "https://github.com/Himaan1998Y/pretext-pdf#readme",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/Himaan1998Y/pretext-pdf/issues"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/Himaan1998Y/pretext-pdf.git"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18.0.0"
|
|
32
|
+
},
|
|
33
|
+
"sideEffects": false,
|
|
34
|
+
"type": "module",
|
|
35
|
+
"main": "./dist/index.js",
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"files": [
|
|
38
|
+
"dist/",
|
|
39
|
+
"fonts/",
|
|
40
|
+
"docs/screenshots/",
|
|
41
|
+
"README.md",
|
|
42
|
+
"LICENSE",
|
|
43
|
+
"CHANGELOG.md"
|
|
44
|
+
],
|
|
45
|
+
"exports": {
|
|
46
|
+
".": {
|
|
47
|
+
"import": "./dist/index.js",
|
|
48
|
+
"types": "./dist/index.d.ts"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsc",
|
|
53
|
+
"test:unit": "cross-env NODE_OPTIONS=--max-old-space-size=4096 tsx --test test/validate.test.ts test/builder.test.ts test/rich-text.test.ts",
|
|
54
|
+
"test:validate": "cross-env NODE_OPTIONS=--max-old-space-size=4096 tsx --test test/validate.test.ts test/builder.test.ts",
|
|
55
|
+
"test:e2e": "tsx --test test/e2e.test.ts",
|
|
56
|
+
"test:phase-3": "tsx --test test/phase-3-signatures.test.ts",
|
|
57
|
+
"test:phase-4": "tsx --test test/phase-4-footnotes.test.ts",
|
|
58
|
+
"test:phase-5": "tsx --test test/phase-5-image-float.test.ts",
|
|
59
|
+
"test:phases": "tsx --test test/phase-4-footnotes.test.ts test/phase-5-image-float.test.ts test/phase-7a.test.ts test/phase-7b.test.ts test/phase-7c.test.ts test/phase-7d-toc.test.ts test/phase-7e-svg.test.ts test/phase-7f-rtl.test.ts test/phase-7g.test.ts test/phase-7-integration.test.ts test/phase-8g-hyperlinks.test.ts test/phase-8h-inline-formatting.test.ts test/phase-8a-annotations.test.ts test/phase-8c-assembly.test.ts test/phase-8f-metadata.test.ts test/phase-8e-signatures.test.ts test/phase-8b-forms.test.ts test/phase-8d-callout.test.ts test/phase-9a-crypto-signatures.test.ts test/phase-9b-float-groups.test.ts test/phase-9c-font-subsetting.test.ts test/phase-2-performance.test.ts test/phase-3-signatures.test.ts",
|
|
60
|
+
"test:phase-7": "tsx --test test/phase-7a.test.ts test/phase-7b.test.ts test/phase-7c.test.ts test/phase-7d-toc.test.ts test/phase-7e-svg.test.ts test/phase-7f-rtl.test.ts test/phase-7g.test.ts test/phase-7-integration.test.ts",
|
|
61
|
+
"test:phase-8": "tsx --test test/phase-8g-hyperlinks.test.ts test/phase-8h-inline-formatting.test.ts test/phase-8a-annotations.test.ts test/phase-8c-assembly.test.ts test/phase-8b-forms.test.ts test/phase-8d-callout.test.ts test/phase-8e-signatures.test.ts test/phase-8f-metadata.test.ts",
|
|
62
|
+
"test:8d": "tsx --test test/phase-8d-callout.test.ts",
|
|
63
|
+
"test:8f": "tsx --test test/phase-8f-metadata.test.ts",
|
|
64
|
+
"test:8e": "tsx --test test/phase-8e-signatures.test.ts",
|
|
65
|
+
"test:8b": "tsx --test test/phase-8b-forms.test.ts",
|
|
66
|
+
"test:contract": "tsx --test test/pretext-api-contract.test.ts",
|
|
67
|
+
"test": "npm run test:contract && npm run test:unit && npm run test:e2e && npm run test:phases",
|
|
68
|
+
"test:rich": "tsx --test test/rich-text.test.ts",
|
|
69
|
+
"test:visual": "tsx --test test/visual/visual.test.ts",
|
|
70
|
+
"test:visual:update": "cross-env UPDATE_BASELINES=1 tsx test/visual/visual.test.ts",
|
|
71
|
+
"example": "tsx examples/invoice.ts",
|
|
72
|
+
"example:watermark": "tsx examples/phase7-watermark.ts",
|
|
73
|
+
"example:bookmarks": "tsx examples/phase7-bookmarks.ts",
|
|
74
|
+
"example:toc": "tsx examples/phase7-toc.ts",
|
|
75
|
+
"example:rtl": "tsx examples/phase7-rtl.ts",
|
|
76
|
+
"example:encryption": "tsx examples/phase7-encryption.ts",
|
|
77
|
+
"example:hyperlinks": "tsx examples/phase8-hyperlinks.ts",
|
|
78
|
+
"example:annotations": "tsx examples/phase8-annotations.ts",
|
|
79
|
+
"example:assembly": "tsx examples/phase8-assembly.ts",
|
|
80
|
+
"example:inline": "tsx examples/phase8-inline.ts",
|
|
81
|
+
"example:forms": "tsx examples/phase8-forms.ts",
|
|
82
|
+
"example:callout": "tsx examples/phase8-callout.ts",
|
|
83
|
+
"example:gst": "tsx examples/gst-invoice-india.ts",
|
|
84
|
+
"example:floats": "tsx examples/phase9b-float-groups.ts",
|
|
85
|
+
"example:showcase-invoice": "tsx examples/showcase-invoice.ts",
|
|
86
|
+
"example:showcase-report": "tsx examples/showcase-report.ts",
|
|
87
|
+
"example:showcase-resume": "tsx examples/showcase-resume.ts",
|
|
88
|
+
"screenshots": "npm run example:showcase-invoice && npm run example:showcase-report && npm run example:showcase-resume && node scripts/screenshot.cjs",
|
|
89
|
+
"typecheck": "tsc --noEmit"
|
|
90
|
+
},
|
|
91
|
+
"dependencies": {
|
|
92
|
+
"@cantoo/pdf-lib": "^2.6.5",
|
|
93
|
+
"@chenglou/pretext": "0.0.3",
|
|
94
|
+
"@fontsource-variable/inter": "^5.2.8",
|
|
95
|
+
"@fontsource/inter": "^5.0.0",
|
|
96
|
+
"@pdf-lib/fontkit": "^1.1.1",
|
|
97
|
+
"bidi-js": "^1.0.3",
|
|
98
|
+
"hyphenation.en-us": "^0.2.1",
|
|
99
|
+
"hypher": "^0.2.5",
|
|
100
|
+
"subset-font": "^2.5.0"
|
|
101
|
+
},
|
|
102
|
+
"peerDependencies": {
|
|
103
|
+
"@napi-rs/canvas": "^0.1.57",
|
|
104
|
+
"@signpdf/signpdf": "^3.3.0"
|
|
105
|
+
},
|
|
106
|
+
"peerDependenciesMeta": {
|
|
107
|
+
"@napi-rs/canvas": {
|
|
108
|
+
"optional": true
|
|
109
|
+
},
|
|
110
|
+
"@signpdf/signpdf": {
|
|
111
|
+
"optional": true
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"devDependencies": {
|
|
115
|
+
"@signpdf/signpdf": "^3.3.0",
|
|
116
|
+
"@types/node": "^22.0.0",
|
|
117
|
+
"@types/pixelmatch": "^5.2.6",
|
|
118
|
+
"@types/pngjs": "^6.0.5",
|
|
119
|
+
"cross-env": "^10.1.0",
|
|
120
|
+
"pdfjs-dist": "^5.6.205",
|
|
121
|
+
"ts-node": "^10.9.2",
|
|
122
|
+
"tsx": "^4.7.0",
|
|
123
|
+
"typescript": "^5.5.0"
|
|
124
|
+
},
|
|
125
|
+
"optionalDependencies": {
|
|
126
|
+
"@napi-rs/canvas": "^0.1.57",
|
|
127
|
+
"pixelmatch": "^7.1.0",
|
|
128
|
+
"pngjs": "^7.0.0"
|
|
129
|
+
}
|
|
130
|
+
}
|