@qrcommunication/gigapdf-lib 0.45.0 → 0.47.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 +26 -0
- package/dist/index.cjs +15 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/gigapdf.wasm +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,32 @@ 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.47.0] - 2026-06-18
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **`'` and `"` (next-line-show) text operators are now extracted and
|
|
12
|
+
positioned correctly.** The content interpreter behind `textElements`,
|
|
13
|
+
`textRuns`, full-text search and the PDF→Office converters treated `Tj`/`TJ`
|
|
14
|
+
as the only text-showing operators, so runs drawn with `'` (move to next line
|
|
15
|
+
then show) or `"` (set spacing + next-line show) were **dropped entirely** and
|
|
16
|
+
the implicit line move they perform was **skipped** — shifting every
|
|
17
|
+
subsequent run in the same `BT…ET` block up by the accumulated leading.
|
|
18
|
+
Real-world impact: invoice/letter bodies (generated with leading-based line
|
|
19
|
+
breaks) lost lines and mis-placed the rest (e.g. a subtitle landing on the
|
|
20
|
+
title's baseline), breaking click-to-edit hit targets and conversion fidelity.
|
|
21
|
+
`'`/`"` now apply their implicit `T*` before showing and count as text runs,
|
|
22
|
+
so extraction, the run index used by `replaceText`/`removeElement`/`moveElement`,
|
|
23
|
+
and font resolution all stay consistent. Rendering (`renderPage`) was already
|
|
24
|
+
correct. No API change. `flattenFormXObjects(page)`
|
|
25
|
+
inlines every form XObject invoked via `Do` into the page content stream
|
|
26
|
+
(applying its `/Matrix`, merging its resources with collision-safe name
|
|
27
|
+
remapping, recursing into nested forms with a depth + cycle guard). Each
|
|
28
|
+
placement is de-shared, so the former form text becomes ordinary page runs with
|
|
29
|
+
real indices that `replaceText` / `moveElement` / `removeElement` can edit —
|
|
30
|
+
letting hosts edit invoice/template text in place rather than redact-and-redraw.
|
|
31
|
+
Distinct from `flattenForm` (AcroForm fields).
|
|
32
|
+
|
|
7
33
|
## [0.45.0] - 2026-06-18
|
|
8
34
|
|
|
9
35
|
### 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));
|