@qrcommunication/gigapdf-lib 0.45.0 → 0.46.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 CHANGED
@@ -4,6 +4,19 @@ 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.46.0] - 2026-06-18
8
+
9
+ ### Added
10
+
11
+ - **Flatten form XObjects for in-place editing.** `flattenFormXObjects(page)`
12
+ inlines every form XObject invoked via `Do` into the page content stream
13
+ (applying its `/Matrix`, merging its resources with collision-safe name
14
+ remapping, recursing into nested forms with a depth + cycle guard). Each
15
+ placement is de-shared, so the former form text becomes ordinary page runs with
16
+ real indices that `replaceText` / `moveElement` / `removeElement` can edit —
17
+ letting hosts edit invoice/template text in place rather than redact-and-redraw.
18
+ Distinct from `flattenForm` (AcroForm fields).
19
+
7
20
  ## [0.45.0] - 2026-06-18
8
21
 
9
22
  ### Added
package/dist/index.cjs CHANGED
@@ -1404,6 +1404,21 @@ var GigaPdfDoc = class {
1404
1404
  flattenForm() {
1405
1405
  return this.ex().gp_flatten_form(this.h);
1406
1406
  }
1407
+ /**
1408
+ * Inline a page's form XObjects (`/Subtype /Form` invoked via `Do`) into its
1409
+ * content stream, **de-sharing** each placement so the former form text/graphics
1410
+ * become ordinary page content with real, editable text-run indices (no form
1411
+ * sentinel) — the enabler for editing invoice/template text in place via
1412
+ * {@link replaceText} / {@link moveElement} / {@link removeElement} instead of
1413
+ * the redact+add overlay. Image XObjects are left untouched. Returns the number
1414
+ * of form XObjects inlined (every `Do` invocation, since each is de-shared).
1415
+ *
1416
+ * Distinct from {@link flattenForm}, which flattens **AcroForm** interactive
1417
+ * fields (and drops `/AcroForm`); this flattens reusable Form XObjects.
1418
+ */
1419
+ flattenFormXObjects(page) {
1420
+ return this.ex().gp_flatten_form_xobjects(this.h, page);
1421
+ }
1407
1422
  // hyperlinks
1408
1423
  links(page) {
1409
1424
  return this.g._json((o) => this.ex().gp_links_json(this.h, page, o));