@lpdfio/lpdf 0.1.0 → 0.4.0

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- # LPDF License
1
+ # Lpdf License
2
2
 
3
3
  Copyright © 2026 Codesense LLC
4
4
  License inquiries: license@lpdf.io
@@ -7,15 +7,15 @@ License inquiries: license@lpdf.io
7
7
 
8
8
  ## Choosing Your License
9
9
 
10
- LPDF is available under three license tiers: a free Community License for individuals and qualifying organizations, a Professional License for mid-size commercial use, and an Enterprise License for larger organizations. All license tiers receive the complete feature set — no capabilities are gated behind paid plans.
10
+ Lpdf is available under three license tiers: a free Community License for individuals and qualifying organizations, a Professional License for mid-size commercial use, and an Enterprise License for larger organizations. All license tiers receive the complete feature set — no capabilities are gated behind paid plans.
11
11
 
12
12
  ### Equal Features Across All Tiers
13
13
 
14
- Every user of LPDF, regardless of license tier, has access to the same library, the same layout engine, the same adapters, and the same output quality. Licensing determines the terms of use, not the features available.
14
+ Every user of Lpdf, regardless of license tier, has access to the same library, the same layout engine, the same adapters, and the same output quality. Licensing determines the terms of use, not the features available.
15
15
 
16
16
  ### Transitive Dependency
17
17
 
18
- If LPDF is pulled in as an indirect dependency of another library or framework rather than used directly in your project, the Community License applies automatically, regardless of your organization's revenue.
18
+ If Lpdf is pulled in as an indirect dependency of another library or framework rather than used directly in your project, the Community License applies automatically, regardless of your organization's revenue.
19
19
 
20
20
  This exemption does not apply if the dependency was introduced, created, or controlled by the licensee's organization for the purpose of circumventing license requirements.
21
21
 
@@ -35,7 +35,7 @@ Organizations whose revenue crosses the 1,000,000 USD threshold have a **90-day
35
35
 
36
36
  ### Mid-Size Businesses
37
37
 
38
- Companies and organizations whose total annual gross revenue exceeded **1,000,000 USD** but did not exceed **10,000,000 USD** in the most recent 12-month fiscal year must obtain a Professional License to use LPDF in production environments.
38
+ Companies and organizations whose total annual gross revenue exceeded **1,000,000 USD** but did not exceed **10,000,000 USD** in the most recent 12-month fiscal year must obtain a Professional License to use Lpdf in production environments.
39
39
 
40
40
  "Production environment" means any environment in which the Software processes real user data or supports live business operations, including staging environments accessible by end users.
41
41
 
@@ -43,17 +43,17 @@ Organizations whose revenue crosses the 1,000,000 USD threshold have a **90-day
43
43
 
44
44
  ### Larger Businesses
45
45
 
46
- Companies and organizations whose total annual gross revenue exceeded **10,000,000 USD** in the most recent 12-month fiscal year must obtain an Enterprise License to use LPDF in production environments.
46
+ Companies and organizations whose total annual gross revenue exceeded **10,000,000 USD** in the most recent 12-month fiscal year must obtain an Enterprise License to use Lpdf in production environments.
47
47
 
48
48
  Organizations whose revenue crosses the 10,000,000 USD threshold have a **90-day grace period** following the close of their fiscal year to obtain an Enterprise license. During this grace period, continued use under a Professional License is permitted.
49
49
 
50
- ### Supporting LPDF
50
+ ### Supporting Lpdf
51
51
 
52
- Paid licenses directly fund the continued development, maintenance, and improvement of LPDF. If your organization has grown beyond the Community threshold, purchasing a license is the most direct way to ensure LPDF continues to exist and improve.
52
+ Paid licenses directly fund the continued development, maintenance, and improvement of Lpdf. If your organization has grown beyond the Community threshold, purchasing a license is the most direct way to ensure Lpdf continues to exist and improve.
53
53
 
54
54
  ---
55
55
 
56
- ## LPDF Community License
56
+ ## Lpdf Community License
57
57
 
58
58
  *Applies to: individuals, open-source projects, non-profit organizations, and companies with annual gross revenue under 1,000,000 USD.*
59
59
 
@@ -61,9 +61,9 @@ Permission is hereby granted, free of charge, to any person or qualifying organi
61
61
 
62
62
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
63
63
 
64
- All modifications to the Software made by the licensee remain the intellectual property of the licensee. Codesense LLC claims no ownership over modifications unless they are voluntarily submitted as contributions to the LPDF project under a separate Contributor License Agreement.
64
+ All modifications to the Software made by the licensee remain the intellectual property of the licensee. Codesense LLC claims no ownership over modifications unless they are voluntarily submitted as contributions to the Lpdf project under a separate Contributor License Agreement.
65
65
 
