pdf-parser.js 5.2.26 → 5.2.28

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 (221) hide show
  1. package/dist/{afm-widths-BYiX2L9D.cjs → afm-widths-BHD2HZIL.cjs} +553 -642
  2. package/dist/{afm-widths-blUDDjlI.js → afm-widths-B_IGbGky.js} +553 -642
  3. package/dist/afm-widths.cjs +1 -1
  4. package/dist/afm-widths.js +1 -1
  5. package/dist/annotations.cjs +5 -3
  6. package/dist/annotations.d.cts +2 -2
  7. package/dist/annotations.d.ts +2 -2
  8. package/dist/annotations.js +5 -3
  9. package/dist/attachments.d.cts +2 -2
  10. package/dist/attachments.d.ts +2 -2
  11. package/dist/builtin-encoding.cjs +17 -6
  12. package/dist/builtin-encoding.js +17 -6
  13. package/dist/bytes/crc32.cjs +5 -3
  14. package/dist/bytes/crc32.js +5 -3
  15. package/dist/bytes/flate.cjs +0 -1
  16. package/dist/bytes/flate.js +0 -1
  17. package/dist/cff-bounds.cjs +73 -45
  18. package/dist/cff-bounds.js +73 -45
  19. package/dist/cff.cjs +13 -6
  20. package/dist/cff.js +13 -6
  21. package/dist/cmap-table.cjs +54 -26
  22. package/dist/cmap-table.js +54 -26
  23. package/dist/cmap.cjs +5 -3
  24. package/dist/cmap.js +5 -3
  25. package/dist/content-read.d.cts +1 -1
  26. package/dist/content-read.d.ts +1 -1
  27. package/dist/content-write.cjs +21 -14
  28. package/dist/content-write.d.cts +2 -2
  29. package/dist/content-write.d.ts +2 -2
  30. package/dist/content-write.js +21 -14
  31. package/dist/crypto/aes.cjs +76 -55
  32. package/dist/crypto/aes.js +76 -55
  33. package/dist/crypto/md5.cjs +345 -149
  34. package/dist/crypto/md5.js +345 -149
  35. package/dist/crypto/rc4.cjs +5 -4
  36. package/dist/crypto/rc4.js +5 -4
  37. package/dist/crypto/sha2.cjs +92 -43
  38. package/dist/crypto/sha2.js +92 -43
  39. package/dist/document.cjs +17 -11
  40. package/dist/document.d.cts +1 -1
  41. package/dist/document.d.ts +1 -1
  42. package/dist/document.js +17 -11
  43. package/dist/{embedded-font-Bnhh4juV.d.ts → embedded-font-ByD7ZiQS.d.ts} +1 -1
  44. package/dist/{embedded-font-CEf-zBCA.d.cts → embedded-font-DgVBedw6.d.cts} +1 -1
  45. package/dist/embedded-font-write.d.cts +2 -2
  46. package/dist/embedded-font-write.d.ts +2 -2
  47. package/dist/embedded-font.cjs +4 -2
  48. package/dist/embedded-font.d.cts +1 -1
  49. package/dist/embedded-font.d.ts +1 -1
  50. package/dist/embedded-font.js +4 -2
  51. package/dist/encoding.cjs +1 -1
  52. package/dist/encoding.js +1 -1
  53. package/dist/encrypt-write.cjs +25 -21
  54. package/dist/encrypt-write.d.cts +1 -1
  55. package/dist/encrypt-write.d.ts +1 -1
  56. package/dist/encrypt-write.js +25 -21
  57. package/dist/encrypt.cjs +43 -64
  58. package/dist/encrypt.d.cts +1 -1
  59. package/dist/encrypt.d.ts +1 -1
  60. package/dist/encrypt.js +43 -64
  61. package/dist/filters.cjs +46 -26
  62. package/dist/filters.d.cts +1 -1
  63. package/dist/filters.d.ts +1 -1
  64. package/dist/filters.js +46 -26
  65. package/dist/font-face.cjs +2 -1
  66. package/dist/font-face.js +2 -1
  67. package/dist/font-read.cjs +12 -6
  68. package/dist/font-read.d.cts +1 -1
  69. package/dist/font-read.d.ts +1 -1
  70. package/dist/font-read.js +12 -6
  71. package/dist/font-registry.d.cts +3 -3
  72. package/dist/font-registry.d.ts +3 -3
  73. package/dist/font-tables.cjs +55 -28
  74. package/dist/font-tables.js +55 -28
  75. package/dist/form.cjs +13 -8
  76. package/dist/form.d.cts +2 -2
  77. package/dist/form.d.ts +2 -2
  78. package/dist/form.js +13 -8
  79. package/dist/gdef-table.cjs +6 -3
  80. package/dist/gdef-table.js +6 -3
  81. package/dist/{glyf-contours-C0epBNqP.d.ts → glyf-contours-B1PsI9oA.d.ts} +1 -1
  82. package/dist/{glyf-contours-BRpvd0rt.d.cts → glyf-contours-NHBpgks-.d.cts} +1 -1
  83. package/dist/glyf-contours.cjs +3 -1
  84. package/dist/glyf-contours.d.cts +1 -1
  85. package/dist/glyf-contours.d.ts +1 -1
  86. package/dist/glyf-contours.js +3 -1
  87. package/dist/glyf.cjs +22 -11
  88. package/dist/glyf.js +22 -11
  89. package/dist/gpos-table.cjs +37 -19
  90. package/dist/gpos-table.js +37 -19
  91. package/dist/gsub-table.cjs +40 -25
  92. package/dist/gsub-table.js +40 -25
  93. package/dist/hmtx-table.cjs +5 -3
  94. package/dist/hmtx-table.js +5 -3
  95. package/dist/image/ccitt-encode.cjs +8 -5
  96. package/dist/image/ccitt-encode.js +8 -5
  97. package/dist/image/ccitt.cjs +801 -209
  98. package/dist/image/ccitt.js +801 -209
  99. package/dist/image/jbig2-arith.cjs +340 -306
  100. package/dist/image/jbig2-arith.js +340 -306
  101. package/dist/image/jbig2-bitmap.cjs +8 -5
  102. package/dist/image/jbig2-bitmap.js +8 -5
  103. package/dist/image/jbig2-generic.cjs +240 -69
  104. package/dist/image/jbig2-generic.js +240 -69
  105. package/dist/image/jbig2-text.cjs +4 -2
  106. package/dist/image/jbig2-text.js +4 -2
  107. package/dist/image/jbig2.cjs +69 -31
  108. package/dist/image/jbig2.js +69 -31
  109. package/dist/image/jp2-boxes.cjs +52 -27
  110. package/dist/image/jp2-boxes.js +52 -27
  111. package/dist/image/jpeg-info.cjs +29 -24
  112. package/dist/image/jpeg-info.js +29 -24
  113. package/dist/image/jpeg2000-codestream.cjs +61 -32
  114. package/dist/image/jpeg2000-codestream.js +61 -32
  115. package/dist/image/jpeg2000-dwt.cjs +2 -1
  116. package/dist/image/jpeg2000-dwt.js +2 -1
  117. package/dist/image/jpeg2000-t1.cjs +21 -11
  118. package/dist/image/jpeg2000-t1.js +21 -11
  119. package/dist/image/jpeg2000-t2.cjs +12 -5
  120. package/dist/image/jpeg2000-t2.js +12 -5
  121. package/dist/image/jpeg2000-tagtree.cjs +8 -4
  122. package/dist/image/jpeg2000-tagtree.js +8 -4
  123. package/dist/image/jpeg2000.cjs +11 -6
  124. package/dist/image/jpeg2000.js +11 -6
  125. package/dist/image/png-decode.cjs +62 -39
  126. package/dist/image/png-decode.d.cts +3 -2
  127. package/dist/image/png-decode.d.ts +3 -2
  128. package/dist/image/png-decode.js +62 -39
  129. package/dist/image/png-filter.cjs +23 -15
  130. package/dist/image/png-filter.js +23 -15
  131. package/dist/images-read.cjs +41 -36
  132. package/dist/images-read.d.cts +2 -2
  133. package/dist/images-read.d.ts +2 -2
  134. package/dist/images-read.js +41 -36
  135. package/dist/index.cjs +1 -1
  136. package/dist/index.d.cts +1 -1
  137. package/dist/index.d.ts +1 -1
  138. package/dist/index.js +1 -1
  139. package/dist/interpret.cjs +68 -40
  140. package/dist/interpret.d.cts +1 -1
  141. package/dist/interpret.d.ts +1 -1
  142. package/dist/interpret.js +68 -40
  143. package/dist/lexer.cjs +86 -51
  144. package/dist/lexer.js +86 -51
  145. package/dist/math-content-write.cjs +9 -5
  146. package/dist/math-content-write.js +9 -5
  147. package/dist/math-font-write.cjs +2 -1
  148. package/dist/math-font-write.d.cts +1 -1
  149. package/dist/math-font-write.d.ts +1 -1
  150. package/dist/math-font-write.js +2 -1
  151. package/dist/math-font.cjs +16 -7
  152. package/dist/math-font.js +16 -7
  153. package/dist/math-table.cjs +25 -13
  154. package/dist/math-table.js +25 -13
  155. package/dist/matrix.cjs +3 -2
  156. package/dist/matrix.js +3 -2
  157. package/dist/measure.cjs +1 -1
  158. package/dist/measure.js +1 -1
  159. package/dist/names.cjs +7 -7
  160. package/dist/names.d.cts +2 -2
  161. package/dist/names.d.ts +2 -2
  162. package/dist/names.js +7 -7
  163. package/dist/navigation.cjs +16 -12
  164. package/dist/navigation.d.cts +4 -4
  165. package/dist/navigation.d.ts +4 -4
  166. package/dist/navigation.js +16 -12
  167. package/dist/{objects-B7HdMeWS.d.cts → objects-e2RS3-yT.d.cts} +3 -3
  168. package/dist/{objects-B7HdMeWS.d.ts → objects-e2RS3-yT.d.ts} +3 -3
  169. package/dist/objects.d.cts +1 -1
  170. package/dist/objects.d.ts +1 -1
  171. package/dist/optional-content.d.cts +2 -2
  172. package/dist/optional-content.d.ts +2 -2
  173. package/dist/ot-layout-common.cjs +22 -15
  174. package/dist/ot-layout-common.js +22 -15
  175. package/dist/parse.cjs +7 -5
  176. package/dist/parse.d.cts +1 -1
  177. package/dist/parse.d.ts +1 -1
  178. package/dist/parse.js +7 -5
  179. package/dist/pdf-text.cjs +5 -2
  180. package/dist/pdf-text.js +5 -2
  181. package/dist/predictors.cjs +14 -9
  182. package/dist/predictors.d.cts +1 -1
  183. package/dist/predictors.d.ts +1 -1
  184. package/dist/predictors.js +14 -9
  185. package/dist/raster.cjs +30 -19
  186. package/dist/raster.d.cts +8 -8
  187. package/dist/raster.d.ts +8 -8
  188. package/dist/raster.js +30 -19
  189. package/dist/read.cjs +29 -16
  190. package/dist/read.js +29 -16
  191. package/dist/serialize.cjs +6 -2
  192. package/dist/serialize.d.cts +1 -1
  193. package/dist/serialize.d.ts +1 -1
  194. package/dist/serialize.js +6 -2
  195. package/dist/sfnt-subset.cjs +25 -13
  196. package/dist/sfnt-subset.d.cts +1 -1
  197. package/dist/sfnt-subset.d.ts +1 -1
  198. package/dist/sfnt-subset.js +25 -13
  199. package/dist/sfnt.cjs +20 -10
  200. package/dist/sfnt.js +20 -10
  201. package/dist/structure.d.cts +2 -2
  202. package/dist/structure.d.ts +2 -2
  203. package/dist/text-group.cjs +0 -1
  204. package/dist/text-group.js +0 -1
  205. package/dist/text-layout.d.cts +1 -1
  206. package/dist/text-layout.d.ts +1 -1
  207. package/dist/tounicode.cjs +4 -2
  208. package/dist/tounicode.d.cts +1 -1
  209. package/dist/tounicode.d.ts +1 -1
  210. package/dist/tounicode.js +4 -2
  211. package/dist/winansi.cjs +1 -1
  212. package/dist/winansi.js +1 -1
  213. package/dist/write.cjs +20 -12
  214. package/dist/write.d.cts +1 -1
  215. package/dist/write.d.ts +1 -1
  216. package/dist/write.js +20 -12
  217. package/dist/xref.cjs +5 -2
  218. package/dist/xref.d.cts +1 -1
  219. package/dist/xref.d.ts +1 -1
  220. package/dist/xref.js +5 -2
  221. package/package.json +1 -1
