takumi-pdf 0.4.0 → 0.4.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/README.md +3 -0
- package/dist/export.d.cts +5 -1
- package/dist/export.d.mts +5 -1
- package/package.json +1 -1
- package/pkg/takumi_pdf_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -188,6 +188,8 @@ Omit `metadata` to keep output byte-identical across runs.
|
|
|
188
188
|
|
|
189
189
|
Output is **tagged by default**: HTML semantics (`h1`–`h6`, `p`, `img` with `alt`, `a`, lists) become a PDF structure tree, like Chromium's print-to-PDF. Set `tagged: "ua1"` to validate against PDF/UA-1, or `tagged: false` to drop the tree when file size matters more than accessibility.
|
|
190
190
|
|
|
191
|
+
`<table>` markup is not supported, and a table built out of flex rows carries no `Table` structure elements.
|
|
192
|
+
|
|
191
193
|
`pdfa` renders archival output. Validation runs during rendering. A document that cannot conform fails with the violated rule instead of writing a broken file. Every level, and PDF/UA-1, passes [veraPDF](https://verapdf.org).
|
|
192
194
|
|
|
193
195
|
```tsx
|
|
@@ -205,6 +207,7 @@ const pdf = await render(report, {
|
|
|
205
207
|
| `"2a"` / `"3a"` | A tagged structure tree. |
|
|
206
208
|
| `"3b"` / `"3u"` / `"3a"` | Arbitrary file attachments. |
|
|
207
209
|
| `"4"` | The PDF 2.0 revision of the standard. |
|
|
210
|
+
| `"4f"` | PDF 2.0 with file attachments. |
|
|
208
211
|
|
|
209
212
|
Invalid combinations are **TypeScript type errors**. See the [PDF/A docs](https://takumi.kane.tw/docs/pdf/pdf-a) for the structure-tree mapping and required metadata.
|
|
210
213
|
|
package/dist/export.d.cts
CHANGED
|
@@ -213,7 +213,7 @@ type ArchivalAttachment = Attachment & {
|
|
|
213
213
|
* Standards conformance. Invalid combinations are type errors: the `a` levels
|
|
214
214
|
* imply a structure tree so `tagged: false` is rejected, PDF/A-4 is PDF 2.0
|
|
215
215
|
* while PDF/UA-1 is PDF 1.7-only so they cannot combine, and only the
|
|
216
|
-
* PDF/A-3 levels (or plain PDF) accept attachments.
|
|
216
|
+
* PDF/A-3 levels, PDF/A-4f (or plain PDF) accept attachments.
|
|
217
217
|
*/
|
|
218
218
|
type ConformanceOptions = {
|
|
219
219
|
pdfa?: never;
|
|
@@ -242,6 +242,10 @@ type ConformanceOptions = {
|
|
|
242
242
|
pdfa: "4";
|
|
243
243
|
tagged?: boolean;
|
|
244
244
|
attachments?: never;
|
|
245
|
+
} | {
|
|
246
|
+
pdfa: "4f";
|
|
247
|
+
tagged?: boolean;
|
|
248
|
+
attachments?: ArchivalAttachment[];
|
|
245
249
|
};
|
|
246
250
|
type RenderOptions = (PagedOptions | ViewportOptions) & ConformanceOptions & {
|
|
247
251
|
/** Fonts to register before rendering, deduped across calls. */
|
package/dist/export.d.mts
CHANGED
|
@@ -213,7 +213,7 @@ type ArchivalAttachment = Attachment & {
|
|
|
213
213
|
* Standards conformance. Invalid combinations are type errors: the `a` levels
|
|
214
214
|
* imply a structure tree so `tagged: false` is rejected, PDF/A-4 is PDF 2.0
|
|
215
215
|
* while PDF/UA-1 is PDF 1.7-only so they cannot combine, and only the
|
|
216
|
-
* PDF/A-3 levels (or plain PDF) accept attachments.
|
|
216
|
+
* PDF/A-3 levels, PDF/A-4f (or plain PDF) accept attachments.
|
|
217
217
|
*/
|
|
218
218
|
type ConformanceOptions = {
|
|
219
219
|
pdfa?: never;
|
|
@@ -242,6 +242,10 @@ type ConformanceOptions = {
|
|
|
242
242
|
pdfa: "4";
|
|
243
243
|
tagged?: boolean;
|
|
244
244
|
attachments?: never;
|
|
245
|
+
} | {
|
|
246
|
+
pdfa: "4f";
|
|
247
|
+
tagged?: boolean;
|
|
248
|
+
attachments?: ArchivalAttachment[];
|
|
245
249
|
};
|
|
246
250
|
type RenderOptions = (PagedOptions | ViewportOptions) & ConformanceOptions & {
|
|
247
251
|
/** Fonts to register before rendering, deduped across calls. */
|
package/package.json
CHANGED
|
Binary file
|