@qrcommunication/gigapdf-lib 0.46.0 → 0.48.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,11 +4,54 @@ 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
7
+ ## [0.48.0] - 2026-06-18
8
8
 
9
- ### Added
9
+ ### Fixed
10
+
11
+ - **`Z_SYNC_FLUSH` deflate streams without a final block now decode.** Content
12
+ streams flushed with `Z_SYNC_FLUSH` end with an empty stored block
13
+ (`00 00 ff ff`, `BFINAL=0`) and no final block — common in signed PDFs (the
14
+ `q`/`Q`/overlay content pieces of Adobe FillSign) and any deflate produced via
15
+ a flush. The decoder looped past the flush expecting another block, hit
16
+ end-of-input and errored, so affected pages extracted **nothing**. It now
17
+ returns the bytes decoded so far when the input is exhausted at a block
18
+ boundary (matching pdfjs/Acrobat leniency); mid-block truncation still errors,
19
+ so genuinely corrupt data is not masked.
20
+
21
+ ### Changed
22
+
23
+ - **Office → PDF: real page geometry + font names.** Conversions no longer
24
+ hard-code US-Letter/0.5in. The page size and margins are read from the source
25
+ document (DOCX `w:sectPr/w:pgSz`+`w:pgMar`, PPTX `p:sldSz`, ODF
26
+ `style:page-layout-properties`) with sensible per-format fallbacks, and each
27
+ run's real `font-family` (DOCX `w:rFonts`, PPTX `a:latin`, ODF `fo:font-name`)
28
+ is emitted so the host font-resolution path embeds the correct faces with true
29
+ metrics instead of a 0.5-em estimate. DOCX paragraph alignment, spacing and
30
+ indentation (`w:jc`/`w:spacing`/`w:ind`) are carried through.
31
+ - **PDF → Office: vector shapes keep their geometry and colours.** The Office
32
+ exporters (DOCX/PPTX DrawingML, ODT/ODP ODF) now emit real shapes — rectangles
33
+ and `custGeom`/`draw:path` curves — sourced from `page_vector_paths`, with
34
+ fill/stroke RGB, opacity, stroke width and dash, instead of a single grey
35
+ bounding-box rectangle. Clip-only paths no longer leak stray rectangles.
36
+
37
+ ## [0.47.0] - 2026-06-18
38
+
39
+ ### Fixed
10
40
 
11
- - **Flatten form XObjects for in-place editing.** `flattenFormXObjects(page)`
41
+ - **`'` and `"` (next-line-show) text operators are now extracted and
42
+ positioned correctly.** The content interpreter behind `textElements`,
43
+ `textRuns`, full-text search and the PDF→Office converters treated `Tj`/`TJ`
44
+ as the only text-showing operators, so runs drawn with `'` (move to next line
45
+ then show) or `"` (set spacing + next-line show) were **dropped entirely** and
46
+ the implicit line move they perform was **skipped** — shifting every
47
+ subsequent run in the same `BT…ET` block up by the accumulated leading.
48
+ Real-world impact: invoice/letter bodies (generated with leading-based line
49
+ breaks) lost lines and mis-placed the rest (e.g. a subtitle landing on the
50
+ title's baseline), breaking click-to-edit hit targets and conversion fidelity.
51
+ `'`/`"` now apply their implicit `T*` before showing and count as text runs,
52
+ so extraction, the run index used by `replaceText`/`removeElement`/`moveElement`,
53
+ and font resolution all stay consistent. Rendering (`renderPage`) was already
54
+ correct. No API change. `flattenFormXObjects(page)`
12
55
  inlines every form XObject invoked via `Do` into the page content stream
13
56
  (applying its `/Matrix`, merging its resources with collision-safe name
14
57
  remapping, recursing into nested forms with a depth + cycle guard). Each
package/gigapdf.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrcommunication/gigapdf-lib",
3
- "version": "0.46.0",
3
+ "version": "0.48.0",
4
4
  "description": "TypeScript SDK for gigapdf-lib — a Rust→WASM document engine with no third-party PDF/Office/image library: read/edit/render, OCR, full-text search, AcroForm fields (read · fill · create), annotations, signing, encryption, PDF↔Office/HTML/RTF conversions, and a native HTML+CSS→PDF renderer with inline JavaScript (no headless browser). Cryptography uses audited RustCrypto; JavaScript uses the Boa engine; everything else is pure Rust. Single wasm-bindgen-free .wasm with one host import (entropy).",
5
5
  "license": "PolyForm-Noncommercial-1.0.0",
6
6
  "author": "Rony Licha / QR Communication",