66
- If your organization's annual gross revenue exceeds 1,000,000 USD, your rights under this Community License are automatically terminated upon expiration of the 90-day grace period described above, and you must obtain a Professional or Enterprise license before continuing to use LPDF in production.
66
+ If your organization's annual gross revenue exceeds 1,000,000 USD, your rights under this Community License are automatically terminated upon expiration of the 90-day grace period described above, and you must obtain a Professional or Enterprise license before continuing to use Lpdf in production.
67
67
 
68
68
  ### Disclaimer of Warranty
69
69
 
@@ -71,13 +71,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
71
71
 
72
72
  ---
73
73
 
74
- ## LPDF Professional License
74
+ ## Lpdf Professional License
75
75
 
76
76
  *Applies to: companies and organizations with annual gross revenue exceeding 1,000,000 USD and not exceeding 10,000,000 USD.*
77
77
 
78
78
  ### Conduct
79
79
 
80
- Licensees agree not to make false statements of fact about LPDF, Codesense LLC, or its contributors that are intended to cause material harm to the reputation of the project or the company. This clause does not restrict good-faith criticism, bug reports, public discussion of software deficiencies, or reviews based on the licensee's genuine experience.
80
+ Licensees agree not to make false statements of fact about Lpdf, Codesense LLC, or its contributors that are intended to cause material harm to the reputation of the project or the company. This clause does not restrict good-faith criticism, bug reports, public discussion of software deficiencies, or reviews based on the licensee's genuine experience.
81
81
 
82
82
  License rights may not be rented, leased, or transferred to any third party.
83
83
 
@@ -91,9 +91,9 @@ Subject to payment of the applicable license fee, Codesense LLC grants the licen
91
91
 
92
92
  ### License Fees and Evaluation
93
93
 
94
- A license fee is required for use of LPDF in production environments (as defined above). Evaluation and testing in non-production environments is permitted without a license for a period not exceeding 30 days.
94
+ A license fee is required for use of Lpdf in production environments (as defined above). Evaluation and testing in non-production environments is permitted without a license for a period not exceeding 30 days.
95
95
 
96
- Upon payment, the licensee receives a perpetual license for the version of LPDF current at the time of purchase, plus one year of updates, new features, and security patches. Continued access to new versions after the first year requires annual renewal. Cancellation of renewal does not affect the perpetual license for the version already held.
96
+ Upon payment, the licensee receives a perpetual license for the version of Lpdf current at the time of purchase, plus one year of updates, new features, and security patches. Continued access to new versions after the first year requires annual renewal. Cancellation of renewal does not affect the perpetual license for the version already held.
97
97
 
98
98
  ### Support
99
99
 
@@ -103,7 +103,7 @@ Professional License holders receive email support from Codesense LLC.
103
103
 
104
104
  Codesense LLC retains all ownership, copyright, and intellectual property rights in the Software at all times. This license grants rights to use the Software; it does not transfer ownership of any kind.
105
105
 
106
- All modifications to the Software made by the licensee remain the intellectual property of the licensee. Codesense LLC claims no ownership over licensee modifications unless they are voluntarily submitted as contributions to the LPDF project under a separate Contributor License Agreement.
106
+ All modifications to the Software made by the licensee remain the intellectual property of the licensee. Codesense LLC claims no ownership over licensee modifications unless they are voluntarily submitted as contributions to the Lpdf project under a separate Contributor License Agreement.
107
107
 
108
108
  ### Copyright
109
109
 
@@ -111,7 +111,7 @@ All copies, modifications, and distributions of the Software must retain the ori
111
111
 
112
112
  ### Data and Privacy
113
113
 
114
- Codesense LLC does not collect, process, or retain any data that the licensee processes through the Software. All data processed by LPDF remains solely within the licensee's infrastructure. For more information, see the Codesense LLC Privacy Policy at lpdf.io/privacy.
114
+ Codesense LLC does not collect, process, or retain any data that the licensee processes through the Software. All data processed by Lpdf remains solely within the licensee's infrastructure. For more information, see the Codesense LLC Privacy Policy at lpdf.io/privacy.
115
115
 
116
116
  ### Export Compliance
117
117
 
@@ -131,13 +131,13 @@ Notwithstanding the foregoing, either party may seek injunctive or other equitab
131
131
 
132
132
  ---
133
133
 
134
- ## LPDF Enterprise License
134
+ ## Lpdf Enterprise License
135
135
 
136
136
  *Applies to: companies and organizations with annual gross revenue exceeding 10,000,000 USD.*
137
137
 
138
138
  ### Conduct
