@qrcommunication/gigapdf-lib 0.52.1 → 0.52.2

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
@@ -4,6 +4,16 @@ All notable changes to `@qrcommunication/gigapdf-lib` are documented here.
4
4
  The format follows [Keep a Changelog](https://keepachangelog.com/) and the
5
5
  project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [0.52.2] - 2026-06-19
8
+
9
+ ### Added
10
+
11
+ - **Read baked running headers/footers.** `GigaPdfDoc.headerFooter()` returns
12
+ `{ header, footer }` recovered from the `/GPHF` marked-content spans that
13
+ `setHeader`/`setFooter` write, so a host can detect whether a PDF already
14
+ carries a running header/footer (and recover its text) and reflect that in its
15
+ UI — the read complement to the existing writer.
16
+
7
17
  ## [0.52.1] - 2026-06-18
8
18
 
9
19
  ### Fixed
package/dist/index.cjs CHANGED
@@ -1181,6 +1181,21 @@ var GigaPdfDoc = class {
1181
1181
  removeFooters() {
1182
1182
  return this.ex().gp_remove_footers(this.h) === 0;
1183
1183
  }
1184
+ /**
1185
+ * Detect the running header/footer already baked into this PDF — the reader
1186
+ * counterpart of {@link GigaPdfDoc.setHeader} / {@link GigaPdfDoc.setFooter}.
1187
+ * Each side is a {@link HeaderFooterSpec} (with its recovered `text`) when a
1188
+ * baked `/GPHF` span is present, or `null` when absent. The `text` is faithful
1189
+ * (the per-page-substituted text of the first matching page); `align`,
1190
+ * `fontSize`, `color`, etc. are best-effort defaults, since the bake records
1191
+ * only the drawn text. Use it to reflect existing document state (e.g. a
1192
+ * Word-like editor toggle).
1193
+ */
1194
+ headerFooter() {
1195
+ return this.g._json(
1196
+ (o) => this.ex().gp_header_footer(this.h, o)
1197
+ );
1198
+ }
1184
1199
  // render
1185
1200
  renderPage(page, scale = 1) {
1186
1201
  return this.g._buffer((o) => this.ex().gp_render_page(this.h, page, scale, o));