You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,23 @@
1
1
# Changelog
2
2
3
+
## [2.5.0] — 2026-04-03
4
+
5
+
### Added
6
+
7
+
-**`pdfChrome`** on `PdfCreateOptions`: structured **layout** (format, orientation, size, border), **header** (`html` or escaped `title`), **footer** (`html` or `copyright` + optional page numbers via `showPageNumbers`). Merged into html-pdf options; explicit `format` / `header` / `footer` on the same object override.
8
+
- Exported **`buildPdfChrome()`** for building partial html-pdf options from `PdfChromeOptions`.
### Layout, header, footer, and copyright (`pdfChrome`)
67
+
68
+
Use **`pdfChrome`** on the second argument for common paper layout and repeating header/footer without hand-writing `html-pdf` structures. Plain `title` / `copyright` strings are HTML-escaped.
69
+
70
+
-**`layout`:**`format`, `orientation`, `width`, `height`, `border` (same meaning as [html-pdf](https://www.npmjs.com/package/html-pdf) / Phantom paper size).
71
+
-**`header`:**`html` (raw HTML per page) **or**`title` (centered text). Default height `45mm` when content is set.
72
+
-**`footer`:**`html`**or** combine **`copyright`** with optional **`showPageNumbers`** (`{{page}}` / `{{pages}}`). With `copyright` only, page numbers default **on** unless you set `showPageNumbers: false`. For **page numbers only**, set `showPageNumbers: true` and omit `copyright`. Default footer height `28mm` when content is set.
73
+
74
+
Anything you set directly on the options object (`format`, `header`, `footer`, …) **overrides** the matching field from `pdfChrome`.
Advanced: `buildPdfChrome(pdfChrome)` returns partial html-pdf options if you want to compose manually (also exported from the package).
87
+
66
88
### Optional Handlebars helpers
67
89
68
90
Pass `handlebarsHelpers` on the **second** argument (alongside `html-pdf` options). Helpers apply only to that render (isolated Handlebars instance). Built-in `ifCond` is always registered.
0 commit comments