139
139
 
140
- Licensees agree not to make false statements of fact about LPDF, Codesense LLC, or its contributors that are intended to cause material harm to the reputation of the project or the company. This clause does not restrict good-faith criticism, bug reports, public discussion of software deficiencies, or reviews based on the licensee's genuine experience.
140
+ Licensees agree not to make false statements of fact about Lpdf, Codesense LLC, or its contributors that are intended to cause material harm to the reputation of the project or the company. This clause does not restrict good-faith criticism, bug reports, public discussion of software deficiencies, or reviews based on the licensee's genuine experience.
141
141
 
142
142
  License rights may not be rented, leased, or transferred to any third party.
143
143
 
@@ -152,9 +152,9 @@ Subject to payment of the applicable license fee, Codesense LLC grants the licen
152
152
 
153
153
  ### License Fees and Evaluation
154
154
 
155
- A license fee is required for use of LPDF in production environments (as defined above). Evaluation and testing in non-production environments is permitted without a license for a period not exceeding 30 days.
155
+ A license fee is required for use of Lpdf in production environments (as defined above). Evaluation and testing in non-production environments is permitted without a license for a period not exceeding 30 days.
156
156
 
157
- Upon payment, the licensee receives a perpetual license for the version of LPDF current at the time of purchase, plus one year of updates, new features, and security patches. Continued access to new versions after the first year requires annual renewal. Cancellation of renewal does not affect the perpetual license for the version already held.
157
+ Upon payment, the licensee receives a perpetual license for the version of Lpdf current at the time of purchase, plus one year of updates, new features, and security patches. Continued access to new versions after the first year requires annual renewal. Cancellation of renewal does not affect the perpetual license for the version already held.
158
158
 
159
159
  ### Support
160
160
 
@@ -168,7 +168,7 @@ Enterprise licensees may request a Master Service Agreement (MSA) in place of th
168
168
 
169
169
  Codesense LLC retains all ownership, copyright, and intellectual property rights in the Software at all times. This license grants rights to use the Software; it does not transfer ownership of any kind.
170
170
 
171
- All modifications to the Software made by the licensee remain the intellectual property of the licensee. Codesense LLC claims no ownership over licensee modifications unless they are voluntarily submitted as contributions to the LPDF project under a separate Contributor License Agreement.
171
+ All modifications to the Software made by the licensee remain the intellectual property of the licensee. Codesense LLC claims no ownership over licensee modifications unless they are voluntarily submitted as contributions to the Lpdf project under a separate Contributor License Agreement.
172
172
 
173
173
  ### Copyright
174
174
 
@@ -176,7 +176,7 @@ All copies, modifications, and distributions of the Software must retain the ori
176
176
 
177
177
  ### Data and Privacy
178
178
 
179
- Codesense LLC does not collect, process, or retain any data that the licensee processes through the Software. All data processed by LPDF remains solely within the licensee's infrastructure. For more information, see the Codesense LLC Privacy Policy at lpdf.io/privacy.
179
+ Codesense LLC does not collect, process, or retain any data that the licensee processes through the Software. All data processed by Lpdf remains solely within the licensee's infrastructure. For more information, see the Codesense LLC Privacy Policy at lpdf.io/privacy.
180
180
 
181
181
  ### Export Compliance
182
182
 
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
+ <p align="center"><img src="lpdf-logo.svg" height="48" alt="Lpdf"></p>
2
+
1
3
  # @lpdfio/lpdf
2
4
 
