pdf-parser.js 5.2.26 → 5.2.27

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 (95) hide show
  1. package/dist/annotations.d.cts +2 -2
  2. package/dist/annotations.d.ts +2 -2
  3. package/dist/attachments.d.cts +2 -2
  4. package/dist/attachments.d.ts +2 -2
  5. package/dist/cff-bounds.cjs +31 -21
  6. package/dist/cff-bounds.js +31 -21
  7. package/dist/content-read.d.cts +1 -1
  8. package/dist/content-read.d.ts +1 -1
  9. package/dist/content-write.cjs +18 -12
  10. package/dist/content-write.d.cts +2 -2
  11. package/dist/content-write.d.ts +2 -2
  12. package/dist/content-write.js +18 -12
  13. package/dist/document.cjs +17 -11
  14. package/dist/document.d.cts +1 -1
  15. package/dist/document.d.ts +1 -1
  16. package/dist/document.js +17 -11
  17. package/dist/{embedded-font-Bnhh4juV.d.ts → embedded-font-ByD7ZiQS.d.ts} +1 -1
  18. package/dist/{embedded-font-CEf-zBCA.d.cts → embedded-font-DgVBedw6.d.cts} +1 -1
  19. package/dist/embedded-font-write.d.cts +2 -2
  20. package/dist/embedded-font-write.d.ts +2 -2
  21. package/dist/embedded-font.d.cts +1 -1
  22. package/dist/embedded-font.d.ts +1 -1
  23. package/dist/encrypt-write.d.cts +1 -1
  24. package/dist/encrypt-write.d.ts +1 -1
  25. package/dist/encrypt.d.cts +1 -1
  26. package/dist/encrypt.d.ts +1 -1
  27. package/dist/filters.cjs +6 -6
  28. package/dist/filters.d.cts +1 -1
  29. package/dist/filters.d.ts +1 -1
  30. package/dist/filters.js +6 -6
  31. package/dist/font-read.d.cts +1 -1
  32. package/dist/font-read.d.ts +1 -1
  33. package/dist/font-registry.d.cts +3 -3
  34. package/dist/font-registry.d.ts +3 -3
  35. package/dist/form.cjs +13 -8
  36. package/dist/form.d.cts +2 -2
  37. package/dist/form.d.ts +2 -2
  38. package/dist/form.js +13 -8
  39. package/dist/{glyf-contours-C0epBNqP.d.ts → glyf-contours-B1PsI9oA.d.ts} +1 -1
  40. package/dist/{glyf-contours-BRpvd0rt.d.cts → glyf-contours-NHBpgks-.d.cts} +1 -1
  41. package/dist/glyf-contours.d.cts +1 -1
  42. package/dist/glyf-contours.d.ts +1 -1
  43. package/dist/gsub-table.cjs +12 -8
  44. package/dist/gsub-table.js +12 -8
  45. package/dist/image/jpeg2000-codestream.cjs +17 -8
  46. package/dist/image/jpeg2000-codestream.js +17 -8
  47. package/dist/images-read.d.cts +2 -2
  48. package/dist/images-read.d.ts +2 -2
  49. package/dist/index.d.cts +1 -1
  50. package/dist/index.d.ts +1 -1
  51. package/dist/interpret.cjs +29 -16
  52. package/dist/interpret.d.cts +1 -1
  53. package/dist/interpret.d.ts +1 -1
  54. package/dist/interpret.js +29 -16
  55. package/dist/math-font-write.d.cts +1 -1
  56. package/dist/math-font-write.d.ts +1 -1
  57. package/dist/names.cjs +7 -7
  58. package/dist/names.d.cts +2 -2
  59. package/dist/names.d.ts +2 -2
  60. package/dist/names.js +7 -7
  61. package/dist/navigation.cjs +6 -7
  62. package/dist/navigation.d.cts +4 -4
  63. package/dist/navigation.d.ts +4 -4
  64. package/dist/navigation.js +6 -7
  65. package/dist/{objects-B7HdMeWS.d.cts → objects-e2RS3-yT.d.cts} +3 -3
  66. package/dist/{objects-B7HdMeWS.d.ts → objects-e2RS3-yT.d.ts} +3 -3
  67. package/dist/objects.d.cts +1 -1
  68. package/dist/objects.d.ts +1 -1
  69. package/dist/optional-content.d.cts +2 -2
  70. package/dist/optional-content.d.ts +2 -2
  71. package/dist/ot-layout-common.cjs +18 -13
  72. package/dist/ot-layout-common.js +18 -13
  73. package/dist/parse.d.cts +1 -1
  74. package/dist/parse.d.ts +1 -1
  75. package/dist/predictors.d.cts +1 -1
  76. package/dist/predictors.d.ts +1 -1
  77. package/dist/raster.d.cts +8 -8
  78. package/dist/raster.d.ts +8 -8
  79. package/dist/read.cjs +12 -8
  80. package/dist/read.js +12 -8
  81. package/dist/serialize.d.cts +1 -1
  82. package/dist/serialize.d.ts +1 -1
  83. package/dist/sfnt-subset.d.cts +1 -1
  84. package/dist/sfnt-subset.d.ts +1 -1
  85. package/dist/structure.d.cts +2 -2
  86. package/dist/structure.d.ts +2 -2
  87. package/dist/text-layout.d.cts +1 -1
  88. package/dist/text-layout.d.ts +1 -1
  89. package/dist/tounicode.d.cts +1 -1
  90. package/dist/tounicode.d.ts +1 -1
  91. package/dist/write.d.cts +1 -1
  92. package/dist/write.d.ts +1 -1
  93. package/dist/xref.d.cts +1 -1
  94. package/dist/xref.d.ts +1 -1
  95. package/package.json +1 -1