@@ -3,10 +3,14 @@ import { decodeStream } from "./filters.js";
3
3
  import { decodeJpeg2000 } from "./image/jpeg2000.js";
4
4
  import { PNG_MAX_DIMENSION, PNG_MAX_PIXELS, encodePng, readJpegInfo } from "byte-codec";
5
5
  //#region src/images-read.ts
6
+ const CMYK_COMPONENT_COUNT = 4;
7
+ const RGB_CHANNEL_COUNT = 3;
8
+ const MAX_BYTE_VALUE = 255;
9
+ const BITS_PER_BYTE = 8;
6
10
  function componentsOf(cs) {
7
11
  if (cs.kind === "gray") return 1;
8
- if (cs.kind === "cmyk") return 4;
9
- return 3;
12
+ if (cs.kind === "cmyk") return CMYK_COMPONENT_COUNT;
13
+ return RGB_CHANNEL_COUNT;
10
14
  }
11
15
  function resolveColorSpace(csObj, resolver, sink) {
12
16
  const resolved = resolver.resolve(csObj);
@@ -30,7 +34,7 @@ function resolveColorSpace(csObj, resolver, sink) {
30
34
  const streamObj = resolver.resolve(arr[1]);
31
35
  const n = streamObj?.kind === "stream" ? asNumber(dictGet(streamObj.dict, "N")) : void 0;
32
36
  if (n === 1) return { kind: "gray" };
33
- if (n === 4) return { kind: "cmyk" };
37
+ if (n === CMYK_COMPONENT_COUNT) return { kind: "cmyk" };
34
38
  return { kind: "rgb" };
35
39
  }
36
40
  if (family === "Indexed") {
@@ -54,9 +58,9 @@ function resolveColorSpace(csObj, resolver, sink) {
54
58
  };
55
59
  }
56
60
  function unpackSamples(data, width, height, componentsPerPixel, bitsPerComponent) {
57
- if (bitsPerComponent === 8) return Array.from(data.subarray(0, width * height * componentsPerPixel));
61
+ if (bitsPerComponent === BITS_PER_BYTE) return Array.from(data.subarray(0, width * height * componentsPerPixel));
58
62
  const samplesPerRow = width * componentsPerPixel;
59
- const bytesPerRow = Math.ceil(samplesPerRow * bitsPerComponent / 8);
63
+ const bytesPerRow = Math.ceil(samplesPerRow * bitsPerComponent / BITS_PER_BYTE);
60
64
  const out = [];
61
65
  for (let row = 0; row < height; row++) {
62
66
  const rowStart = row * bytesPerRow;
@@ -64,8 +68,8 @@ function unpackSamples(data, width, height, componentsPerPixel, bitsPerComponent
64
68
  for (let s = 0; s < samplesPerRow; s++) {
65
69
  let value = 0;
66
70
  for (let b = 0; b < bitsPerComponent; b++) {
67
- const byteIndex = rowStart + Math.floor(bitPos / 8);
68
- const bitIndex = 7 - bitPos % 8;
71
+ const byteIndex = rowStart + Math.floor(bitPos / BITS_PER_BYTE);
72
+ const bitIndex = 7 - bitPos % BITS_PER_BYTE;
69
73
  const bit = (data[byteIndex] ?? 0) >> bitIndex & 1;
70
74
  value = value << 1 | bit;
71
75
  bitPos++;
@@ -77,13 +81,13 @@ function unpackSamples(data, width, height, componentsPerPixel, bitsPerComponent
77
81
  }
78
82
  function scaleToByte(value, maxValue, inverted) {
79
83
  const v = inverted ? maxValue - value : value;
80
- return maxValue === 255 ? v : Math.round(v * 255 / maxValue);
84
+ return maxValue === MAX_BYTE_VALUE ? v : Math.round(v * MAX_BYTE_VALUE / maxValue);
81
85
  }
82
86
  function cmykToRgbByte(c, m, y, k) {
83
87
  return {
84
- r: Math.round(255 * (1 - c) * (1 - k)),
85
- g: Math.round(255 * (1 - m) * (1 - k)),
86
- b: Math.round(255 * (1 - y) * (1 - k))
88
+ r: Math.round(MAX_BYTE_VALUE * (1 - c) * (1 - k)),
89
+ g: Math.round(MAX_BYTE_VALUE * (1 - m) * (1 - k)),
90
+ b: Math.round(MAX_BYTE_VALUE * (1 - y) * (1 - k))
87
91
  };
88
92
  }
89
93
  function sampleFromPalette(base, lookup, offset) {
@@ -95,7 +99,7 @@ function sampleFromPalette(base, lookup, offset) {
95
99
  b: g
96
100
  };
97
101
  }
98
- if (base.kind === "cmyk") return cmykToRgbByte((lookup[offset] ?? 0) / 255, (lookup[offset + 1] ?? 0) / 255, (lookup[offset + 2] ?? 0) / 255, (lookup[offset + 3] ?? 0) / 255);
102
+ if (base.kind === "cmyk") return cmykToRgbByte((lookup[offset] ?? 0) / MAX_BYTE_VALUE, (lookup[offset + 1] ?? 0) / MAX_BYTE_VALUE, (lookup[offset + 2] ?? 0) / MAX_BYTE_VALUE, (lookup[offset + 3] ?? 0) / MAX_BYTE_VALUE);
99
103
  return {
100
104
  r: lookup[offset] ?? 0,
101
105
  g: lookup[offset + 1] ?? 0,
@@ -107,7 +111,7 @@ function buildRawImage(data, width, height, bitsPerComponent, colorSpace, invert
107
111
  if (colorSpace.kind === "indexed") {
108
112
  const indices = unpackSamples(data, width, height, 1, bitsPerComponent);
109
113
  const baseComponents = componentsOf(colorSpace.base);
110
- const out = new Uint8Array(width * height * (colorSpace.base.kind === "gray" ? 1 : 3));
114
+ const out = new Uint8Array(width * height * (colorSpace.base.kind === "gray" ? 1 : RGB_CHANNEL_COUNT));
111
115
  let outIdx = 0;
112
116
  for (const index of indices) {
113
117
  const rgb = sampleFromPalette(colorSpace.base, colorSpace.lookup, index * baseComponents);
@@ -121,7 +125,7 @@ function buildRawImage(data, width, height, bitsPerComponent, colorSpace, invert
121
125
  return {
122
126
  width,
123
127
  height,
124
- channels: colorSpace.base.kind === "gray" ? 1 : 3,
128
+ channels: colorSpace.base.kind === "gray" ? 1 : RGB_CHANNEL_COUNT,
125
129
  data: out
126
130
  };
127
131
  }
@@ -135,26 +139,27 @@ function buildRawImage(data, width, height, bitsPerComponent, colorSpace, invert
135
139
  };
136
140
  }
137
141
  if (colorSpace.kind === "rgb") {
138
- const samples = unpackSamples(data, width, height, 3, bitsPerComponent);
142
+ const samples = unpackSamples(data, width, height, RGB_CHANNEL_COUNT, bitsPerComponent);
143
+ const out = Uint8Array.from(samples, (v) => scaleToByte(v, maxValue, inverted));
139
144
  return {
140
145
  width,
141
146
  height,
142
- channels: 3,
143
- data: Uint8Array.from(samples, (v) => scaleToByte(v, maxValue, inverted))
147
+ channels: RGB_CHANNEL_COUNT,
148
+ data: out
144
149
  };
145
150
  }
146
- const samples = unpackSamples(data, width, height, 4, bitsPerComponent);
147
- const out = new Uint8Array(width * height * 3);
151
+ const samples = unpackSamples(data, width, height, CMYK_COMPONENT_COUNT, bitsPerComponent);
152
+ const out = new Uint8Array(width * height * RGB_CHANNEL_COUNT);
148
153
  for (let px = 0; px < width * height; px++) {
149
- const rgb = cmykToRgbByte(scaleToByte(samples[px * 4] ?? 0, maxValue, inverted) / 255, scaleToByte(samples[px * 4 + 1] ?? 0, maxValue, inverted) / 255, scaleToByte(samples[px * 4 + 2] ?? 0, maxValue, inverted) / 255, scaleToByte(samples[px * 4 + 3] ?? 0, maxValue, inverted) / 255);
150
- out[px * 3] = rgb.r;
151
- out[px * 3 + 1] = rgb.g;
152
- out[px * 3 + 2] = rgb.b;
154
+ const rgb = cmykToRgbByte(scaleToByte(samples[px * CMYK_COMPONENT_COUNT] ?? 0, maxValue, inverted) / MAX_BYTE_VALUE, scaleToByte(samples[px * CMYK_COMPONENT_COUNT + 1] ?? 0, maxValue, inverted) / MAX_BYTE_VALUE, scaleToByte(samples[px * CMYK_COMPONENT_COUNT + 2] ?? 0, maxValue, inverted) / MAX_BYTE_VALUE, scaleToByte(samples[px * CMYK_COMPONENT_COUNT + 3] ?? 0, maxValue, inverted) / MAX_BYTE_VALUE);
155
+ out[px * RGB_CHANNEL_COUNT] = rgb.r;
156
+ out[px * RGB_CHANNEL_COUNT + 1] = rgb.g;
157
+ out[px * RGB_CHANNEL_COUNT + 2] = rgb.b;
153
158
  }
154
159
  return {
155
160
  width,
156
161
  height,
157
- channels: 3,
162
+ channels: RGB_CHANNEL_COUNT,
158
163
  data: out
159
164
  };
160
165
  }
@@ -165,8 +170,8 @@ function readSoftMaskAlpha(dict, width, height, resolver, sink) {
165
170
  if (decoded.remainingFilter !== void 0) return;
166
171
  const smaskWidth = asNumber(dictGet(smaskObj.dict, "Width")) ?? width;
167
172
  const smaskHeight = asNumber(dictGet(smaskObj.dict, "Height")) ?? height;
168
- const smaskBpc = asNumber(dictGet(smaskObj.dict, "BitsPerComponent")) ?? 8;
169
- if (smaskWidth !== width || smaskHeight !== height || smaskBpc !== 8) return;
173
+ const smaskBpc = asNumber(dictGet(smaskObj.dict, "BitsPerComponent")) ?? BITS_PER_BYTE;
174
+ if (smaskWidth !== width || smaskHeight !== height || smaskBpc !== BITS_PER_BYTE) return;
170
175
  return decoded.bytes.subarray(0, width * height);
171
176
  }
172
177
  function jpeg2000ChannelKind(image, dict, resolver, sink) {
@@ -178,7 +183,7 @@ function jpeg2000ChannelKind(image, dict, resolver, sink) {
178
183
  if (image.colourSpace === "greyscale") return "gray";
179
184
  if (image.colourSpace === "cmyk") return "cmyk";
180
185
  if (image.colourSpace === "srgb" || image.colourSpace === "sycc" || image.colourSpace === "e-srgb" || image.colourSpace === "rommrgb") return "rgb";
181
- return image.components.length >= 4 ? "cmyk" : image.components.length >= 3 ? "rgb" : "gray";
186
+ return image.components.length >= CMYK_COMPONENT_COUNT ? "cmyk" : image.components.length >= RGB_CHANNEL_COUNT ? "rgb" : "gray";
182
187
  }
183
188
  function readJpeg2000Image(dict, raw, resolver, sink) {
184
189
  let image;
@@ -204,7 +209,7 @@ function readJpeg2000Image(dict, raw, resolver, sink) {
204
209
  return;
205
210
  }
206
211
  const kind = jpeg2000ChannelKind(image, dict, resolver, sink);
207
- const required = kind === "cmyk" ? 4 : kind === "rgb" ? 3 : 1;
212
+ const required = kind === "cmyk" ? CMYK_COMPONENT_COUNT : kind === "rgb" ? RGB_CHANNEL_COUNT : 1;
208
213
  if (image.components.length < required) {
209
214
  sink({
210
215
  code: "image/jpx-undecodable",
@@ -219,15 +224,15 @@ function readJpeg2000Image(dict, raw, resolver, sink) {
219
224
  message: `JPXDecode image carries ${String(image.components.length)} components where its colour space needs ${String(required)}; the extra channel(s) are ignored`
220
225
  });
221
226
  const maximum = (1 << image.bitDepth) - 1;
222
- const scale = (value) => image.bitDepth === 8 ? value : Math.round(value * 255 / maximum);
227
+ const scale = (value) => image.bitDepth === BITS_PER_BYTE ? value : Math.round(value * MAX_BYTE_VALUE / maximum);
223
228
  const pixels = image.width * image.height;
224
- const channels = kind === "gray" ? 1 : 3;
229
+ const channels = kind === "gray" ? 1 : RGB_CHANNEL_COUNT;
225
230
  const data = new Uint8Array(pixels * channels);
226
231
  if (kind === "cmyk") for (let i = 0; i < pixels; i++) {
227
- const rgb = cmykToRgbByte(scale(image.components[0]?.[i] ?? 0) / 255, scale(image.components[1]?.[i] ?? 0) / 255, scale(image.components[2]?.[i] ?? 0) / 255, scale(image.components[3]?.[i] ?? 0) / 255);
228
- data[i * 3] = rgb.r;
229
- data[i * 3 + 1] = rgb.g;
230
- data[i * 3 + 2] = rgb.b;
232
+ const rgb = cmykToRgbByte(scale(image.components[0]?.[i] ?? 0) / MAX_BYTE_VALUE, scale(image.components[1]?.[i] ?? 0) / MAX_BYTE_VALUE, scale(image.components[2]?.[i] ?? 0) / MAX_BYTE_VALUE, scale(image.components[3]?.[i] ?? 0) / MAX_BYTE_VALUE);
233
+ data[i * RGB_CHANNEL_COUNT] = rgb.r;
234
+ data[i * RGB_CHANNEL_COUNT + 1] = rgb.g;
235
+ data[i * RGB_CHANNEL_COUNT + 2] = rgb.b;
231
236
  }
232
237
  else for (let channel = 0; channel < channels; channel++) {
233
238
  const plane = image.components[channel];
@@ -301,8 +306,8 @@ function readImageXObject(dict, raw, resolver, sink) {
301
306
  });
302
307
  return;
303
308
  }
304
- const bitsPerComponent = asNumber(dictGet(dict, "BitsPerComponent") ?? dictGet(dict, "BPC")) ?? 8;
305
- if (bitsPerComponent !== 1 && bitsPerComponent !== 2 && bitsPerComponent !== 4 && bitsPerComponent !== 8) {
309
+ const bitsPerComponent = asNumber(dictGet(dict, "BitsPerComponent") ?? dictGet(dict, "BPC")) ?? BITS_PER_BYTE;
310
+ if (bitsPerComponent !== 1 && bitsPerComponent !== 2 && bitsPerComponent !== 4 && bitsPerComponent !== BITS_PER_BYTE) {
306
311
  sink({
307
312
  code: "image/unsupported-bit-depth",
308
313
  severity: "warning",
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_afm_widths = require("./afm-widths-BYiX2L9D.cjs");
2
+ const require_afm_widths = require("./afm-widths-BHD2HZIL.cjs");
3
3
  const require_image_ccitt = require("./image/ccitt.cjs");
4
4
  const require_image_jbig2_errors = require("./image/jbig2-errors.cjs");
5
5
  const require_image_jbig2 = require("./image/jbig2.cjs");
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@ import { NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnost
3
3
  import { LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema } from "./layout.cjs";
4
4
  import { t as GlyphInkBounds } from "./glyph-bounds-BV_Z40KS.cjs";
5
5
  import { PdfBytesSchema, pdfCodec } from "./codec.cjs";
6
- import { n as EmbeddedFaceMetrics, r as EmbeddedFaceSubstitution, t as EmbeddedFace } from "./embedded-font-CEf-zBCA.cjs";
6
+ import { n as EmbeddedFaceMetrics, r as EmbeddedFaceSubstitution, t as EmbeddedFace } from "./embedded-font-DgVBedw6.cjs";
7
7
  import { WinAnsiSubstitution } from "./winansi.cjs";
8
8
  import { PdfEncryptionError, PdfEncryptionOptions, PdfEncryptionPermissions, PdfEncryptionScheme } from "./encrypt-write.cjs";
9
9
  import { FontFace, FontFaceParseError, readFontFace } from "./font-face.cjs";
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnost
3
3
  import { LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema } from "./layout.js";
4
4
  import { t as GlyphInkBounds } from "./glyph-bounds-BV_Z40KS.js";
5
5
  import { PdfBytesSchema, pdfCodec } from "./codec.js";
6
- import { n as EmbeddedFaceMetrics, r as EmbeddedFaceSubstitution, t as EmbeddedFace } from "./embedded-font-Bnhh4juV.js";
6
+ import { n as EmbeddedFaceMetrics, r as EmbeddedFaceSubstitution, t as EmbeddedFace } from "./embedded-font-ByD7ZiQS.js";
7
7
  import { WinAnsiSubstitution } from "./winansi.js";
8
8
  import { PdfEncryptionError, PdfEncryptionOptions, PdfEncryptionPermissions, PdfEncryptionScheme } from "./encrypt-write.js";
9
9
  import { FontFace, FontFaceParseError, readFontFace } from "./font-face.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as STANDARD_METRICS } from "./afm-widths-blUDDjlI.js";
1
+ import { t as STANDARD_METRICS } from "./afm-widths-B_IGbGky.js";
2
2
  import { decodeCcittFax } from "./image/ccitt.js";
3
3
  import { Jbig2ParseError, Jbig2UnsupportedError } from "./image/jbig2-errors.js";
4
4
  import { decodeJbig2Embedded } from "./image/jbig2.js";
@@ -8,6 +8,8 @@ let document_schema_js = require("document-schema.js");
8
8
  //#region src/interpret.ts
9
9
  const MAX_FORM_XOBJECT_DEPTH = 12;
10
10
  const FALLBACK_GLYPH_WIDTH_PER_1000 = 500;
11
+ const GLYPH_SPACE_PER_TEXT_SPACE_UNIT = 1e3;
12
+ const ASCII_SPACE = 32;
11
13
  const DEFAULT_LINE_WIDTH_PT = 1;
12
14
  function initialTextParameters() {
13
15
  return {
@@ -72,31 +74,37 @@ function rgbColor(operands) {
72
74
  b: numAt(operands, 2)
73
75
  };
74
76
  }
77
+ const CMYK_K_INDEX = 3;
75
78
  function cmykColor(operands) {
76
79
  const c = numAt(operands, 0);
77
80
  const m = numAt(operands, 1);
78
81
  const y = numAt(operands, 2);
79
- const k = numAt(operands, 3);
82
+ const k = numAt(operands, CMYK_K_INDEX);
80
83
  return {
81
84
  r: (1 - c) * (1 - k),
82
85
  g: (1 - m) * (1 - k),
83
86
  b: (1 - y) * (1 - k)
84
87
  };
85
88
  }
89
+ const RGB_COMPONENT_COUNT = 3;
90
+ const CMYK_COMPONENT_COUNT = 4;
86
91
  function genericColor(operands) {
87
92
  const numericOperands = operands.filter((o) => o.kind === "number");
88
93
  if (numericOperands.length === 1) return grayColor(numAt(numericOperands, 0));
89
- if (numericOperands.length === 3) return rgbColor(numericOperands);
90
- if (numericOperands.length === 4) return cmykColor(numericOperands);
94
+ if (numericOperands.length === RGB_COMPONENT_COUNT) return rgbColor(numericOperands);
95
+ if (numericOperands.length === CMYK_COMPONENT_COUNT) return cmykColor(numericOperands);
91
96
  }
97
+ const MATRIX_D_INDEX = 3;
98
+ const MATRIX_E_INDEX = 4;
99
+ const MATRIX_F_INDEX = 5;
92
100
  function matrixFromOperands(operands) {
93
101
  return [
94
102
  numAt(operands, 0),
95
103
  numAt(operands, 1),
96
104
  numAt(operands, 2),
97
- numAt(operands, 3),
98
- numAt(operands, 4),
99
- numAt(operands, 5)
105
+ numAt(operands, MATRIX_D_INDEX),
106
+ numAt(operands, MATRIX_E_INDEX),
107
+ numAt(operands, MATRIX_F_INDEX)
100
108
  ];
101
109
  }
102
110
  const SHAPE_ABS_TOLERANCE_PT = .001;
@@ -140,9 +148,10 @@ function closedPolygonCorners(subpath) {
140
148
  if (nearlyEqualPoints(first, last, shapeTolerance(Math.max(bounds.maxX - bounds.minX, bounds.maxY - bounds.minY)))) corners.pop();
141
149
  return corners;
142
150
  }
151
+ const RECTANGLE_CORNER_COUNT = 4;
143
152
  function detectRect(subpath, paint) {
144
153
  const corners = closedPolygonCorners(subpath);
145
- if (corners?.length !== 4) return;
154
+ if (corners?.length !== RECTANGLE_CORNER_COUNT) return;
146
155
  const { minX, minY, maxX, maxY } = boundsOf(corners);
147
156
  const widthPt = maxX - minX;
148
157
  const heightPt = maxY - minY;
@@ -190,9 +199,10 @@ function expectedEllipseControl(atExtreme, atExtremeKind, otherEnd, center, kx,
190
199
  y: atExtreme.y
191
200
  };
192
201
  }
202
+ const ELLIPSE_SEGMENT_COUNT = 4;
193
203
  function detectEllipse(subpath, paint) {
194
204
  const segments = subpath.segments;
195
- if (!subpath.closed || segments.length !== 4 || segments.some((segment) => segment.kind !== "cubic")) return;
205
+ if (!subpath.closed || segments.length !== ELLIPSE_SEGMENT_COUNT || segments.some((segment) => segment.kind !== "cubic")) return;
196
206
  const start = {
197
207
  x: subpath.startXPt,
198
208
  y: subpath.startYPt
@@ -218,16 +228,16 @@ function detectEllipse(subpath, paint) {
218
228
  y: finalSegment.yPt
219
229
  }, start, Math.max(tolX, tolY))) return;
220
230
  const extremes = onCurve.map((point) => cardinalExtremeOf(point, center, rx, ry, tolX, tolY));
221
- if (extremes.some((extreme) => extreme === void 0) || new Set(extremes).size !== 4) return;
231
+ if (extremes.some((extreme) => extreme === void 0) || new Set(extremes).size !== ELLIPSE_SEGMENT_COUNT) return;
222
232
  const kx = rx * require_matrix.BEZIER_KAPPA;
223
233
  const ky = ry * require_matrix.BEZIER_KAPPA;
224
234
  const controlTolerance = Math.max(tolX, tolY);
225
- for (let i = 0; i < 4; i += 1) {
235
+ for (let i = 0; i < ELLIPSE_SEGMENT_COUNT; i += 1) {
226
236
  const segment = segments[i];
227
237
  const from = onCurve[i];
228
238
  const fromKind = extremes[i];
229
- const to = onCurve[(i + 1) % 4];
230
- const toKind = extremes[(i + 1) % 4];
239
+ const to = onCurve[(i + 1) % ELLIPSE_SEGMENT_COUNT];
240
+ const toKind = extremes[(i + 1) % ELLIPSE_SEGMENT_COUNT];
231
241
  if (segment?.kind !== "cubic" || from === void 0 || to === void 0 || fromKind === void 0 || toKind === void 0) return;
232
242
  const expectedC1 = expectedEllipseControl(from, fromKind, to, center, kx, ky);
233
243
  const expectedC2 = expectedEllipseControl(to, toKind, from, center, kx, ky);
@@ -274,17 +284,38 @@ function classifyShape(subpaths, paint, style) {
274
284
  if (subpaths.length !== 1 || subpath === void 0) return;
275
285
  return detectRect(subpath, paint) ?? detectEllipse(subpath, paint) ?? detectLine(subpath, paint, style);
276
286
  }
287
+ var MarkedContentStack = class {
288
+ #frames;
289
+ constructor(seed = []) {
290
+ this.#frames = [...seed];
291
+ }
292
+ open(frame) {
293
+ this.#frames.push(frame);
294
+ }
295
+ close() {
296
+ this.#frames.pop();
297
+ }
298
+ inScope(key) {
299
+ for (let i = this.#frames.length - 1; i >= 0; i--) {
300
+ const frame = this.#frames[i];
301
+ if (frame !== void 0 && key in frame) return frame[key];
302
+ }
303
+ }
304
+ };
305
+ const RE_HEIGHT_INDEX = 3;
306
+ const OPERAND_INDEX_3 = 3;
307
+ const OPERAND_INDEX_4 = 4;
308
+ const OPERAND_INDEX_5 = 5;
309
+ const TZ_PERCENT_DIVISOR = 100;
277
310
  function interpretContentStream(bytes, resources, context) {
278
- const items = [];
279
- runContentStream(bytes, resources, {
311
+ return runContentStream(bytes, resources, {
280
312
  ctm: require_matrix.IDENTITY_MATRIX,
281
313
  fillColor: document_schema_js.COLOR_BLACK,
282
314
  strokeColor: document_schema_js.COLOR_BLACK,
283
315
  lineWidth: DEFAULT_LINE_WIDTH_PT,
284
316
  dashArray: [],
285
317
  ...initialTextParameters()
286
- }, context, items, 0, []);
287
- return items;
318
+ }, context, 0, new MarkedContentStack());
288
319
  }
289
320
  function lastPointOf(subpath) {
290
321
  const last = subpath.segments[subpath.segments.length - 1];
@@ -296,19 +327,15 @@ function lastPointOf(subpath) {
296
327
  y: last.yPt
297
328
  };
298
329
  }
299
- function runContentStream(bytes, resources, initialState, context, items, depth, markedContent) {
330
+ function runContentStream(bytes, resources, initialState, context, depth, markedContent) {
331
+ const items = [];
300
332
  const operations = require_content_read.readContentStream(bytes, context.sink);
301
333
  const gsStack = [];
302
334
  let gs = initialState;
303
335
  let text = defaultTextObjectState();
304
336
  let pathSubpaths = [];
305
337
  let currentSubpath;
306
- const inScope = (key) => {
307
- for (let i = markedContent.length - 1; i >= 0; i--) {
308
- const frame = markedContent[i];
309
- if (frame !== void 0 && key in frame) return frame[key];
310
- }
311
- };
338
+ const inScope = (key) => markedContent.inScope(key);
312
339
  const pushItem = (item) => {
313
340
  if (item.kind === "text") {
314
341
  const layer = item.layerName ?? inScope("layerName");
@@ -350,7 +377,7 @@ function runContentStream(bytes, resources, initialState, context, items, depth,
350
377
  const x = numAt(operands, 0);
351
378
  const y = numAt(operands, 1);
352
379
  const w = numAt(operands, 2);
353
- const h = numAt(operands, 3);
380
+ const h = numAt(operands, RE_HEIGHT_INDEX);
354
381
  const p1 = require_matrix.applyMatrix(ctm, {
355
382
  x,
356
383
  y
@@ -432,10 +459,10 @@ function runContentStream(bytes, resources, initialState, context, items, depth,
432
459
  });
433
460
  const widthPer1000 = glyph?.widthPer1000 ?? FALLBACK_GLYPH_WIDTH_PER_1000;
434
461
  const byteLength = glyph?.byteLengthConsumed ?? 1;
435
- const isSingleByteSpace = byteLength === 1 && codes[offset] === 32;
462
+ const isSingleByteSpace = byteLength === 1 && codes[offset] === ASCII_SPACE;
436
463
  const spacing = gs.charSpace + (isSingleByteSpace ? gs.wordSpace : 0);
437
464
  const vertical = glyph?.vertical;
438
- text.tm = vertical === void 0 ? require_matrix.multiplyMatrices(require_matrix.translationMatrix((widthPer1000 / 1e3 * gs.fontSizePt + spacing) * gs.horizScale, 0), text.tm) : require_matrix.multiplyMatrices(require_matrix.translationMatrix(0, vertical.displacementPer1000 / 1e3 * gs.fontSizePt + spacing), text.tm);
465
+ text.tm = vertical === void 0 ? require_matrix.multiplyMatrices(require_matrix.translationMatrix((widthPer1000 / GLYPH_SPACE_PER_TEXT_SPACE_UNIT * gs.fontSizePt + spacing) * gs.horizScale, 0), text.tm) : require_matrix.multiplyMatrices(require_matrix.translationMatrix(0, vertical.displacementPer1000 / GLYPH_SPACE_PER_TEXT_SPACE_UNIT * gs.fontSizePt + spacing), text.tm);
439
466
  offset += byteLength;
440
467
  }
441
468
  };
@@ -445,8 +472,8 @@ function runContentStream(bytes, resources, initialState, context, items, depth,
445
472
  const vertical = context.fontMetrics.glyphAdvance(fontResourceName, resources, codes, 0)?.vertical;
446
473
  if (vertical === void 0) return;
447
474
  return {
448
- x: vertical.positionXPer1000 / 1e3,
449
- y: vertical.positionYPer1000 / 1e3
475
+ x: vertical.positionXPer1000 / GLYPH_SPACE_PER_TEXT_SPACE_UNIT,
476
+ y: vertical.positionYPer1000 / GLYPH_SPACE_PER_TEXT_SPACE_UNIT
450
477
  };
451
478
  };
452
479
  const showTextArray = (elements) => {
@@ -463,7 +490,7 @@ function runContentStream(bytes, resources, initialState, context, items, depth,
463
490
  totalLength += el.bytes.length;
464
491
  advanceThroughString(el.bytes);
465
492
  } else if (el.kind === "number") {
466
- const adjustment = -(el.value / 1e3) * gs.fontSizePt;
493
+ const adjustment = -(el.value / GLYPH_SPACE_PER_TEXT_SPACE_UNIT) * gs.fontSizePt;
467
494
  text.tm = require_matrix.multiplyMatrices(vertical ? require_matrix.translationMatrix(0, adjustment) : require_matrix.translationMatrix(adjustment * gs.horizScale, 0), text.tm);
468
495
  }
469
496
  if (totalLength === 0) return;
@@ -541,10 +568,10 @@ function runContentStream(bytes, resources, initialState, context, items, depth,
541
568
  };
542
569
  const formLayer = ownLayer ?? inScope("layerName");
543
570
  const formMcid = require_objects.dictGet(xobj.dict, "StructParents") !== void 0 ? void 0 : inScope("mcid");
544
- runContentStream(decoded.bytes, formResources, formState, context, items, depth + 1, [{
571
+ for (const formItem of runContentStream(decoded.bytes, formResources, formState, context, depth + 1, new MarkedContentStack([{
545
572
  ...formLayer !== void 0 ? { layerName: formLayer } : {},
546
573
  ...formMcid !== void 0 ? { mcid: formMcid } : {}
547
- }]);
574
+ }]))) items.push(formItem);
548
575
  }
549
576
  };
550
577
  for (const token of operations) {
@@ -661,11 +688,11 @@ function runContentStream(bytes, resources, initialState, context, items, depth,
661
688
  });
662
689
  const c2 = require_matrix.applyMatrix(gs.ctm, {
663
690
  x: numAt(operands, 2),
664
- y: numAt(operands, 3)
691
+ y: numAt(operands, OPERAND_INDEX_3)
665
692
  });
666
693
  const p = require_matrix.applyMatrix(gs.ctm, {
667
- x: numAt(operands, 4),
668
- y: numAt(operands, 5)
694
+ x: numAt(operands, OPERAND_INDEX_4),
695
+ y: numAt(operands, OPERAND_INDEX_5)
669
696
  });
670
697
  currentSubpath?.segments.push({
671
698
  kind: "cubic",
@@ -687,7 +714,7 @@ function runContentStream(bytes, resources, initialState, context, items, depth,
687
714
  });
688
715
  const p = require_matrix.applyMatrix(gs.ctm, {
689
716
  x: numAt(operands, 2),
690
- y: numAt(operands, 3)
717
+ y: numAt(operands, OPERAND_INDEX_3)
691
718
  });
692
719
  currentSubpath.segments.push({
693
720
  kind: "cubic",
@@ -707,7 +734,7 @@ function runContentStream(bytes, resources, initialState, context, items, depth,
707
734
  });
708
735
  const p = require_matrix.applyMatrix(gs.ctm, {
709
736
  x: numAt(operands, 2),
710
- y: numAt(operands, 3)
737
+ y: numAt(operands, OPERAND_INDEX_3)
711
738
  });
712
739
  currentSubpath?.segments.push({
713
740
  kind: "cubic",
@@ -772,7 +799,7 @@ function runContentStream(bytes, resources, initialState, context, items, depth,
772
799
  case "Tz":
773
800
  gs = {
774
801
  ...gs,
775
- horizScale: numAt(operands, 0) / 100
802
+ horizScale: numAt(operands, 0) / TZ_PERCENT_DIVISOR
776
803
  };
777
804
  break;
778
805
  case "TL":
@@ -843,18 +870,19 @@ function runContentStream(bytes, resources, initialState, context, items, depth,
843
870
  ...layerName !== void 0 ? { layerName } : {},
844
871
  ...markedContentScopeProps(props)
845
872
  };
846
- markedContent.push(depth === 0 ? scopeProps : {
873
+ markedContent.open(depth === 0 ? scopeProps : {
847
874
  ...scopeProps,
848
875
  mcid: void 0
849
876
  });
850
877
  break;
851
878
  }
852
879
  case "BMC":
853
- markedContent.push({});
880
+ markedContent.open({});
854
881
  break;
855
- case "EMC": markedContent.pop();
882
+ case "EMC": markedContent.close();
856
883
  }
857
884
  }
885
+ return items;
858
886
  }
859
887
  //#endregion
860
888
  exports.interpretContentStream = interpretContentStream;
@@ -1,6 +1,6 @@
1
1
  import { PdfDiagnosticSink } from "./diagnostics.cjs";
2
2
  import { r as Matrix } from "./matrix-B7_SBKQ5.cjs";
3
- import { n as PdfDict, r as PdfObject } from "./objects-B7HdMeWS.cjs";
3
+ import { n as PdfDict, r as PdfObject } from "./objects-e2RS3-yT.cjs";
4
4
  import { Color, ContentStrokeStyle } from "document-schema.js";
5
5
  //#region src/interpret.d.ts
6
6
  interface ExtractedTextRun {
@@ -1,6 +1,6 @@
1
1
  import { PdfDiagnosticSink } from "./diagnostics.js";
2
2
  import { r as Matrix } from "./matrix-B7_SBKQ5.js";
3
- import { n as PdfDict, r as PdfObject } from "./objects-B7HdMeWS.js";
3
+ import { n as PdfDict, r as PdfObject } from "./objects-e2RS3-yT.js";
4
4
  import { Color, ContentStrokeStyle } from "document-schema.js";
5
5
  //#region src/interpret.d.ts
6
6
  interface ExtractedTextRun {