3
- Node.js adapter for [lpdf](https://lpdf.io) — an accurate, efficient, and cross-platform PDF engine.
5
+ Node.js adapter for [Lpdf](https://lpdf.io) — an accurate, efficient, and cross-platform PDF engine.
4
6
 
5
7
  ## Installation
6
8
 
@@ -32,7 +34,7 @@ import { LpdfEngine } from '@lpdfio/lpdf/browser';
32
34
 
33
35
  const engine = new LpdfEngine('');
34
36
 
35
- const xml = `<stack><text>Hello, lpdf</text></stack>`;
37
+ const xml = `<stack><text>Hello, Lpdf</text></stack>`;
36
38
  const pdf = await engine.renderPdf(xml);
37
39
 
38
40
  const blob = new Blob([pdf], { type: 'application/pdf' });
@@ -41,7 +43,7 @@ window.open(URL.createObjectURL(blob));
41
43
 
42
44
  ## XML format
43
45
 
44
- Documents are defined in a layout XML format. See the [lpdf documentation](https://lpdf.io/docs) and [examples](https://github.com/lpdfio/lpdf/tree/main/docs/examples) for the full schema.
46
+ Documents are defined in a layout XML format. See the [Lpdf documentation](https://lpdf.io/docs) and [examples](https://github.com/lpdfio/lpdf/tree/main/docs/examples) for the full schema.
45
47
 
46
48
  ```xml
47
49
  <stack spacing="m" padding="l">
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lpdfio/lpdf",
3
- "version": "0.1.0",
3
+ "version": "0.4.0",
4
4
  "description": "Node.js adapter for lpdf — pixel-perfect, lightweight, and consistent PDF rendering",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,95 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
-
4
- export class LpdfEngine {
5
- free(): void;
6
- [Symbol.dispose](): void;
7
- /**
8
- * Remove any previously configured encryption.
9
- */
10
- clear_encryption(): void;
11
- /**
12
- * Register raw font bytes (TTF/OTF) for a custom font name.
13
- * Call this once per font before calling `render_pdf`.
14
- * Glyph advance-width metrics are extracted automatically from the font
15
- * bytes so the layout engine can measure text accurately — no separate
16
- * `set_font_metrics` call is required.
17
- */
18
- load_font(name: string, bytes: Uint8Array): void;
19
- /**
20
- * Register raw image bytes (JPEG or PNG) for an image name.
21
- * Call this for every image referenced by `<img name="…">` nodes.
22
- */
23
- load_image(name: string, bytes: Uint8Array): void;
24
- constructor(license_key: string);
25
- render(xml: string): string;
26
- /**
27
- * Render `xml` to binary PDF bytes.
28
- *
29
- * Any custom fonts referenced in `<font src="…">` declarations must have
30
- * their bytes registered via `load_font` before calling this method.
31
- *
32
- * `json_data` is an optional JSON string used to resolve `data-*`
33
- * attributes in the template. Pass `None` (or `null` / `undefined` from
34
- * JavaScript) to render the template with its inline fallback content.
35
- */
36
- render_pdf(xml: string, json_data?: string | null): Uint8Array;
37
- render_tree(json: string): string;
38
- /**
39
- * Render a JSON kit-tree or canvas-tree document to PDF bytes.
40
- *
41
- * This is the JSON counterpart of `render_pdf`. The Node adapter uses it
42
- * when an `LpdfDocument` Kit tree is passed to `renderPdf()`, avoiding an
43
- * intermediate XML serialisation step. PHP, Python, and .NET adapters also
44
- * use this entry point.
45
- */
46
- render_tree_pdf(json: string): Uint8Array;
47
- /**
48
- * Set an optional ISO 8601 creation timestamp (e.g. `"2024-06-01T12:00:00"`).
49
- * When provided, written as `/CreationDate` in the PDF info dictionary.
50
- * Omitting this keeps builds reproducible (no embedded timestamp).
51
- */
52
- set_created_on(iso: string): void;
53
- /**
54
- * Configure RC4-128 encryption applied to every subsequent `render_pdf` call.
55
- *
56
- * `permissions_json` is a JSON object with boolean fields matching the
57
- * `Permissions` struct (`print`, `modify`, `copy`, `annotate`, `fill_forms`,
58
- * `accessibility`, `assemble`, `print_hq`). Omitted fields default to `true`.
59
- *
60
- * To apply permissions without an open password, pass an empty `user_password`
61
- * and a non-empty `owner_password`.
62
- */
63
- set_encryption(user_password: string, owner_password: string, permissions_json: string): void;
64
- /**
65
- * Inject glyph advance-width tables for custom fonts.
66
- *
67
- * Call this *before* `render_pdf` / `render` when the document uses custom
68
- * fonts (declared via `<font src="…"`). The adapter extracts these widths
69
- * from the font binary and passes them as a JSON object:
70
- *
71
- * ```json
72
- * { "fontName": { "default": 500, "ascii": [260, 285, …] } }
73
- * ```
74
- *
75
- * `ascii` is a 95-element array for code points 32–126. `default` is used
76
- * for code points outside that range. All values are in 1/1000 em units.
77
- */
78
- set_font_metrics(json: string): void;
79
- /**
80
- * Set the current Unix timestamp (seconds) for license expiry checking.
81
- * Must be called before `render_pdf` when using a time-limited token.
82
- * If not set (default `0`), expiry is not checked.
83
- */
84
- set_now(unix: bigint): void;
85
- }
86
-
87
- /**
88
- * Convert a JSON kit-tree (produced by `LpdfKit` in any adapter) to an lpdf
89
- * XML string.
90
- *
91
- * Useful for debugging Kit-generated documents, saving them as `.xml` files,
92
- * or feeding them into the XML render path. The output is equivalent to
93
- * hand-authored XML and passes through `render_pdf` without modification.
94
- */
95
- export function kit_to_xml(json: string): string;