@evotecit/officeimo 0.0.0-stage → 0.1.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.
Files changed (259) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1219 -2
  3. package/bundles/officeimo-canopyx.js +11286 -0
  4. package/bundles/officeimo-canopyx.mjs +11185 -0
  5. package/bundles/officeimo-csv.js +1254 -0
  6. package/bundles/officeimo-csv.mjs +1229 -0
  7. package/bundles/officeimo-datatables.js +11572 -0
  8. package/bundles/officeimo-datatables.mjs +11470 -0
  9. package/bundles/officeimo-execution.js +1503 -0
  10. package/bundles/officeimo-execution.mjs +1479 -0
  11. package/bundles/officeimo-pdf.js +6564 -0
  12. package/bundles/officeimo-pdf.mjs +6502 -0
  13. package/bundles/officeimo-xlsx.js +5333 -0
  14. package/bundles/officeimo-xlsx.mjs +5279 -0
  15. package/bundles/officeimo.js +11022 -0
  16. package/bundles/officeimo.mjs +10924 -0
  17. package/dist/core/dates.d.ts +1 -0
  18. package/dist/core/dates.js +16 -0
  19. package/dist/core/errors.d.ts +12 -0
  20. package/dist/core/errors.js +31 -0
  21. package/dist/core/grouped-report.d.ts +87 -0
  22. package/dist/core/grouped-report.js +252 -0
  23. package/dist/core/index.d.ts +72 -0
  24. package/dist/core/index.js +37 -0
  25. package/dist/core/iteration.d.ts +7 -0
  26. package/dist/core/iteration.js +149 -0
  27. package/dist/core/limits.d.ts +7 -0
  28. package/dist/core/limits.js +56 -0
  29. package/dist/core/links.d.ts +5 -0
  30. package/dist/core/links.js +14 -0
  31. package/dist/core/presentation.d.ts +29 -0
  32. package/dist/core/presentation.js +59 -0
  33. package/dist/core/progress.d.ts +1 -0
  34. package/dist/core/progress.js +10 -0
  35. package/dist/core/sinks.d.ts +33 -0
  36. package/dist/core/sinks.js +101 -0
  37. package/dist/core/table.d.ts +8 -0
  38. package/dist/core/table.js +1 -0
  39. package/dist/core/value-text.d.ts +7 -0
  40. package/dist/core/value-text.js +13 -0
  41. package/dist/csv/index.d.ts +44 -0
  42. package/dist/csv/index.js +133 -0
  43. package/dist/csv/options.d.ts +1 -0
  44. package/dist/csv/options.js +8 -0
  45. package/dist/csv/structured-rows.d.ts +3 -0
  46. package/dist/csv/structured-rows.js +15 -0
  47. package/dist/execution/host.d.ts +5 -0
  48. package/dist/execution/host.js +164 -0
  49. package/dist/execution/index.d.ts +3 -0
  50. package/dist/execution/index.js +2 -0
  51. package/dist/execution/protocol.d.ts +48 -0
  52. package/dist/execution/protocol.js +173 -0
  53. package/dist/execution/types.d.ts +42 -0
  54. package/dist/execution/types.js +1 -0
  55. package/dist/execution/worker.d.ts +3 -0
  56. package/dist/execution/worker.js +147 -0
  57. package/dist/index.d.ts +32 -0
  58. package/dist/index.js +14 -0
  59. package/dist/integrations/canopyx/dates.d.ts +1 -0
  60. package/dist/integrations/canopyx/dates.js +34 -0
  61. package/dist/integrations/canopyx/index.d.ts +10 -0
  62. package/dist/integrations/canopyx/index.js +45 -0
  63. package/dist/integrations/canopyx/source.d.ts +3 -0
  64. package/dist/integrations/canopyx/source.js +116 -0
  65. package/dist/integrations/canopyx/types.d.ts +83 -0
  66. package/dist/integrations/canopyx/types.js +1 -0
  67. package/dist/integrations/datatables/api.d.ts +1 -0
  68. package/dist/integrations/datatables/api.js +27 -0
  69. package/dist/integrations/datatables/headings.d.ts +1 -0
  70. package/dist/integrations/datatables/headings.js +65 -0
  71. package/dist/integrations/datatables/index.d.ts +12 -0
  72. package/dist/integrations/datatables/index.js +167 -0
  73. package/dist/integrations/datatables/snapshot.d.ts +3 -0
  74. package/dist/integrations/datatables/snapshot.js +206 -0
  75. package/dist/integrations/datatables/types.d.ts +98 -0
  76. package/dist/integrations/datatables/types.js +1 -0
  77. package/dist/integrations/options.d.ts +13 -0
  78. package/dist/integrations/options.js +34 -0
  79. package/dist/internal/capture.d.ts +4 -0
  80. package/dist/internal/capture.js +14 -0
  81. package/dist/internal/columns.d.ts +27 -0
  82. package/dist/internal/columns.js +1 -0
  83. package/dist/internal/crc32.d.ts +6 -0
  84. package/dist/internal/crc32.js +17 -0
  85. package/dist/internal/export-values.d.ts +3 -0
  86. package/dist/internal/export-values.js +14 -0
  87. package/dist/internal/rows.d.ts +6 -0
  88. package/dist/internal/rows.js +68 -0
  89. package/dist/internal/table-spans.d.ts +11 -0
  90. package/dist/internal/table-spans.js +58 -0
  91. package/dist/internal/totals.d.ts +15 -0
  92. package/dist/internal/totals.js +42 -0
  93. package/dist/opc/index.d.ts +67 -0
  94. package/dist/opc/index.js +233 -0
  95. package/dist/opc/properties.d.ts +15 -0
  96. package/dist/opc/properties.js +18 -0
  97. package/dist/opc/uri.d.ts +5 -0
  98. package/dist/opc/uri.js +41 -0
  99. package/dist/pdf/annotations.d.ts +1 -0
  100. package/dist/pdf/annotations.js +38 -0
  101. package/dist/pdf/binary.d.ts +6 -0
  102. package/dist/pdf/binary.js +24 -0
  103. package/dist/pdf/document-drawings.d.ts +15 -0
  104. package/dist/pdf/document-drawings.js +237 -0
  105. package/dist/pdf/document-grouped.d.ts +1 -0
  106. package/dist/pdf/document-grouped.js +194 -0
  107. package/dist/pdf/document-images.d.ts +19 -0
  108. package/dist/pdf/document-images.js +125 -0
  109. package/dist/pdf/document-types.d.ts +160 -0
  110. package/dist/pdf/document-types.js +1 -0
  111. package/dist/pdf/document-vectors.d.ts +11 -0
  112. package/dist/pdf/document-vectors.js +77 -0
  113. package/dist/pdf/document.d.ts +9 -0
  114. package/dist/pdf/document.js +270 -0
  115. package/dist/pdf/drawing-types.d.ts +53 -0
  116. package/dist/pdf/drawing-types.js +1 -0
  117. package/dist/pdf/font-resources.d.ts +43 -0
  118. package/dist/pdf/font-resources.js +201 -0
  119. package/dist/pdf/font-support.d.ts +1 -0
  120. package/dist/pdf/font-support.js +60 -0
  121. package/dist/pdf/font.d.ts +17 -0
  122. package/dist/pdf/font.js +56 -0
  123. package/dist/pdf/grouped-table.d.ts +6 -0
  124. package/dist/pdf/grouped-table.js +40 -0
  125. package/dist/pdf/grouped-types.d.ts +34 -0
  126. package/dist/pdf/grouped-types.js +1 -0
  127. package/dist/pdf/grouped.d.ts +10 -0
  128. package/dist/pdf/grouped.js +37 -0
  129. package/dist/pdf/index.d.ts +22 -0
  130. package/dist/pdf/index.js +8 -0
  131. package/dist/pdf/inline-text.d.ts +30 -0
  132. package/dist/pdf/inline-text.js +142 -0
  133. package/dist/pdf/inline-types.d.ts +15 -0
  134. package/dist/pdf/inline-types.js +1 -0
  135. package/dist/pdf/list-layout.d.ts +6 -0
  136. package/dist/pdf/list-layout.js +49 -0
  137. package/dist/pdf/objects.d.ts +2 -0
  138. package/dist/pdf/objects.js +143 -0
  139. package/dist/pdf/outlines.d.ts +1 -0
  140. package/dist/pdf/outlines.js +55 -0
  141. package/dist/pdf/page-context.d.ts +1 -0
  142. package/dist/pdf/page-context.js +12 -0
  143. package/dist/pdf/pages.d.ts +1 -0
  144. package/dist/pdf/pages.js +679 -0
  145. package/dist/pdf/paragraph-layout.d.ts +19 -0
  146. package/dist/pdf/paragraph-layout.js +66 -0
  147. package/dist/pdf/paragraph-styles.d.ts +1 -0
  148. package/dist/pdf/paragraph-styles.js +66 -0
  149. package/dist/pdf/png.d.ts +9 -0
  150. package/dist/pdf/png.js +259 -0
  151. package/dist/pdf/preflight.d.ts +7 -0
  152. package/dist/pdf/preflight.js +32 -0
  153. package/dist/pdf/presentation-settings.d.ts +5 -0
  154. package/dist/pdf/presentation-settings.js +28 -0
  155. package/dist/pdf/providers/harfbuzz.d.ts +60 -0
  156. package/dist/pdf/providers/harfbuzz.js +112 -0
  157. package/dist/pdf/providers/unicode13-profile.d.ts +2 -0
  158. package/dist/pdf/providers/unicode13-profile.js +115 -0
  159. package/dist/pdf/section-types.d.ts +15 -0
  160. package/dist/pdf/section-types.js +40 -0
  161. package/dist/pdf/session.d.ts +25 -0
  162. package/dist/pdf/session.js +55 -0
  163. package/dist/pdf/settings.d.ts +15 -0
  164. package/dist/pdf/settings.js +171 -0
  165. package/dist/pdf/shaped-text.d.ts +5 -0
  166. package/dist/pdf/shaped-text.js +205 -0
  167. package/dist/pdf/standard-widths.d.ts +1 -0
  168. package/dist/pdf/standard-widths.js +317 -0
  169. package/dist/pdf/structure-parent-tree.d.ts +1 -0
  170. package/dist/pdf/structure-parent-tree.js +57 -0
  171. package/dist/pdf/structure.d.ts +6 -0
  172. package/dist/pdf/structure.js +250 -0
  173. package/dist/pdf/table-band-flow.d.ts +34 -0
  174. package/dist/pdf/table-band-flow.js +114 -0
  175. package/dist/pdf/table-band-plan.d.ts +10 -0
  176. package/dist/pdf/table-band-plan.js +85 -0
  177. package/dist/pdf/table-layout.d.ts +71 -0
  178. package/dist/pdf/table-layout.js +205 -0
  179. package/dist/pdf/table-structure.d.ts +1 -0
  180. package/dist/pdf/table-structure.js +92 -0
  181. package/dist/pdf/text-shaping-types.d.ts +39 -0
  182. package/dist/pdf/text-shaping-types.js +1 -0
  183. package/dist/pdf/text.d.ts +13 -0
  184. package/dist/pdf/text.js +96 -0
  185. package/dist/pdf/truetype-subset.d.ts +5 -0
  186. package/dist/pdf/truetype-subset.js +217 -0
  187. package/dist/pdf/truetype.d.ts +1 -0
  188. package/dist/pdf/truetype.js +235 -0
  189. package/dist/pdf/types.d.ts +169 -0
  190. package/dist/pdf/types.js +1 -0
  191. package/dist/pdf/write.d.ts +6 -0
  192. package/dist/pdf/write.js +57 -0
  193. package/dist/xlsx/attachments.d.ts +30 -0
  194. package/dist/xlsx/attachments.js +67 -0
  195. package/dist/xlsx/chart-bindings.d.ts +1 -0
  196. package/dist/xlsx/chart-bindings.js +122 -0
  197. package/dist/xlsx/chart-types.d.ts +73 -0
  198. package/dist/xlsx/chart-types.js +1 -0
  199. package/dist/xlsx/chart-xml.d.ts +2 -0
  200. package/dist/xlsx/chart-xml.js +103 -0
  201. package/dist/xlsx/charts.d.ts +1 -0
  202. package/dist/xlsx/charts.js +159 -0
  203. package/dist/xlsx/conditional-formatting.d.ts +1 -0
  204. package/dist/xlsx/conditional-formatting.js +158 -0
  205. package/dist/xlsx/conditional-types.d.ts +64 -0
  206. package/dist/xlsx/conditional-types.js +1 -0
  207. package/dist/xlsx/data-row-ranges.d.ts +5 -0
  208. package/dist/xlsx/data-row-ranges.js +39 -0
  209. package/dist/xlsx/differential-styles.d.ts +1 -0
  210. package/dist/xlsx/differential-styles.js +102 -0
  211. package/dist/xlsx/formula.d.ts +8 -0
  212. package/dist/xlsx/formula.js +104 -0
  213. package/dist/xlsx/grouped-layout.d.ts +61 -0
  214. package/dist/xlsx/grouped-layout.js +79 -0
  215. package/dist/xlsx/grouped.d.ts +16 -0
  216. package/dist/xlsx/grouped.js +161 -0
  217. package/dist/xlsx/index.d.ts +24 -0
  218. package/dist/xlsx/index.js +10 -0
  219. package/dist/xlsx/layout.d.ts +1 -0
  220. package/dist/xlsx/layout.js +186 -0
  221. package/dist/xlsx/options.d.ts +1 -0
  222. package/dist/xlsx/options.js +16 -0
  223. package/dist/xlsx/portable.d.ts +27 -0
  224. package/dist/xlsx/portable.js +44 -0
  225. package/dist/xlsx/preservation.d.ts +1 -0
  226. package/dist/xlsx/preservation.js +60 -0
  227. package/dist/xlsx/ranges.d.ts +1 -0
  228. package/dist/xlsx/ranges.js +24 -0
  229. package/dist/xlsx/regions.d.ts +1 -0
  230. package/dist/xlsx/regions.js +97 -0
  231. package/dist/xlsx/structured-rows.d.ts +11 -0
  232. package/dist/xlsx/structured-rows.js +28 -0
  233. package/dist/xlsx/style-xml.d.ts +1 -0
  234. package/dist/xlsx/style-xml.js +6 -0
  235. package/dist/xlsx/styles.d.ts +70 -0
  236. package/dist/xlsx/styles.js +203 -0
  237. package/dist/xlsx/table.d.ts +12 -0
  238. package/dist/xlsx/table.js +35 -0
  239. package/dist/xlsx/types.d.ts +180 -0
  240. package/dist/xlsx/types.js +1 -0
  241. package/dist/xlsx/validation-types.d.ts +18 -0
  242. package/dist/xlsx/validation-types.js +1 -0
  243. package/dist/xlsx/validation.d.ts +1 -0
  244. package/dist/xlsx/validation.js +92 -0
  245. package/dist/xlsx/values.d.ts +13 -0
  246. package/dist/xlsx/values.js +86 -0
  247. package/dist/xlsx/workbook.d.ts +50 -0
  248. package/dist/xlsx/workbook.js +452 -0
  249. package/dist/xlsx/worksheet.d.ts +71 -0
  250. package/dist/xlsx/worksheet.js +700 -0
  251. package/dist/xlsx/write.d.ts +15 -0
  252. package/dist/xlsx/write.js +47 -0
  253. package/dist/xml/index.d.ts +24 -0
  254. package/dist/xml/index.js +74 -0
  255. package/dist/zip/entry.d.ts +39 -0
  256. package/dist/zip/entry.js +122 -0
  257. package/dist/zip/index.d.ts +44 -0
  258. package/dist/zip/index.js +248 -0
  259. package/package.json +104 -4
