pretext-pdf 0.2.0 → 0.3.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 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 8 remaining)
10
+ ### Planned (Phase 9+)
11
11
 
12
- - Phase 8B: Forms (text fields, checkboxes, radio buttons, dropdowns)
13
- - Phase 8D: Advanced layout (image floats, callout boxes)
14
- - Phase 8E: Digital signatures (visual + cryptographic signing)
15
- - Phase 8F: Font subsetting improvements (reduce file size)
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