@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/CHANGELOG.md CHANGED
@@ -4,6 +4,47 @@ 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
+
20
+ ## [0.45.0] - 2026-06-18
21
+
22
+ ### Added
23
+
24
+ - **Rich Office → PDF conversion.** `officeToPdf` now maps DOCX/XLSX/PPTX/
25
+ ODT/ODS/ODP (and legacy OLE2 `.doc`/`.xls`/`.ppt`) to styled HTML — headings,
26
+ bold/italic/size/colour runs, tables, lists and embedded images — and renders
27
+ it through the native HTML→PDF engine instead of the old text-only flatten. No
28
+ LibreOffice/soffice dependency.
29
+ - **More OCR languages.** New host-loaded `.gpocr` line models beyond
30
+ Latin/Cyrillic/Greek: Arabic + Hebrew (RTL), Devanagari, Bengali and Tamil,
31
+ plus a larger 24/48/96 backbone retrain (clean-print CER now well past
32
+ Tesseract) and a handwriting-augmented `alpha` variant. Auto-discovered by
33
+ `loadAllBundledOcrModels`; the wasm still ships no weights.
34
+
35
+ ### Fixed
36
+
37
+ - **Text extraction recurses into form XObjects.** Text drawn via reusable form
38
+ XObjects (the `Do` operator — common in invoice/template PDFs) was rasterised
39
+ but never extracted, so it showed in the page image yet could not be selected
40
+ or edited. The extractor now walks `Do` into `/Subtype /Form` XObjects
41
+ (composing the form `/Matrix` with the CTM, with depth and cycle guards), so
42
+ form text is recovered in page space.
43
+ - **Font-less HTML render no longer drops text.** The HTML renderer skipped
44
+ every text run when no embedded font matched, so a render with no
45
+ host-provided fonts produced a blank page; a base-14 standard-font fallback
46
+ now always paints text.
47
+
7
48
  ## [0.44.0] - 2026-06-18
8
49
 
9
50
  ### 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));