@@ -0,0 +1,201 @@
1
+ import { NotSupportedError, OfficeIMOError } from "../core/errors.js";
2
+ import { fontProgram } from "./font.js";
3
+ import { resolveScalar, selectFont, standardCode, validateFonts } from "./font-support.js";
4
+ import { pdfNumber, unicodeHex } from "./objects.js";
5
+ import { checkAbort, pause, taskYieldDue } from "../core/iteration.js";
6
+ export class PdfFontResource {
7
+ index;
8
+ bold;
9
+ italic;
10
+ font;
11
+ shared;
12
+ signal;
13
+ name;
14
+ object;
15
+ program;
16
+ syntheticBold;
17
+ syntheticItalic;
18
+ mappings = new Map();
19
+ standardWidths = new Map();
20
+ constructor(index, bold, italic, font, objects, syntheticBold, syntheticItalic, shared, signal) {
21
+ this.index = index;
22
+ this.bold = bold;
23
+ this.italic = italic;
24
+ this.font = font;
25
+ this.shared = shared;
26
+ this.signal = signal;
27
+ this.name = shared?.name ?? "F" + index;
28
+ this.object = shared?.object ?? objects.reserve();
29
+ this.program = font ? fontProgram(font) : undefined;
30
+ this.syntheticBold = syntheticBold;
31
+ this.syntheticItalic = syntheticItalic;
32
+ }
33
+ width(scalar) {
34
+ if (this.shared)
35
+ return this.shared.width(scalar);
36
+ const existing = this.mappings.get(scalar);
37
+ if (existing)
38
+ return existing.width;
39
+ const standard = this.standardWidths.get(scalar);
40
+ if (standard !== undefined)
41
+ return standard;
42
+ const resolved = resolveScalar(scalar, this.program, this.bold);
43
+ if (!resolved.supported) {
44
+ if (resolved.code === "unpaired-surrogate")
45
+ throw new TypeError(resolved.message);
46
+ throw new NotSupportedError(resolved.message);
47
+ }
48
+ if (!this.program) {
49
+ this.standardWidths.set(scalar, resolved.width);
50
+ return resolved.width;
51
+ }
52
+ if (this.mappings.size >= 65535)
53
+ throw new OfficeIMOError("RESOURCE_LIMIT", "A PDF font supports at most 65,535 distinct Unicode scalars.");
54
+ const mapping = { cid: this.mappings.size + 1, glyph: resolved.glyph, width: resolved.width, text: String.fromCodePoint(scalar) };
55
+ this.mappings.set(scalar, mapping);
56
+ return mapping.width;
57
+ }
58
+ lineHeight(size) {
59
+ return Math.max(1.3, this.program ? (this.program.ascent - this.program.descent) / 1000 + .1 : 1.3) * size;
60
+ }
61
+ encode(text) {
62
+ if (this.shared)
63
+ return this.shared.encode(text);
64
+ let hex = "";
65
+ for (const char of text) {
66
+ const cp = char.codePointAt(0);
67
+ this.width(cp);
68
+ hex += (this.program ? this.mappings.get(cp).cid : standardCode(cp)).toString(16).padStart(this.program ? 4 : 2, "0");
69
+ }
70
+ return "<" + hex + ">";
71
+ }
72
+ /** Register an already validated shaped glyph. A glyph may need distinct CIDs for different logical clusters. */
73
+ encodeGlyph(glyph, text) {
74
+ if (this.shared)
75
+ return this.shared.encodeGlyph(glyph, text);
76
+ if (!this.program || !Number.isSafeInteger(glyph) || glyph <= 0 || glyph >= this.program.glyphCount)
77
+ throw new TypeError("Invalid shaped TrueType glyph.");
78
+ const key = glyph + ":" + text;
79
+ let mapping = this.mappings.get(key);
80
+ if (!mapping) {
81
+ if (this.mappings.size >= 65535)
82
+ throw new OfficeIMOError("RESOURCE_LIMIT", "A PDF font supports at most 65,535 distinct CID mappings.");
83
+ mapping = { cid: this.mappings.size + 1, glyph, width: this.program.widths[glyph], text };
84
+ this.mappings.set(key, mapping);
85
+ }
86
+ return "<" + mapping.cid.toString(16).padStart(4, "0") + ">";
87
+ }
88
+ async write(objects, compression) {
89
+ checkAbort(this.signal);
90
+ if (!this.program) {
91
+ const name = "Helvetica" + (this.bold && this.italic ? "-BoldOblique" : this.bold ? "-Bold" : this.italic ? "-Oblique" : "");
92
+ await objects.object(this.object, "<< /Type /Font /Subtype /Type1 /BaseFont /" + name + " /Encoding /WinAnsiEncoding >>");
93
+ return;
94
+ }
95
+ const program = this.program, entries = [...this.mappings], glyphs = new Set(entries.map(([, m]) => m.glyph));
96
+ const fontName = (program.canSubset ? "OIMOAA+" : "") + "OfficeIMOFont" + this.index;
97
+ const file = objects.reserve(), descriptor = objects.reserve(), cidFont = objects.reserve(), map = objects.reserve(), unicode = objects.reserve();
98
+ const characters = new Map();
99
+ for (const [key, mapping] of entries) {
100
+ if (typeof key === "number")
101
+ characters.set(key, mapping.glyph);
102
+ else
103
+ for (const character of mapping.text) {
104
+ const scalar = character.codePointAt(0), glyph = program.glyph(scalar);
105
+ if (glyph) {
106
+ characters.set(scalar, glyph);
107
+ glyphs.add(glyph);
108
+ }
109
+ }
110
+ }
111
+ const subset = await program.subsetCooperatively(glyphs, characters, this.signal);
112
+ await objects.stream(file, subset, "/Length1 " + subset.length, compression, true);
113
+ await objects.object(descriptor, "<< /Type /FontDescriptor /FontName /" + fontName + " /Flags 32 /FontBBox [" + program.bbox.map(pdfNumber).join(" ") +
114
+ "] /ItalicAngle 0 /Ascent " + pdfNumber(program.ascent) + " /Descent " + pdfNumber(program.descent) + " /CapHeight " + pdfNumber(program.ascent) + " /StemV 80 /FontFile2 " + file + " 0 R >>");
115
+ const mapping = new Uint8Array((entries.length + 1) * 2), view = new DataView(mapping.buffer);
116
+ for (let i = 0; i < entries.length; i++) {
117
+ const entry = entries[i][1];
118
+ view.setUint16(entry.cid * 2, entry.glyph);
119
+ if ((i & 1023) === 1023) {
120
+ if (taskYieldDue())
121
+ await pause();
122
+ checkAbort(this.signal);
123
+ }
124
+ }
125
+ await objects.stream(map, mapping, "", compression, true);
126
+ await objects.object(cidFont, "<< /Type /Font /Subtype /CIDFontType2 /BaseFont /" + fontName +
127
+ " /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> /FontDescriptor " + descriptor + " 0 R /CIDToGIDMap " + map + " 0 R" +
128
+ (entries.length ? " /W [1 [" + entries.map(([, m]) => pdfNumber(m.width)).join(" ") + "]]" : "") + " >>");
129
+ let cmap = "/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def\n/CMapName /OfficeIMOUnicode def\n/CMapType 2 def\n1 begincodespacerange\n<0000> <FFFF>\nendcodespacerange\n";
130
+ const mapped = entries.filter(([, mapping]) => mapping.text.length);
131
+ for (let i = 0; i < mapped.length; i += 100) {
132
+ const batch = mapped.slice(i, i + 100);
133
+ cmap += batch.length + " beginbfchar\n";
134
+ for (const [, m] of batch)
135
+ cmap += "<" + m.cid.toString(16).padStart(4, "0") + "> <" + unicodeHex(m.text) + ">\n";
136
+ cmap += "endbfchar\n";
137
+ if (taskYieldDue())
138
+ await pause();
139
+ checkAbort(this.signal);
140
+ }
141
+ cmap += "endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n";
142
+ await objects.stream(unicode, cmap, "", compression);
143
+ await objects.object(this.object, "<< /Type /Font /Subtype /Type0 /BaseFont /" + fontName + " /Encoding /Identity-H /DescendantFonts [" + cidFont + " 0 R] /ToUnicode " + unicode + " 0 R >>");
144
+ }
145
+ }
146
+ export class PdfFontResources {
147
+ objects;
148
+ fonts;
149
+ maxBytes;
150
+ signal;
151
+ resources = [];
152
+ selections = new Map();
153
+ programs = new Map();
154
+ explicitSelections = new Map();
155
+ registered = new Set();
156
+ fontBytes = 0;
157
+ constructor(objects, fonts, maxBytes = 16 * 1024 * 1024, signal) {
158
+ this.objects = objects;
159
+ this.fonts = fonts;
160
+ this.maxBytes = maxBytes;
161
+ this.signal = signal;
162
+ validateFonts(fonts, maxBytes);
163
+ for (const font of Object.values(fonts ?? {}))
164
+ this.registerFont(font);
165
+ }
166
+ /** The same operation budget covers unused declared faces and every explicit run face, once per identity. */
167
+ registerFont(font) {
168
+ if (this.registered.has(font))
169
+ return;
170
+ const bytes = fontProgram(font).bytes.length;
171
+ if (this.fontBytes + bytes > this.maxBytes)
172
+ throw new OfficeIMOError("RESOURCE_LIMIT", "maxFontBytes exceeded.");
173
+ this.fontBytes += bytes;
174
+ this.registered.add(font);
175
+ }
176
+ select(bold = false, italic = false, explicit) {
177
+ if (explicit)
178
+ this.registerFont(explicit);
179
+ let selections = this.selections;
180
+ if (explicit) {
181
+ const found = this.explicitSelections.get(explicit);
182
+ selections = found ?? new Map();
183
+ if (!found)
184
+ this.explicitSelections.set(explicit, selections);
185
+ }
186
+ const key = String(bold) + String(italic), existing = selections.get(key);
187
+ if (existing)
188
+ return existing;
189
+ const { font, syntheticBold, syntheticItalic } = explicit ? { font: explicit, syntheticBold: bold, syntheticItalic: italic } : selectFont(this.fonts, bold, italic);
190
+ const shared = font ? this.programs.get(font) : undefined;
191
+ const resource = new PdfFontResource(this.resources.length + 1, bold, italic, font, this.objects, syntheticBold, syntheticItalic, shared, this.signal);
192
+ if (!shared) {
193
+ this.resources.push(resource);
194
+ if (font)
195
+ this.programs.set(font, resource);
196
+ }
197
+ selections.set(key, resource);
198
+ return resource;
199
+ }
200
+ dictionary() { return "<< " + this.resources.map(f => "/" + f.name + " " + f.object + " 0 R").join(" ") + " >>"; }
201
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,60 @@
1
+ import { OfficeIMOError } from "../core/errors.js";
2
+ import { PdfFont, fontProgram } from "./font.js";
3
+ import { helveticaWidths } from "./standard-widths.js";
4
+ const winAnsiExtras = new Map([0x20ac, 0, 0x201a, 0x192, 0x201e, 0x2026, 0x2020, 0x2021, 0x2c6, 0x2030, 0x160, 0x2039, 0x152, 0, 0x17d, 0, 0, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x2dc, 0x2122, 0x161, 0x203a, 0x153, 0, 0x17e, 0x178].map((cp, i) => [cp, i + 128]));
5
+ /** @internal Called after scalar support succeeds when encoding a standard-font run. */
6
+ export function standardCode(scalar) {
7
+ if ((scalar >= 32 && scalar <= 126) || (scalar >= 160 && scalar <= 255))
8
+ return scalar;
9
+ return scalar ? winAnsiExtras.get(scalar) : undefined;
10
+ }
11
+ /** @internal One encoding/glyph decision for the writer and public text preflight. */
12
+ export function resolveScalar(scalar, program, bold) {
13
+ if (scalar >= 0xd800 && scalar <= 0xdfff)
14
+ return { supported: false, code: "unpaired-surrogate", message: "PDF text contains an unpaired UTF-16 surrogate." };
15
+ if (scalar < 32 || (scalar >= 127 && scalar < 160))
16
+ return { supported: false, code: "unsupported-control", message: "PDF text contains an unsupported control character." };
17
+ const character = String.fromCodePoint(scalar);
18
+ if (/[\p{Mark}\p{Format}]/u.test(character) || !/[\p{Script=Latin}\p{Script=Greek}\p{Script=Cyrillic}\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Common}]/u.test(character) ||
19
+ (scalar >= 0x1100 && scalar <= 0x11ff) || (scalar >= 0x1f3fb && scalar <= 0x1f3ff))
20
+ return { supported: false, code: "unsupported-layout", message: "This PDF table writer supports Unicode scalar layout; complex shaping, combining sequences and bidirectional text require a shaping-capable writer." };
21
+ if (!program) {
22
+ if (standardCode(scalar) === undefined)
23
+ return { supported: false, code: "embedded-font-required", message: "Text U+" + scalar.toString(16).toUpperCase() + " needs an embedded Unicode TrueType font; supply fonts.regular." };
24
+ const metric = helveticaWidths.get(scalar === 160 ? 32 : scalar === 173 ? 45 : scalar);
25
+ if (!metric)
26
+ return { supported: false, code: "missing-glyph", message: "Standard font has no metric for this character." };
27
+ return { supported: true, width: metric[bold ? 1 : 0] };
28
+ }
29
+ let glyph = program.glyph(scalar);
30
+ // Reuse only an inkless thin-space glyph; the source scalar keeps its own CID/ToUnicode.
31
+ if (!glyph && scalar === 0x202f) {
32
+ const thin = program.glyph(0x2009);
33
+ if (thin && program.offsets[thin] === program.offsets[thin + 1])
34
+ glyph = thin;
35
+ }
36
+ if (!glyph)
37
+ return { supported: false, code: "missing-glyph", message: "The supplied font has no glyph for U+" + scalar.toString(16).toUpperCase() + "." };
38
+ return { supported: true, glyph, width: program.widths[glyph] };
39
+ }
40
+ /** @internal Family validation is shared; preflight does not impose a document's byte budget. */
41
+ export function validateFonts(fonts, maxBytes) {
42
+ if (!fonts)
43
+ return;
44
+ if (!(fonts.regular instanceof PdfFont))
45
+ throw new TypeError("fonts.regular must be a PdfFont.");
46
+ const unique = new Set();
47
+ for (const [key, font] of Object.entries(fonts)) {
48
+ if (!["regular", "bold", "italic", "boldItalic"].includes(key) || !(font instanceof PdfFont))
49
+ throw new TypeError("Invalid PDF font family.");
50
+ unique.add(font);
51
+ }
52
+ if (maxBytes !== undefined && [...unique].reduce((n, f) => n + fontProgram(f).bytes.length, 0) > maxBytes)
53
+ throw new OfficeIMOError("RESOURCE_LIMIT", "maxFontBytes exceeded.");
54
+ }
55
+ /** @internal Missing emphasis faces select regular glyphs with the writer's synthetic styling. */
56
+ export function selectFont(fonts, bold, italic) {
57
+ const exact = fonts && (bold && italic ? fonts.boldItalic : bold ? fonts.bold : italic ? fonts.italic : fonts.regular);
58
+ const font = exact ?? fonts?.regular;
59
+ return { font, syntheticBold: !!font && bold && !exact, syntheticItalic: !!font && italic && !exact };
60
+ }
@@ -0,0 +1,17 @@
1
+ /** Intake limits for asynchronous font preparation; the source is copied before yielding. */
2
+ export interface PdfFontPreparationOptions {
3
+ readonly signal?: AbortSignal;
4
+ /** Defaults to 16 MiB; cannot exceed the constructor's 64 MiB hard ceiling. */
5
+ readonly maxBytes?: number;
6
+ }
7
+ /** Immutable, reusable static TrueType font. Bytes are copied; no fetch, DOM or installed-font lookup occurs. */
8
+ export declare class PdfFont {
9
+ static [Symbol.hasInstance](value: unknown): boolean;
10
+ private readonly brand;
11
+ constructor(bytes: Uint8Array);
12
+ /** Prepare the same immutable font with cooperative parsing and cancellation.
13
+ * The bounded source snapshot is synchronous so later host mutation cannot change the prepared font. */
14
+ static create(bytes: Uint8Array, options?: PdfFontPreparationOptions): Promise<PdfFont>;
15
+ /** Return an independent copy, for storage or delivery to another worker. */
16
+ toBytes(): Uint8Array;
17
+ }
@@ -0,0 +1,56 @@
1
+ import { TrueTypeFont } from "./truetype.js";
2
+ import { beginTask, checkAbort } from "../core/iteration.js";
3
+ const programs = new WeakMap();
4
+ const fontBrand = Symbol.for("@evotecit/officeimo/PdfFont");
5
+ /** @internal Font bytes stay private even in plain JavaScript consumers. */
6
+ export function fontProgram(font) {
7
+ let program = programs.get(font);
8
+ if (!program) {
9
+ if (!(font instanceof PdfFont) || typeof font.toBytes !== "function")
10
+ throw new TypeError("Invalid PdfFont instance.");
11
+ // Standalone ESM assemblies have separate class/WeakMap identities. Import a
12
+ // defensive copy once while preserving the same public reusable-font contract.
13
+ const copied = new PdfFont(font.toBytes());
14
+ program = programs.get(copied);
15
+ programs.set(font, program);
16
+ }
17
+ return program;
18
+ }
19
+ /** Immutable, reusable static TrueType font. Bytes are copied; no fetch, DOM or installed-font lookup occurs. */
20
+ export class PdfFont {
21
+ static [Symbol.hasInstance](value) { return !!value && typeof value === "object" && value[fontBrand] === true; }
22
+ brand = true;
23
+ constructor(bytes) {
24
+ if (!(bytes instanceof Uint8Array))
25
+ throw new TypeError("PdfFont requires TrueType bytes as a Uint8Array.");
26
+ if (bytes.length > 64 * 1024 * 1024)
27
+ throw new RangeError("A TrueType font must not exceed 64 MiB.");
28
+ programs.set(this, new TrueTypeFont(bytes.slice()));
29
+ void this.brand;
30
+ Object.defineProperty(this, fontBrand, { value: true });
31
+ Object.freeze(this);
32
+ }
33
+ /** Prepare the same immutable font with cooperative parsing and cancellation.
34
+ * The bounded source snapshot is synchronous so later host mutation cannot change the prepared font. */
35
+ static async create(bytes, options = {}) {
36
+ checkAbort(options.signal);
37
+ if (!(bytes instanceof Uint8Array))
38
+ throw new TypeError("PdfFont requires TrueType bytes as a Uint8Array.");
39
+ const maximum = options.maxBytes ?? 16 * 1024 * 1024;
40
+ if (!Number.isSafeInteger(maximum) || maximum < 0 || maximum > 64 * 1024 * 1024)
41
+ throw new RangeError("Font preparation maxBytes must be a nonnegative safe integer at most 64 MiB.");
42
+ if (bytes.length > maximum)
43
+ throw new RangeError("TrueType font exceeds the preparation byte limit.");
44
+ beginTask();
45
+ const program = await TrueTypeFont.create(new Uint8Array(bytes), options.signal);
46
+ checkAbort(options.signal);
47
+ const font = Object.create(PdfFont.prototype);
48
+ programs.set(font, program);
49
+ Object.defineProperty(font, "brand", { value: true });
50
+ Object.defineProperty(font, fontBrand, { value: true });
51
+ Object.freeze(font);
52
+ return font;
53
+ }
54
+ /** Return an independent copy, for storage or delivery to another worker. */
55
+ toBytes() { return fontProgram(this).bytes.slice(); }
56
+ }
@@ -0,0 +1,6 @@
1
+ import type { GroupedReportSource } from "../core/grouped-report.js";
2
+ import type { PdfGroupedTableBlock } from "./document-types.js";
3
+ import type { GroupedPdfTableOptions } from "./grouped-types.js";
4
+ /** Capture an analytical table without opening its row iterator or attaching cancellation listeners.
5
+ * Ownership begins when the document reaches the block; unused blocks leave their sources unconsumed. */
6
+ export declare function pdfGroupedTable(report: GroupedReportSource, options: GroupedPdfTableOptions): PdfGroupedTableBlock;
@@ -0,0 +1,40 @@
1
+ import { assertGroupedReportSource } from "../core/grouped-report.js";
2
+ import { captureFields } from "../internal/capture.js";
3
+ import { captureWideTable } from "./settings.js";
4
+ import { presentation } from "./presentation-settings.js";
5
+ /** @internal Capture schemas shared by the block factory and standalone convenience writers. */
6
+ export const groupedPdfLabelFields = ["labelColumn", "subtotalLabel", "grandTotalLabel", "includeGrandTotal", "continuationLabel", "groupHeadingLevel"];
7
+ /** @internal A grouped table may override presentation but not its document's resource/lifetime policy. */
8
+ export const groupedPdfTableFields = ["includeHeader", "headerPresentation", "footerPresentation", "alternateRowColor", "columnWidths", "wideTable", "formatValue", "formatRuns", ...groupedPdfLabelFields];
9
+ /** Capture an analytical table without opening its row iterator or attaching cancellation listeners.
10
+ * Ownership begins when the document reaches the block; unused blocks leave their sources unconsumed. */
11
+ export function pdfGroupedTable(report, options) {
12
+ assertGroupedReportSource(report);
13
+ return Object.freeze({ kind: "groupedTable", report, options: captureGroupedPdfTableOptions(options) });
14
+ }
15
+ /** @internal Capture the same public table contract for factory-created and structural document blocks. */
16
+ export function captureGroupedPdfTableOptions(configuration) {
17
+ if (!configuration || typeof configuration !== "object" || Array.isArray(configuration) ||
18
+ Object.keys(configuration).some(key => !groupedPdfTableFields.includes(key)))
19
+ throw new TypeError("Grouped PDF table options support table presentation and labels; document settings belong on writePdfDocument.");
20
+ const captured = captureFields(configuration, groupedPdfTableFields);
21
+ const { labelColumn, subtotalLabel, grandTotalLabel, includeGrandTotal, continuationLabel, groupHeadingLevel } = captured;
22
+ if (!labelColumn || typeof labelColumn !== "object")
23
+ throw new TypeError("Grouped PDF needs a leading labelColumn.");
24
+ const { header, width } = labelColumn;
25
+ if (typeof header !== "string")
26
+ throw new TypeError("The grouped label column header must be text.");
27
+ for (const [name, value] of [["subtotalLabel", subtotalLabel], ["grandTotalLabel", grandTotalLabel]])
28
+ if (typeof value !== "function")
29
+ throw new TypeError(name + " must be a synchronous text callback.");
30
+ if (continuationLabel !== undefined && typeof continuationLabel !== "function")
31
+ throw new TypeError("continuationLabel must be a synchronous text callback.");
32
+ if (includeGrandTotal !== undefined && typeof includeGrandTotal !== "boolean")
33
+ throw new TypeError("includeGrandTotal must be boolean.");
34
+ if (groupHeadingLevel !== undefined && (!Number.isInteger(groupHeadingLevel) || groupHeadingLevel < 1 || groupHeadingLevel > 6))
35
+ throw new TypeError("groupHeadingLevel must be an integer from 1 through 6.");
36
+ return Object.freeze({ ...captured, ...(captured.wideTable === undefined ? {} : { wideTable: captureWideTable(captured.wideTable) }), labelColumn: Object.freeze({ header, ...(width === undefined ? {} : { width }) }),
37
+ ...(captured.columnWidths === undefined ? {} : { columnWidths: Object.freeze([...captured.columnWidths]) }),
38
+ ...(captured.headerPresentation === undefined ? {} : { headerPresentation: presentation(captured.headerPresentation) }),
39
+ ...(captured.footerPresentation === undefined ? {} : { footerPresentation: presentation(captured.footerPresentation) }) });
40
+ }
@@ -0,0 +1,34 @@
1
+ import type { GroupedReportEvent, GroupedReportSummary } from "../core/grouped-report.js";
2
+ import type { ExportValue } from "../core/index.js";
3
+ import type { PdfOptions } from "./types.js";
4
+ import type { PdfTableOptions } from "./document-types.js";
5
+ /** Host-authored labels shared by standalone and composed analytical PDF tables. */
6
+ interface GroupedPdfLabels {
7
+ /** An additional leading text column leaves every original data column and numeric total intact. */
8
+ readonly labelColumn: {
9
+ readonly header: string;
10
+ readonly width?: number;
11
+ };
12
+ /** Explicit host-authored label; the event includes the group label and all accepted body-row count. */
13
+ readonly subtotalLabel: (group: Extract<GroupedReportEvent, {
14
+ readonly kind: "groupEnd";
15
+ }>) => string;
16
+ /** Explicit host-authored label for the final summary. */
17
+ readonly grandTotalLabel: (summary: GroupedReportSummary) => string;
18
+ /** Include the final summary row, including an empty report's zero/null totals. Default true. */
19
+ readonly includeGrandTotal?: boolean;
20
+ /** Repeated before column headings on continued group pages. Defaults to the exact captured group label. */
21
+ readonly continuationLabel?: (group: Extract<GroupedReportEvent, {
22
+ readonly kind: "groupStart";
23
+ }>) => string;
24
+ /** Tagged heading level for the outermost group, followed by one level per nested group. Default 2.
25
+ * Every opened group must fit through heading level 6; choose 1 for a titleless standalone report. */
26
+ readonly groupHeadingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
27
+ }
28
+ /** A composed analytical table inherits fonts, page geometry, cancellation and cumulative limits from its document. */
29
+ export interface GroupedPdfTableOptions extends Omit<PdfTableOptions<readonly ExportValue[]>, "columns" | "footer" | "headerRows">, GroupedPdfLabels {
30
+ }
31
+ /** Analytical groups use the composed document/table layout owner and its resource policy. */
32
+ export interface GroupedPdfOptions extends Omit<PdfOptions<readonly ExportValue[]>, "columns" | "footer" | "headerRows">, GroupedPdfLabels {
33
+ }
34
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { GroupedReportSource } from "../core/grouped-report.js";
2
+ import type { ExportResult, OutputDestination } from "../core/index.js";
3
+ import type { GroupedPdfOptions } from "./grouped-types.js";
4
+ export { pdfGroupedTable } from "./grouped-table.js";
5
+ /** Stream analytical groups through the composed document owner. No group body is retained. */
6
+ export declare function writeGroupedPdf(report: GroupedReportSource, configuration: GroupedPdfOptions): Promise<Blob>;
7
+ /** Result/progress rows count source data. Generated subtotals and grand totals also consume maxRows.
8
+ * Tagged output uses nested group sections and separately headed summary tables. Untagged oversized
9
+ * detail/subtotal bundles use ordinary row pagination. */
10
+ export declare function writeGroupedPdfTo(report: GroupedReportSource, destination: OutputDestination, configuration: GroupedPdfOptions): Promise<ExportResult>;
@@ -0,0 +1,37 @@
1
+ import { assertGroupedReportSource } from "../core/grouped-report.js";
2
+ import { BlobByteSink } from "../core/sinks.js";
3
+ import { writePdfDocumentTo } from "./document.js";
4
+ import { pdfOptionFields } from "./settings.js";
5
+ import { captureFields } from "../internal/capture.js";
6
+ import { pdfGroupedTable, groupedPdfLabelFields, groupedPdfTableFields } from "./grouped-table.js";
7
+ export { pdfGroupedTable } from "./grouped-table.js";
8
+ const groupedOptionFields = [...pdfOptionFields, ...groupedPdfLabelFields];
9
+ /** Stream analytical groups through the composed document owner. No group body is retained. */
10
+ export async function writeGroupedPdf(report, configuration) {
11
+ const sink = new BlobByteSink();
12
+ try {
13
+ await writeGroupedPdfTo(report, sink, configuration);
14
+ return sink.toBlob("application/pdf");
15
+ }
16
+ catch (error) {
17
+ sink.discard();
18
+ throw error;
19
+ }
20
+ }
21
+ /** Result/progress rows count source data. Generated subtotals and grand totals also consume maxRows.
22
+ * Tagged output uses nested group sections and separately headed summary tables. Untagged oversized
23
+ * detail/subtotal bundles use ordinary row pagination. */
24
+ export async function writeGroupedPdfTo(report, destination, configuration) {
25
+ assertGroupedReportSource(report);
26
+ if (!configuration || typeof configuration !== "object")
27
+ throw new TypeError("Grouped PDF options are required.");
28
+ const captured = captureFields(configuration, groupedOptionFields);
29
+ const tableOptions = Object.fromEntries(groupedPdfTableFields.filter(name => Object.hasOwn(captured, name)).map(name => [name, captured[name]]));
30
+ const documentOptions = { ...captured };
31
+ for (const name of groupedPdfTableFields)
32
+ delete documentOptions[name];
33
+ delete documentOptions.columns;
34
+ delete documentOptions.headerRows;
35
+ delete documentOptions.footer;
36
+ return writePdfDocumentTo([pdfGroupedTable(report, tableOptions)], destination, documentOptions);
37
+ }
@@ -0,0 +1,22 @@
1
+ export { writePdf, writePdfTo } from "./write.js";
2
+ export { writeGroupedPdf, writeGroupedPdfTo, pdfGroupedTable } from "./grouped.js";
3
+ export type { GroupedPdfOptions, GroupedPdfTableOptions } from "./grouped-types.js";
4
+ export type { PdfPageNumberLabels } from "./types.js";
5
+ export type { BooleanText } from "../core/value-text.js";
6
+ export { createGroupedReport } from "../core/grouped-report.js";
7
+ export type { GroupedReportSource, GroupedReportOptions, GroupedReportEvent, GroupedReportSummary, GroupedReportValueContext, GroupedReportLevel, GroupedReportGroup } from "../core/grouped-report.js";
8
+ export { writePdfDocument, writePdfDocumentTo, pdfTable } from "./document.js";
9
+ export type { PdfDocumentOptions, PdfDocumentBlock, PdfTableOptions, PdfTableBlock, PdfParagraphBlock, PdfParagraphStyle, PdfCaption, PdfListBlock, PdfListItem, PdfGroupBlock, PdfPageBreakBlock, PdfImageBlock, PdfRawImage, PdfJpegImage, PdfPngImage, PdfVectorBlock, PdfPathCommand } from "./document-types.js";
10
+ export type { PdfTextRun, PdfText } from "./inline-types.js";
11
+ export type { PdfTextDirection, PdfShapingRun, PdfShapedGlyph, PdfShapedRun, PdfShapeLineRequest, PdfTextShaper } from "./text-shaping-types.js";
12
+ export type { PdfDrawing, PdfDrawingBlock, PdfDrawingElement, PdfDrawingPath, PdfDrawingText, PdfDrawingGroup, PdfDrawingClip, PdfDrawingFont } from "./drawing-types.js";
13
+ export { PdfFont } from "./font.js";
14
+ export type { PdfFontPreparationOptions } from "./font.js";
15
+ export { preflightPdfText } from "./preflight.js";
16
+ export { ExportCell } from "../core/presentation.js";
17
+ export { saveBlob } from "../core/index.js";
18
+ export type { PdfOptions, PdfTableBands, PdfPageSize, PdfMargins, PdfFonts, PdfLimits, PdfTaggedOptions, PdfTableFooter, PdfPageContext, PdfTotal } from "./types.js";
19
+ export type { PdfTextPreflightOptions, PdfTextPreflightResult, PdfTextIssueCode } from "./types.js";
20
+ export type { CellValue, Column, ColumnValueContext, ExportValue, CellPresentation, ExportResult, ExportProgress, OutputDestination, ByteSink, TableSpanCell, TableSpanRows } from "../core/index.js";
21
+ export type { PdfSectionBlock, PdfBookmark } from "./section-types.js";
22
+ export type { PdfGroupedTableBlock } from "./document-types.js";
@@ -0,0 +1,8 @@
1
+ export { writePdf, writePdfTo } from "./write.js";
2
+ export { writeGroupedPdf, writeGroupedPdfTo, pdfGroupedTable } from "./grouped.js";
3
+ export { createGroupedReport } from "../core/grouped-report.js";
4
+ export { writePdfDocument, writePdfDocumentTo, pdfTable } from "./document.js";
5
+ export { PdfFont } from "./font.js";
6
+ export { preflightPdfText } from "./preflight.js";
7
+ export { ExportCell } from "../core/presentation.js";
8
+ export { saveBlob } from "../core/index.js";
@@ -0,0 +1,30 @@
1
+ import type { CellPresentation, ExportLink } from "../core/index.js";
2
+ import type { PdfFontResource } from "./font-resources.js";
3
+ import type { PdfShapedGlyph } from "./text-shaping-types.js";
4
+ import { PdfFont } from "./font.js";
5
+ export interface CapturedRun {
6
+ readonly text: string;
7
+ readonly style: Readonly<CellPresentation>;
8
+ readonly link?: Readonly<ExportLink>;
9
+ readonly font?: PdfFont;
10
+ }
11
+ export interface PdfInlineSegment {
12
+ readonly text: string;
13
+ readonly width: number;
14
+ readonly font: PdfFontResource;
15
+ readonly color?: string;
16
+ readonly link?: Readonly<ExportLink>;
17
+ readonly glyphs?: readonly (PdfShapedGlyph & {
18
+ readonly logicalText: string;
19
+ })[];
20
+ readonly logicalStart?: number;
21
+ readonly actualText?: string;
22
+ }
23
+ export interface PdfInlineLine {
24
+ readonly text: string;
25
+ readonly width: number;
26
+ readonly segments: readonly PdfInlineSegment[];
27
+ readonly lineHeight: number;
28
+ readonly ascent: number;
29
+ readonly actualText?: string;
30
+ }