pretext-pdf 0.2.0 → 0.3.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/CHANGELOG.md +42 -5
- package/README.md +220 -259
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/measure.d.ts.map +1 -1
- package/dist/measure.js +72 -0
- package/dist/measure.js.map +1 -1
- package/dist/paginate.d.ts.map +1 -1
- package/dist/paginate.js +8 -6
- package/dist/paginate.js.map +1 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +294 -0
- package/dist/render.js.map +1 -1
- package/dist/types.d.ts +139 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +86 -1
- package/dist/validate.js.map +1 -1
- package/package.json +91 -79
package/CHANGELOG.md
CHANGED
|
@@ -7,12 +7,49 @@ Format: [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/)
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
### Planned (Phase
|
|
10
|
+
### Planned (Phase 9+)
|
|
11
11
|
|
|
12
|
-
- Phase
|
|
13
|
-
- Phase
|
|
14
|
-
- Phase
|
|
15
|
-
|
|
12
|
+
- Phase 9A: Digital signatures (cryptographic PKCS#7 via `@signpdf/signpdf`)
|
|
13
|
+
- Phase 9B: Image floats (text flowing alongside images — requires paginator rewrite)
|
|
14
|
+
- Phase 9C: Font subsetting pre-computation (explicit glyph hints for icon fonts)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## [0.3.0] — 2026-04-08
|
|
19
|
+
|
|
20
|
+
### Added (Phase 8B — Interactive Forms)
|
|
21
|
+
- New `form-field` element type — creates interactive AcroForm fields in PDFs
|
|
22
|
+
- `fieldType: 'text' | 'checkbox' | 'radio' | 'dropdown' | 'button'`
|
|
23
|
+
- `label` renders above the field as static text
|
|
24
|
+
- Text fields: `defaultValue`, `multiline`, `placeholder`, `maxLength`
|
|
25
|
+
- Checkboxes: `checked` initial state
|
|
26
|
+
- Radio groups and dropdowns: `options` array, `defaultSelected`
|
|
27
|
+
- `doc.flattenForms: true` — bakes all fields into static content
|
|
28
|
+
- Custom `borderColor`, `backgroundColor`, `width`, `height`, `fontSize` per field
|
|
29
|
+
- New error codes: `FORM_FIELD_NAME_DUPLICATE` (duplicate `name` across fields), `FORM_FLATTEN_FAILED`
|
|
30
|
+
- Post-render `form.updateFieldAppearances()` ensures proper display in all PDF readers
|
|
31
|
+
- 10 comprehensive tests covering all form field types
|
|
32
|
+
|
|
33
|
+
### Added (Phase 8E — Signature Placeholder)
|
|
34
|
+
- `doc.signature` — visual signature box drawn on a specified page
|
|
35
|
+
- Fields: `signerName`, `reason`, `location`, `x`, `y`, `width`, `height`, `page`, `borderColor`, `fontSize`
|
|
36
|
+
- Draws signature line, date line, and optional text inside a bordered rectangle
|
|
37
|
+
- `page` is 0-indexed, defaults to last page, clamps gracefully if out of range
|
|
38
|
+
- 6 comprehensive tests
|
|
39
|
+
|
|
40
|
+
### Added (Phase 8D — Callout Boxes)
|
|
41
|
+
- New `callout` element type — styled highlight box with optional title
|
|
42
|
+
- Preset styles: `style: 'info'` (blue), `'warning'` (amber), `'tip'` (green), `'note'` (gray)
|
|
43
|
+
- Optional `title` rendered bold above content with left border accent
|
|
44
|
+
- Fully customizable: `backgroundColor`, `borderColor`, `color`, `titleColor`, `padding`
|
|
45
|
+
- Paginates correctly across pages (reuses blockquote pagination logic)
|
|
46
|
+
- 8 comprehensive tests
|
|
47
|
+
|
|
48
|
+
### Added (Phase 8F — Document Metadata Extensions)
|
|
49
|
+
- `doc.metadata.language` — sets PDF `/Lang` catalog entry (BCP47 tag e.g. `'en-US'`, `'hi'`)
|
|
50
|
+
- `doc.metadata.producer` — sets PDF producer field (e.g. `'MyApp v2.1'`)
|
|
51
|
+
- Both fields validate as non-empty strings
|
|
52
|
+
- 5 comprehensive tests
|
|
16
53
|
|
|
17
54
|
---
|
|
18
55
|
|