@@ -11,21 +11,18 @@ function findRange(ranges, glyphId) {
11
11
  else return range;
12
12
  }
13
13
  }
14
- function pushGlyph(ranges, glyphId, value, valueStep) {
14
+ function placeGlyph(ranges, glyphId, value, valueStep) {
15
15
  const previous = ranges[ranges.length - 1];
16
- if (previous !== void 0 && glyphId === previous.endGlyphId + 1 && value === previous.value + (previous.endGlyphId - previous.startGlyphId + 1) * valueStep) {
17
- ranges[ranges.length - 1] = {
18
- startGlyphId: previous.startGlyphId,
19
- endGlyphId: glyphId,
20
- value: previous.value
21
- };
22
- return;
23
- }
24
- ranges.push({
16
+ if (previous !== void 0 && glyphId === previous.endGlyphId + 1 && value === previous.value + (previous.endGlyphId - previous.startGlyphId + 1) * valueStep) return { extended: {
17
+ startGlyphId: previous.startGlyphId,
18
+ endGlyphId: glyphId,
19
+ value: previous.value
20
+ } };
21
+ return { fresh: {
25
22
  startGlyphId: glyphId,
26
23
  endGlyphId: glyphId,
27
24
  value
28
- });
25
+ } };
29
26
  }
30
27
  const RANGE_RECORD_SIZE = 6;
31
28
  function parseRangeRecords(bytes, recordsOffset, recordCount) {
@@ -55,7 +52,11 @@ function parseCoverage(bytes, coverageOffset) {
55
52
  const glyphArrayOffset = coverageOffset + COVERAGE_HEADER_SIZE;
56
53
  if (!hasBytes(bytes, glyphArrayOffset, count * 2)) return;
57
54
  ranges = [];
58
- for (let i = 0; i < count; i++) pushGlyph(ranges, u16(bytes, glyphArrayOffset + i * 2), i, 1);
55
+ for (let i = 0; i < count; i++) {
56
+ const placement = placeGlyph(ranges, u16(bytes, glyphArrayOffset + i * 2), i, 1);
57
+ if (placement.extended !== void 0) ranges[ranges.length - 1] = placement.extended;
58
+ else ranges.push(placement.fresh);
59
+ }
59
60
  ranges.sort((a, b) => a.startGlyphId - b.startGlyphId);
60
61
  } else if (format === 2) ranges = parseRangeRecords(bytes, coverageOffset + COVERAGE_HEADER_SIZE, count);
61
62
  if (ranges === void 0) return;
@@ -83,7 +84,11 @@ function parseClassDef(bytes, classDefOffset) {
83
84
  const classArrayOffset = classDefOffset + CLASS_DEF_FORMAT_1_HEADER_SIZE;
84
85
  if (!hasBytes(bytes, classArrayOffset, glyphCount * 2)) return;
85
86
  ranges = [];
86
- for (let i = 0; i < glyphCount; i++) pushGlyph(ranges, startGlyphId + i, u16(bytes, classArrayOffset + i * 2), 0);
87
+ for (let i = 0; i < glyphCount; i++) {
88
+ const placement = placeGlyph(ranges, startGlyphId + i, u16(bytes, classArrayOffset + i * 2), 0);
89
+ if (placement.extended !== void 0) ranges[ranges.length - 1] = placement.extended;
90
+ else ranges.push(placement.fresh);
91
+ }
87
92
  } else if (format === 2) ranges = parseRangeRecords(bytes, classDefOffset + CLASS_DEF_FORMAT_2_HEADER_SIZE, u16(bytes, classDefOffset + 2));
88
93
  if (ranges === void 0) return;
89
94
  const resolved = ranges;
package/dist/parse.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PdfDiagnosticSink } from "./diagnostics.cjs";
2
- import { r as PdfObject } from "./objects-B7HdMeWS.cjs";
2
+ import { r as PdfObject } from "./objects-e2RS3-yT.cjs";
3
3
  import { ByteReader } from "./bytes/reader.cjs";
4
4
  //#region src/parse.d.ts
5
5
  declare function parseValue(reader: ByteReader, sink: PdfDiagnosticSink): PdfObject | undefined;
package/dist/parse.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PdfDiagnosticSink } from "./diagnostics.js";
2
- import { r as PdfObject } from "./objects-B7HdMeWS.js";
2
+ import { r as PdfObject } from "./objects-e2RS3-yT.js";
3
3
  import { ByteReader } from "./bytes/reader.js";
