@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/dist/index.d.cts CHANGED
@@ -1063,6 +1063,20 @@ declare class GigaPdfDoc {
1063
1063
  removeHeaders(): boolean;
1064
1064
  /** Remove every previously-baked running footer from all pages. */
1065
1065
  removeFooters(): boolean;
1066
+ /**
1067
+ * Detect the running header/footer already baked into this PDF — the reader
1068
+ * counterpart of {@link GigaPdfDoc.setHeader} / {@link GigaPdfDoc.setFooter}.
1069
+ * Each side is a {@link HeaderFooterSpec} (with its recovered `text`) when a
1070
+ * baked `/GPHF` span is present, or `null` when absent. The `text` is faithful
1071
+ * (the per-page-substituted text of the first matching page); `align`,
1072
+ * `fontSize`, `color`, etc. are best-effort defaults, since the bake records
1073
+ * only the drawn text. Use it to reflect existing document state (e.g. a
1074
+ * Word-like editor toggle).
1075
+ */
1076
+ headerFooter(): {
1077
+ header: HeaderFooterSpec | null;
1078
+ footer: HeaderFooterSpec | null;
1079
+ };
1066
1080
  renderPage(page: number, scale?: number): Uint8Array;
1067
1081
  /**
1068
1082
  * Embed an outline font program as a Type0 font and return its object number
package/dist/index.d.ts CHANGED
@@ -1063,6 +1063,20 @@ declare class GigaPdfDoc {
1063
1063
  removeHeaders(): boolean;
1064
1064
  /** Remove every previously-baked running footer from all pages. */
1065
1065
  removeFooters(): boolean;
1066
+ /**
1067
+ * Detect the running header/footer already baked into this PDF — the reader
1068
+ * counterpart of {@link GigaPdfDoc.setHeader} / {@link GigaPdfDoc.setFooter}.
1069
+ * Each side is a {@link HeaderFooterSpec} (with its recovered `text`) when a
1070
+ * baked `/GPHF` span is present, or `null` when absent. The `text` is faithful
1071
+ * (the per-page-substituted text of the first matching page); `align`,
1072
+ * `fontSize`, `color`, etc. are best-effort defaults, since the bake records
1073
+ * only the drawn text. Use it to reflect existing document state (e.g. a
1074
+ * Word-like editor toggle).
1075
+ */
1076
+ headerFooter(): {
1077
+ header: HeaderFooterSpec | null;
1078
+ footer: HeaderFooterSpec | null;
1079
+ };
1066
1080
  renderPage(page: number, scale?: number): Uint8Array;
1067
1081
  /**
1068
1082
  * Embed an outline font program as a Type0 font and return its object number
package/dist/index.js CHANGED
@@ -1149,6 +1149,21 @@ var GigaPdfDoc = class {
1149
1149
  removeFooters() {
1150
1150
  return this.ex().gp_remove_footers(this.h) === 0;
1151
1151
  }
1152
+ /**
1153
+ * Detect the running header/footer already baked into this PDF — the reader
1154
+ * counterpart of {@link GigaPdfDoc.setHeader} / {@link GigaPdfDoc.setFooter}.
1155
+ * Each side is a {@link HeaderFooterSpec} (with its recovered `text`) when a
1156
+ * baked `/GPHF` span is present, or `null` when absent. The `text` is faithful
1157
+ * (the per-page-substituted text of the first matching page); `align`,
1158
+ * `fontSize`, `color`, etc. are best-effort defaults, since the bake records
1159
+ * only the drawn text. Use it to reflect existing document state (e.g. a
1160
+ * Word-like editor toggle).
1161
+ */
1162
+ headerFooter() {
1163
+ return this.g._json(
1164
+ (o) => this.ex().gp_header_footer(this.h, o)
1165
+ );
1166
+ }
1152
1167
  // render
1153
1168
  renderPage(page, scale = 1) {
1154
1169
  return this.g._buffer((o) => this.ex().gp_render_page(this.h, page, scale, o));