@qrcommunication/gigapdf-lib 0.44.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/dist/index.d.cts CHANGED
@@ -903,6 +903,19 @@ declare class GigaPdfDoc {
903
903
  * widgets baked (0 when there is no form).
904
904
  */
905
905
  flattenForm(): number;
906
+ /**
907
+ * Inline a page's form XObjects (`/Subtype /Form` invoked via `Do`) into its
908
+ * content stream, **de-sharing** each placement so the former form text/graphics
909
+ * become ordinary page content with real, editable text-run indices (no form
910
+ * sentinel) — the enabler for editing invoice/template text in place via
911
+ * {@link replaceText} / {@link moveElement} / {@link removeElement} instead of
912
+ * the redact+add overlay. Image XObjects are left untouched. Returns the number
913
+ * of form XObjects inlined (every `Do` invocation, since each is de-shared).
914
+ *
915
+ * Distinct from {@link flattenForm}, which flattens **AcroForm** interactive
916
+ * fields (and drops `/AcroForm`); this flattens reusable Form XObjects.
917
+ */
918
+ flattenFormXObjects(page: number): number;
906
919
  links(page: number): LinkInfo[];
907
920
  addUriLink(page: number, x0: number, y0: number, x1: number, y1: number, uri: string): boolean;
908
921
  addGotoLink(page: number, x0: number, y0: number, x1: number, y1: number, targetPage: number): boolean;
package/dist/index.d.ts CHANGED
@@ -903,6 +903,19 @@ declare class GigaPdfDoc {
903
903
  * widgets baked (0 when there is no form).
904
904
  */
905
905
  flattenForm(): number;
906
+ /**
907
+ * Inline a page's form XObjects (`/Subtype /Form` invoked via `Do`) into its
908
+ * content stream, **de-sharing** each placement so the former form text/graphics
909
+ * become ordinary page content with real, editable text-run indices (no form
910
+ * sentinel) — the enabler for editing invoice/template text in place via
911
+ * {@link replaceText} / {@link moveElement} / {@link removeElement} instead of
912
+ * the redact+add overlay. Image XObjects are left untouched. Returns the number
913
+ * of form XObjects inlined (every `Do` invocation, since each is de-shared).
914
+ *
915
+ * Distinct from {@link flattenForm}, which flattens **AcroForm** interactive
916
+ * fields (and drops `/AcroForm`); this flattens reusable Form XObjects.
917
+ */
918
+ flattenFormXObjects(page: number): number;
906
919
  links(page: number): LinkInfo[];
907
920
  addUriLink(page: number, x0: number, y0: number, x1: number, y1: number, uri: string): boolean;
908
921
  addGotoLink(page: number, x0: number, y0: number, x1: number, y1: number, targetPage: number): boolean;
package/dist/index.js CHANGED
@@ -1372,6 +1372,21 @@ var GigaPdfDoc = class {
1372
1372
  flattenForm() {
1373
1373
  return this.ex().gp_flatten_form(this.h);
1374
1374
  }
1375
+ /**
1376
+ * Inline a page's form XObjects (`/Subtype /Form` invoked via `Do`) into its
1377
+ * content stream, **de-sharing** each placement so the former form text/graphics
1378
+ * become ordinary page content with real, editable text-run indices (no form
1379
+ * sentinel) — the enabler for editing invoice/template text in place via
1380
+ * {@link replaceText} / {@link moveElement} / {@link removeElement} instead of
1381
+ * the redact+add overlay. Image XObjects are left untouched. Returns the number
1382
+ * of form XObjects inlined (every `Do` invocation, since each is de-shared).
1383
+ *
1384
+ * Distinct from {@link flattenForm}, which flattens **AcroForm** interactive
1385
+ * fields (and drops `/AcroForm`); this flattens reusable Form XObjects.
1386
+ */
1387
+ flattenFormXObjects(page) {
1388
+ return this.ex().gp_flatten_form_xobjects(this.h, page);
1389
+ }
1375
1390
  // hyperlinks
1376
1391
  links(page) {
1377
1392
  return this.g._json((o) => this.ex().gp_links_json(this.h, page, o));