4
4
  //#region src/parse.d.ts
5
5
  declare function parseValue(reader: ByteReader, sink: PdfDiagnosticSink): PdfObject | undefined;
@@ -1,5 +1,5 @@
1
1
  import { PdfDiagnosticSink } from "./diagnostics.cjs";
2
- import { n as PdfDict } from "./objects-B7HdMeWS.cjs";
2
+ import { n as PdfDict } from "./objects-e2RS3-yT.cjs";
3
3
  //#region src/predictors.d.ts
4
4
  interface PredictorParams {
5
5
  readonly predictor: number;
@@ -1,5 +1,5 @@
1
1
  import { PdfDiagnosticSink } from "./diagnostics.js";
2
- import { n as PdfDict } from "./objects-B7HdMeWS.js";
2
+ import { n as PdfDict } from "./objects-e2RS3-yT.js";
3
3
  //#region src/predictors.d.ts
4
4
  interface PredictorParams {
5
5
  readonly predictor: number;
package/dist/raster.d.cts CHANGED
@@ -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 GlyphOutline } from "./glyf-contours-BRpvd0rt.cjs";
3
+ import { n as GlyphOutline } from "./glyf-contours-NHBpgks-.cjs";
4
4
  import { Color } from "document-schema.js";
5
5
  //#region src/raster.d.ts
6
6
  type RasterMatrix = readonly [number, number, number, number, number, number];
@@ -80,24 +80,24 @@ interface RenderPdfPageOptions {
80
80
  readonly sink?: PdfDiagnosticSink;
81
81
  readonly signal?: AbortSignal;
82
82
  }
83
- declare function renderPdfPage(pdfBytes: Uint8Array<ArrayBuffer>, pageIndex: number, options: RenderPdfPageOptions, rasteriser: PageRasteriser): Uint8Array<ArrayBuffer> | Promise<Uint8Array<ArrayBuffer>>;
84
- declare function flattenCubic(p0: {
83
+ declare function renderPdfPage(pdfBytes: Uint8Array<ArrayBuffer>, pageIndex: number, options: RenderPdfPageOptions, rasteriser: Readonly<PageRasteriser>): Uint8Array<ArrayBuffer> | Promise<Uint8Array<ArrayBuffer>>;
84
+ declare function flattenCubic(p0: Readonly<{
85
85
  x: number;
86
86
  y: number;
87
- }, c1: {
87
+ }>, c1: Readonly<{
88
88
  x: number;
89
89
  y: number;
90
- }, c2: {
90
+ }>, c2: Readonly<{
91
91
  x: number;
92
92
  y: number;
93
- }, p1: {
93
+ }>, p1: Readonly<{
94
94
  x: number;
95
95
  y: number;
96
- }): readonly {
96
+ }>): readonly {
97
97
  x: number;
98
98
  y: number;
99
99
  }[];
100
- declare function drawGlyphOutline(outline: GlyphOutline, glyphMatrix: Matrix, color: Color, rasteriser: PageRasteriser): void;
100
+ declare function drawGlyphOutline(outline: GlyphOutline, glyphMatrix: Matrix, color: Readonly<Color>, rasteriser: Readonly<PageRasteriser>): void;
101
101
  declare function glyphOutlineSubpaths(outline: GlyphOutline, matrix: Matrix): readonly RasterSubpath[];
102
102
  //#endregion
103
103
  export { PageRasteriser, RasterDrawOp, RasterFillRectOp, RasterFillSpec, RasterImageOp, RasterMatrix, RasterPageGeometry, RasterPathOp, RasterPathSegment, RasterRegionPt, RasterStrokeSpec, RasterSubpath, RenderPdfPageOptions, drawGlyphOutline, flattenCubic, glyphOutlineSubpaths, renderPdfPage };
package/dist/raster.d.ts CHANGED
@@ -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 GlyphOutline } from "./glyf-contours-C0epBNqP.js";
3
+ import { n as GlyphOutline } from "./glyf-contours-B1PsI9oA.js";
4
4
  import { Color } from "document-schema.js";
5
5
  //#region src/raster.d.ts
6
6
  type RasterMatrix = readonly [number, number, number, number, number, number];
@@ -80,24 +80,24 @@ interface RenderPdfPageOptions {
80
80
  readonly sink?: PdfDiagnosticSink;
81
81
  readonly signal?: AbortSignal;
82
82
  }
83
- declare function renderPdfPage(pdfBytes: Uint8Array<ArrayBuffer>, pageIndex: number, options: RenderPdfPageOptions, rasteriser: PageRasteriser): Uint8Array<ArrayBuffer> | Promise<Uint8Array<ArrayBuffer>>;
84
- declare function flattenCubic(p0: {
83
+ declare function renderPdfPage(pdfBytes: Uint8Array<ArrayBuffer>, pageIndex: number, options: RenderPdfPageOptions, rasteriser: Readonly<PageRasteriser>): Uint8Array<ArrayBuffer> | Promise<Uint8Array<ArrayBuffer>>;
84
+ declare function flattenCubic(p0: Readonly<{
85
85
  x: number;
86
86
  y: number;
87
- }, c1: {
87
+ }>, c1: Readonly<{
88
88
  x: number;
89
89
  y: number;
90
- }, c2: {
90
+ }>, c2: Readonly<{
91
91
  x: number;
92
92
  y: number;
93
- }, p1: {
93
+ }>, p1: Readonly<{
94
94
  x: number;
95
95
  y: number;
96
- }): readonly {
96
+ }>): readonly {
97
97
  x: number;
98
98
  y: number;
99
99
  }[];
100
- declare function drawGlyphOutline(outline: GlyphOutline, glyphMatrix: Matrix, color: Color, rasteriser: PageRasteriser): void;
100
+ declare function drawGlyphOutline(outline: GlyphOutline, glyphMatrix: Matrix, color: Readonly<Color>, rasteriser: Readonly<PageRasteriser>): void;
101
101
  declare function glyphOutlineSubpaths(outline: GlyphOutline, matrix: Matrix): readonly RasterSubpath[];
102
102
  //#endregion
103
103
  export { PageRasteriser, RasterDrawOp, RasterFillRectOp, RasterFillSpec, RasterImageOp, RasterMatrix, RasterPageGeometry, RasterPathOp, RasterPathSegment, RasterRegionPt, RasterStrokeSpec, RasterSubpath, RenderPdfPageOptions, drawGlyphOutline, flattenCubic, glyphOutlineSubpaths, renderPdfPage };
package/dist/read.cjs CHANGED
@@ -58,7 +58,9 @@ function readPdf(bytes, options) {
58
58
  const pageBoxRows = [];
59
59
  const pages = pageDicts.map((pageDict, index) => {
60
60
  require_util_abort.throwIfAborted(signal);
61
- return readPage(index, pageDict, doc, fontResolver, images, imageIdCache, destinationRegistry, optionalContent.layerNameOf, structure.ownerOf, pageBoxRows, sink);
61
+ const read = readPage(index, pageDict, doc, fontResolver, images, imageIdCache, destinationRegistry, optionalContent.layerNameOf, structure.ownerOf, sink);
62
+ if (read.boxRow !== void 0) pageBoxRows.push(read.boxRow);
63
+ return read.page;
62
64
  });
63
65
  if (pageBoxRows.length > 0) source["page-boxes"] = {
64
66
  format: "pdf",
@@ -275,7 +277,7 @@ function pageBoxResidueEntry(pageIndex, page, mediaBox, cropBox) {
275
277
  for (const [key, value] of declaredBoxes) if (value !== void 0) entries[key] = value;
276
278
  return require_objects.pdfDict(entries);
277
279
  }
278
- function readPage(pageIndex, page, resolver, fontResolver, images, imageIdCache, destinationRegistry, layerNameOf, structureOwnerOf, pageBoxRows, sink) {
280
+ function readPage(pageIndex, page, resolver, fontResolver, images, imageIdCache, destinationRegistry, layerNameOf, structureOwnerOf, sink) {
279
281
  const resources = resolver.resolveDict(require_objects.dictGet(page, "Resources"));
280
282
  const mediaBox = readMediaBox(page);
281
283
  let cropBox = readDeclaredPageBox(page, "CropBox") ?? mediaBox;
@@ -294,7 +296,6 @@ function readPage(pageIndex, page, resolver, fontResolver, images, imageIdCache,
294
296
  const heightPt = visibleRect.maxY - visibleRect.minY;
295
297
  const pageMatrix = require_matrix.multiplyMatrices(rotationResult.matrix, require_matrix.translationMatrix(-visibleRect.minX, -visibleRect.minY));
296
298
  const boxRow = pageBoxResidueEntry(pageIndex, page, mediaBox, cropBox);
297
- if (boxRow !== void 0) pageBoxRows.push(boxRow);
298
299
  const items = [];
299
300
  if (resources !== void 0) {
300
301
  const contentBytes = readPageContentBytes(page, resolver, sink);
@@ -319,11 +320,14 @@ function readPage(pageIndex, page, resolver, fontResolver, images, imageIdCache,
319
320
  const notes = readPageNotes(page, resolver);
320
321
  const annotations = require_annotations.readPageAnnotations(page, pageMatrix, resolver, sink);
321
322
  return {
322
- widthPt,
323
- heightPt,
324
- items,
325
- ...notes !== void 0 ? { notes } : {},
326
- ...annotations.length > 0 ? { annotations } : {}
323
+ page: {
324
+ widthPt,
325
+ heightPt,
326
+ items,
327
+ ...notes !== void 0 ? { notes } : {},
328
+ ...annotations.length > 0 ? { annotations } : {}
329
+ },
330
+ boxRow
327
331
  };
328
332
  }
329
333
  function withStructure(item, structure) {
package/dist/read.js CHANGED
@@ -57,7 +57,9 @@ function readPdf(bytes, options) {
57
57
  const pageBoxRows = [];
58
58
  const pages = pageDicts.map((pageDict, index) => {
59
59
  throwIfAborted(signal);
60
- return readPage(index, pageDict, doc, fontResolver, images, imageIdCache, destinationRegistry, optionalContent.layerNameOf, structure.ownerOf, pageBoxRows, sink);
60
+ const read = readPage(index, pageDict, doc, fontResolver, images, imageIdCache, destinationRegistry, optionalContent.layerNameOf, structure.ownerOf, sink);
61
+ if (read.boxRow !== void 0) pageBoxRows.push(read.boxRow);
62
+ return read.page;
61
63
  });
62
64
  if (pageBoxRows.length > 0) source["page-boxes"] = {
63
65
  format: "pdf",
@@ -274,7 +276,7 @@ function pageBoxResidueEntry(pageIndex, page, mediaBox, cropBox) {
274
276
  for (const [key, value] of declaredBoxes) if (value !== void 0) entries[key] = value;
275
277
  return pdfDict(entries);
276
278
  }
277
- function readPage(pageIndex, page, resolver, fontResolver, images, imageIdCache, destinationRegistry, layerNameOf, structureOwnerOf, pageBoxRows, sink) {
279
+ function readPage(pageIndex, page, resolver, fontResolver, images, imageIdCache, destinationRegistry, layerNameOf, structureOwnerOf, sink) {
278
280
  const resources = resolver.resolveDict(dictGet(page, "Resources"));
279
281
  const mediaBox = readMediaBox(page);
280
282
  let cropBox = readDeclaredPageBox(page, "CropBox") ?? mediaBox;
@@ -293,7 +295,6 @@ function readPage(pageIndex, page, resolver, fontResolver, images, imageIdCache,
293
295
  const heightPt = visibleRect.maxY - visibleRect.minY;
294
296
  const pageMatrix = multiplyMatrices(rotationResult.matrix, translationMatrix(-visibleRect.minX, -visibleRect.minY));
295
297
  const boxRow = pageBoxResidueEntry(pageIndex, page, mediaBox, cropBox);
296
- if (boxRow !== void 0) pageBoxRows.push(boxRow);
297
298
  const items = [];
298
299
  if (resources !== void 0) {
299
300
  const contentBytes = readPageContentBytes(page, resolver, sink);
@@ -318,11 +319,14 @@ function readPage(pageIndex, page, resolver, fontResolver, images, imageIdCache,
318
319
  const notes = readPageNotes(page, resolver);
319
320
  const annotations = readPageAnnotations(page, pageMatrix, resolver, sink);
320
321
  return {
321
- widthPt,
322
- heightPt,
323
- items,
324
- ...notes !== void 0 ? { notes } : {},
325
- ...annotations.length > 0 ? { annotations } : {}
322
+ page: {
323
+ widthPt,
324
+ heightPt,
325
+ items,
326
+ ...notes !== void 0 ? { notes } : {},
327
+ ...annotations.length > 0 ? { annotations } : {}
328
+ },
329
+ boxRow
326
330
  };
327
331
  }
328
332
  function withStructure(item, structure) {
@@ -1,4 +1,4 @@
1
- import { r as PdfObject } from "./objects-B7HdMeWS.cjs";
1
+ import { r as PdfObject } from "./objects-e2RS3-yT.cjs";
2
2
  import { ByteWriter } from "./bytes/writer.cjs";
3
3
  //#region src/serialize.d.ts
4
4
  declare function formatNumber(n: number): string;
@@ -1,4 +1,4 @@
1
- import { r as PdfObject } from "./objects-B7HdMeWS.js";
1
+ import { r as PdfObject } from "./objects-e2RS3-yT.js";
2
2
  import { ByteWriter } from "./bytes/writer.js";
3
3
  //#region src/serialize.d.ts
4
4
  declare function formatNumber(n: number): string;
@@ -6,6 +6,6 @@ interface SfntSubsetResult {
6
6
  readonly glyphIds: readonly number[];
7
7
  readonly unmappedCodePoints: readonly number[];
8
8
  }
9
- declare function subsetSfnt(font: SfntFont, codePoints: Iterable<number>, extraGlyphIds?: Iterable<number>): SfntSubsetResult | undefined;
9
+ declare function subsetSfnt(font: SfntFont, codePoints: Readonly<Iterable<number>>, extraGlyphIds?: Readonly<Iterable<number>>): SfntSubsetResult | undefined;
10
10
  //#endregion
11
11
  export { SfntSubsetResult, subsetSfnt };
@@ -6,6 +6,6 @@ interface SfntSubsetResult {
6
6
  readonly glyphIds: readonly number[];
7
7
  readonly unmappedCodePoints: readonly number[];
8
8
  }
9
- declare function subsetSfnt(font: SfntFont, codePoints: Iterable<number>, extraGlyphIds?: Iterable<number>): SfntSubsetResult | undefined;
9
+ declare function subsetSfnt(font: SfntFont, codePoints: Readonly<Iterable<number>>, extraGlyphIds?: Readonly<Iterable<number>>): SfntSubsetResult | undefined;
10
10
  //#endregion
11
11
  export { SfntSubsetResult, subsetSfnt };
@@ -1,5 +1,5 @@
1
1
  import { PdfDiagnosticSink } from "./diagnostics.cjs";
2
- import { n as PdfDict } from "./objects-B7HdMeWS.cjs";
2
+ import { n as PdfDict } from "./objects-e2RS3-yT.cjs";
3
3
  import { PdfObjectResolver } from "./interpret.cjs";
4
4
  import { LayoutStructureElement } from "./layout.cjs";
5
5
  //#region src/structure.d.ts
@@ -7,6 +7,6 @@ interface StructureContext {
7
7
  readonly tree: readonly LayoutStructureElement[];
8
8
  readonly ownerOf: (pageIndex: number, mcid: number) => string | undefined;
9
9
  }
10
- declare function readStructure(catalog: PdfDict, pages: readonly PdfDict[], resolver: PdfObjectResolver, sink: PdfDiagnosticSink): StructureContext;
10
+ declare function readStructure(catalog: PdfDict, pages: readonly PdfDict[], resolver: Readonly<PdfObjectResolver>, sink: PdfDiagnosticSink): StructureContext;
11
11
  //#endregion
12
12
  export { StructureContext, readStructure };
@@ -1,5 +1,5 @@
1
1
  import { PdfDiagnosticSink } from "./diagnostics.js";
2
- import { n as PdfDict } from "./objects-B7HdMeWS.js";
2
+ import { n as PdfDict } from "./objects-e2RS3-yT.js";
3
3
  import { PdfObjectResolver } from "./interpret.js";
4
4
  import { LayoutStructureElement } from "./layout.js";
5
5
  //#region src/structure.d.ts
@@ -7,6 +7,6 @@ interface StructureContext {
7
7
  readonly tree: readonly LayoutStructureElement[];
8
8
  readonly ownerOf: (pageIndex: number, mcid: number) => string | undefined;
9
9
  }
10
- declare function readStructure(catalog: PdfDict, pages: readonly PdfDict[], resolver: PdfObjectResolver, sink: PdfDiagnosticSink): StructureContext;
10
+ declare function readStructure(catalog: PdfDict, pages: readonly PdfDict[], resolver: Readonly<PdfObjectResolver>, sink: PdfDiagnosticSink): StructureContext;
11
11
  //#endregion
12
12
  export { StructureContext, readStructure };
@@ -1,6 +1,6 @@
1
1
  import { Color, LayoutFont, StyledRun, TextMeasurer, WrapOptions, WrappedLine } from "document-schema.js";
2
2
  //#region src/text-layout.d.ts
3
3
  declare function wrapRunsToWidth(runs: readonly StyledRun[], measurer: TextMeasurer, maxWidthPt: number, options?: WrapOptions): WrappedLine[];
4
- declare function wrapTextToWidth(text: string, font: LayoutFont, sizePt: number, color: Color, measurer: TextMeasurer, maxWidthPt: number): string[];
4
+ declare function wrapTextToWidth(text: string, font: Readonly<LayoutFont>, sizePt: number, color: Readonly<Color>, measurer: TextMeasurer, maxWidthPt: number): string[];
5
5
  //#endregion
6
6
  export { wrapRunsToWidth, wrapTextToWidth };
@@ -1,6 +1,6 @@
1
1
  import { Color, LayoutFont, StyledRun, TextMeasurer, WrapOptions, WrappedLine } from "document-schema.js";
2
2
  //#region src/text-layout.d.ts
3
3
  declare function wrapRunsToWidth(runs: readonly StyledRun[], measurer: TextMeasurer, maxWidthPt: number, options?: WrapOptions): WrappedLine[];
4
- declare function wrapTextToWidth(text: string, font: LayoutFont, sizePt: number, color: Color, measurer: TextMeasurer, maxWidthPt: number): string[];
4
+ declare function wrapTextToWidth(text: string, font: Readonly<LayoutFont>, sizePt: number, color: Readonly<Color>, measurer: TextMeasurer, maxWidthPt: number): string[];
5
5
  //#endregion
6
6
  export { wrapRunsToWidth, wrapTextToWidth };
@@ -1,4 +1,4 @@
1
- import { r as PdfObject } from "./objects-B7HdMeWS.cjs";
1
+ import { r as PdfObject } from "./objects-e2RS3-yT.cjs";
2
2
  //#region src/tounicode.d.ts
3
3
  declare function buildToUnicodeCMap(codeToSequence: ReadonlyMap<number, readonly number[]>): PdfObject;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { r as PdfObject } from "./objects-B7HdMeWS.js";
1
+ import { r as PdfObject } from "./objects-e2RS3-yT.js";
2
2
  //#region src/tounicode.d.ts
3
3
  declare function buildToUnicodeCMap(codeToSequence: ReadonlyMap<number, readonly number[]>): PdfObject;
4
4
  //#endregion
package/dist/write.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { LayoutDocument } from "./layout.cjs";
2
- import { r as EmbeddedFaceSubstitution } from "./embedded-font-CEf-zBCA.cjs";
2
+ import { r as EmbeddedFaceSubstitution } from "./embedded-font-DgVBedw6.cjs";
3
3
  import { WinAnsiSubstitution } from "./winansi.cjs";
4
4
  import { PdfEncryptionOptions } from "./encrypt-write.cjs";
5
5
  import { FontRegistry } from "./font-registry.cjs";
package/dist/write.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { LayoutDocument } from "./layout.js";
2
- import { r as EmbeddedFaceSubstitution } from "./embedded-font-Bnhh4juV.js";
2
+ import { r as EmbeddedFaceSubstitution } from "./embedded-font-ByD7ZiQS.js";
3
3
  import { WinAnsiSubstitution } from "./winansi.js";
4
4
  import { PdfEncryptionOptions } from "./encrypt-write.js";
5
5
  import { FontRegistry } from "./font-registry.js";
package/dist/xref.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PdfDiagnosticSink } from "./diagnostics.cjs";
2
- import { n as PdfDict } from "./objects-B7HdMeWS.cjs";
2
+ import { n as PdfDict } from "./objects-e2RS3-yT.cjs";
3
3
  //#region src/xref.d.ts
4
4
  interface XrefOffsetEntry {
5
5
  readonly type: "offset";
package/dist/xref.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PdfDiagnosticSink } from "./diagnostics.js";
2
- import { n as PdfDict } from "./objects-B7HdMeWS.js";
2
+ import { n as PdfDict } from "./objects-e2RS3-yT.js";
3
3
  //#region src/xref.d.ts
4
4
  interface XrefOffsetEntry {
5
5
  readonly type: "offset";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pdf-parser.js",
3
- "version": "5.2.26",
3
+ "version": "5.2.27",
4
4
  "description": "Hand-written, dependency-minimal PDF codec: parses arbitrary real-world PDFs and generates new ones, built on its own codec-owned LayoutDocument item model and Zod 4 codecs.",
5
5
  "type": "module",
6
6
  "repository": {