@qrcommunication/gigapdf-lib 0.123.1 → 0.124.1

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
@@ -6,6 +6,29 @@ project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.124.1] - 2026-12-06
10
+
11
+ ### Added
12
+
13
+ - `ImageElementInfo.alt` exposes the current alternative text. `setImageAlt`
14
+ resolves page + unified image index to the correct global figure before
15
+ `toTagged({ pdfUa: true })` writes the accessible output.
16
+
17
+ ## [0.124.0] - 2026-12-06
18
+
19
+ ### Added
20
+
21
+ - Expanded legacy DOC/XLS/PPT structure, image, master-content and chart import.
22
+ - Image alt text survives Office, RTF and tagged PDF round-trips; multi-sheet CSV
23
+ exports reimport sheet names, row boundaries and typed date/time values.
24
+
25
+ ### Fixed
26
+
27
+ - Preserve chart previews, TrueType text in WMF/EMF, explicit line breaks,
28
+ faux-bold, mixed-content pagination and linear page-content updates.
29
+ - Prefer ordinary embedded-font mappings over private-use `/ToUnicode` entries
30
+ when both identify the same glyph.
31
+
9
32
  ## [0.123.1] - 2026-12-03
10
33
 
11
34
  ### Security
package/README.md CHANGED
@@ -130,6 +130,23 @@ const pdf = giga.imageToPdf(imageBytes); // PNG/JPEG/GIF/WebP/AVIF → one A4 pa
130
130
  // (image centred, shrink-to-fit, never upscaled; empty array if not an image)
131
131
  ```
132
132
 
133
+ ### Edit an image's alternative text
134
+
135
+ ```ts
136
+ const doc = giga.open(pdfBytes);
137
+ const image = doc.imageElements(1)[0];
138
+ if (image) {
139
+ // Address the real image by page + unified element index (not a figure-local
140
+ // counter). The current structure alt is exposed as `image.alt`.
141
+ doc.setImageAlt(1, image.index, "Sales growth by region");
142
+ }
143
+ const accessible = doc.toTagged({ pdfUa: true }); // /Figure + /Alt + PDF/UA-1 XMP
144
+ doc.close();
145
+ ```
146
+
147
+ Use `setFigureAlt` only when you intentionally address the document-global figure
148
+ index. `setImageAlt` resolves the editor's unified image index for you.
149
+
133
150
  ### Split — extract a page range into a new PDF
134
151
 
135
152
  ```ts
package/dist/index.cjs CHANGED
@@ -2643,6 +2643,13 @@ var GigaPdfDoc = class {
2643
2643
  setFigureAlt(index, alt) {
2644
2644
  return this.g._withStr(alt, (p, l) => this.ex().gp_set_figure_alt(this.h, index, p, l)) === 0;
2645
2645
  }
2646
+ /** Set alternative text on an image by page and unified element index. */
2647
+ setImageAlt(page, index, alt) {
2648
+ return this.g._withStr(
2649
+ alt,
2650
+ (p, l) => this.ex().gp_set_image_alt(this.h, page, index, p, l)
2651
+ ) === 0;
2652
+ }
2646
2653
  // security
2647
2654
  /**
2648
2655
  * Serialize the document encrypted with the PDF Standard Security Handler.