pdf-parser.js 5.2.25 → 5.2.26

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/afm-widths.cjs +1 -1
  2. package/dist/afm-widths.js +1 -1
  3. package/dist/builtin-encoding.cjs +1 -1
  4. package/dist/builtin-encoding.d.cts +2 -2
  5. package/dist/builtin-encoding.d.ts +2 -2
  6. package/dist/builtin-encoding.js +1 -1
  7. package/dist/cff-bounds.d.cts +1 -1
  8. package/dist/cff-bounds.d.ts +1 -1
  9. package/dist/cff.d.cts +1 -1
  10. package/dist/cff.d.ts +1 -1
  11. package/dist/cmap-table.d.cts +1 -1
  12. package/dist/cmap-table.d.ts +1 -1
  13. package/dist/cmap.d.cts +1 -1
  14. package/dist/cmap.d.ts +1 -1
  15. package/dist/content-write.cjs +1 -1
  16. package/dist/content-write.d.cts +3 -3
  17. package/dist/content-write.d.ts +3 -3
  18. package/dist/content-write.js +1 -1
  19. package/dist/document.d.cts +4 -4
  20. package/dist/document.d.ts +4 -4
  21. package/dist/{embedded-font-BRhZfEN2.d.ts → embedded-font-Bnhh4juV.d.ts} +3 -3
  22. package/dist/{embedded-font-DJUn9kMH.d.cts → embedded-font-CEf-zBCA.d.cts} +3 -3
  23. package/dist/embedded-font-write.d.cts +1 -1
  24. package/dist/embedded-font-write.d.ts +1 -1
  25. package/dist/embedded-font.cjs +1 -1
  26. package/dist/embedded-font.d.cts +1 -1
  27. package/dist/embedded-font.d.ts +1 -1
  28. package/dist/embedded-font.js +1 -1
  29. package/dist/encoding.cjs +1 -1
  30. package/dist/encoding.js +1 -1
  31. package/dist/encrypt-write.d.cts +2 -2
  32. package/dist/encrypt-write.d.ts +2 -2
  33. package/dist/encrypt.d.cts +2 -2
  34. package/dist/encrypt.d.ts +2 -2
  35. package/dist/font-read.cjs +1 -1
  36. package/dist/font-read.d.cts +2 -2
  37. package/dist/font-read.d.ts +2 -2
  38. package/dist/font-read.js +1 -1
  39. package/dist/font-registry.d.cts +2 -2
  40. package/dist/font-registry.d.ts +2 -2
  41. package/dist/gdef-table.d.cts +3 -3
  42. package/dist/gdef-table.d.ts +3 -3
  43. package/dist/{glyf-vMGtP1pb.d.ts → glyf-Bv1katwK.d.ts} +4 -4
  44. package/dist/{glyf-nXC-IDRW.d.cts → glyf-DFyknMrW.d.cts} +4 -4
  45. package/dist/{glyf-contours-zRQbj-Yp.d.cts → glyf-contours-BRpvd0rt.d.cts} +1 -1
  46. package/dist/{glyf-contours-OSdG6Edr.d.ts → glyf-contours-C0epBNqP.d.ts} +1 -1
  47. package/dist/glyf-contours.d.cts +1 -1
  48. package/dist/glyf-contours.d.ts +1 -1
  49. package/dist/glyf.d.cts +1 -1
  50. package/dist/glyf.d.ts +1 -1
  51. package/dist/gsub-table.cjs +1 -1
  52. package/dist/gsub-table.js +1 -1
  53. package/dist/hmtx-table.d.cts +1 -1
  54. package/dist/hmtx-table.d.ts +1 -1
  55. package/dist/image/jbig2-generic.cjs +2 -2
  56. package/dist/image/jbig2-generic.js +2 -2
  57. package/dist/image/jpeg2000-tagtree.cjs +1 -1
  58. package/dist/image/jpeg2000-tagtree.js +1 -1
  59. package/dist/index.cjs +1 -1
  60. package/dist/index.d.cts +1 -1
  61. package/dist/index.d.ts +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/interpret.cjs +2 -2
  64. package/dist/interpret.d.cts +4 -4
  65. package/dist/interpret.d.ts +4 -4
  66. package/dist/interpret.js +2 -2
  67. package/dist/math-content-write.cjs +3 -3
  68. package/dist/math-content-write.js +3 -3
  69. package/dist/math-font.d.cts +4 -4
  70. package/dist/math-font.d.ts +4 -4
  71. package/dist/measure.cjs +1 -1
  72. package/dist/measure.js +1 -1
  73. package/dist/navigation.d.cts +1 -1
  74. package/dist/navigation.d.ts +1 -1
  75. package/dist/ot-layout-common.d.cts +2 -2
  76. package/dist/ot-layout-common.d.ts +2 -2
  77. package/dist/parse.cjs +5 -0
  78. package/dist/parse.d.cts +2 -1
  79. package/dist/parse.d.ts +2 -1
  80. package/dist/parse.js +5 -1
  81. package/dist/raster.cjs +10 -40
  82. package/dist/raster.d.cts +4 -4
  83. package/dist/raster.d.ts +4 -4
  84. package/dist/raster.js +10 -40
  85. package/dist/structure.cjs +4 -4
  86. package/dist/structure.js +4 -4
  87. package/dist/winansi.cjs +1 -1
  88. package/dist/winansi.js +1 -1
  89. package/dist/write.cjs +4 -4
  90. package/dist/write.d.cts +1 -1
  91. package/dist/write.d.ts +1 -1
  92. package/dist/write.js +4 -4
  93. package/package.json +2 -2
  94. package/dist/{afm-widths-BTu0IDp2.cjs → afm-widths-BYiX2L9D.cjs} +1 -1
  95. package/dist/{afm-widths-De_QMWgC.js → afm-widths-blUDDjlI.js} +1 -1
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-DJUn9kMH.cjs";
2
+ import { r as EmbeddedFaceSubstitution } from "./embedded-font-CEf-zBCA.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-BRhZfEN2.js";
2
+ import { r as EmbeddedFaceSubstitution } from "./embedded-font-Bnhh4juV.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/write.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as widthOfCode, t as STANDARD_METRICS } from "./afm-widths-De_QMWgC.js";
1
+ import { n as widthOfCode, t as STANDARD_METRICS } from "./afm-widths-blUDDjlI.js";
2
2
  import { NOTES_ANNOTATION_AUTHOR } from "./notes-annotation-author.js";
3
3
  import { pdfArray, pdfBool, pdfDict, pdfHexString, pdfLiteralString, pdfName, pdfNull, pdfNum, pdfRef, pdfStream } from "./objects.js";
4
4
  import { ByteWriter, concatBytes } from "./bytes/writer.js";
@@ -770,10 +770,10 @@ function writePdf(doc, options = {}) {
770
770
  });
771
771
  }
772
772
  for (const [face, alloc] of embeddedAllocs) {
773
- const usedGlyphs = collectEmbeddedGlyphs(alloc.texts, face);
774
- const subset = subsetSfnt(face.font, [...alloc.codePoints], [...usedGlyphs.keys()]);
773
+ const faceUsedGlyphs = collectEmbeddedGlyphs(alloc.texts, face);
774
+ const subset = subsetSfnt(face.font, [...alloc.codePoints], [...faceUsedGlyphs.keys()]);
775
775
  if (subset === void 0) throw new Error(`font "${face.postScriptName}" resolved to an embeddable face, but its glyph outlines could not be subsetted — only TrueType-outline ('glyf') fonts can be embedded, so supply a TrueType face for this family or drop it from the registry`);
776
- const built = buildEmbeddedFontObjects(face, subset, usedGlyphs, {
776
+ const built = buildEmbeddedFontObjects(face, subset, faceUsedGlyphs, {
777
777
  cidFontRef: pdfRef(alloc.cidFontNum, 0),
778
778
  descriptorRef: pdfRef(alloc.descriptorNum, 0),
779
779
  fontFileRef: pdfRef(alloc.fontFileNum, 0),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pdf-parser.js",
3
- "version": "5.2.25",
3
+ "version": "5.2.26",
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": {
@@ -73,7 +73,7 @@
73
73
  "license": "MIT",
74
74
  "dependencies": {
75
75
  "byte-codec": "2.0.1",
76
- "document-schema.js": "7.15.2",
76
+ "document-schema.js": "7.15.3",
77
77
  "fflate": "0.8.3",
78
78
  "zod": "4.4.3"
79
79
  },
@@ -264,6 +264,7 @@ function encodeForShow(text, font) {
264
264
  }
265
265
  //#endregion
266
266
  //#region src/encoding.ts
267
+ const MAX_UNICODE_CODE_POINT = 1114111;
267
268
  const WINANSI_GLYPH_NAMES = [
268
269
  "",
269
270
  "",
@@ -1954,7 +1955,6 @@ function algorithmicGlyphNameToUnicode(name) {
1954
1955
  const codePoint = Number.parseInt(uMatch[1], 16);
1955
1956
  return codePoint <= MAX_UNICODE_CODE_POINT ? codePoint : void 0;
1956
1957
  }
1957
- const MAX_UNICODE_CODE_POINT = 1114111;
1958
1958
  //#endregion
1959
1959
  //#region src/afm-widths.ts
1960
1960
  function parseWidths(source) {
@@ -264,6 +264,7 @@ function encodeForShow(text, font) {
264
264
  }
265
265
  //#endregion
266
266
  //#region src/encoding.ts
267
+ const MAX_UNICODE_CODE_POINT = 1114111;
267
268
  const WINANSI_GLYPH_NAMES = [
268
269
  "",
269
270
  "",
@@ -1954,7 +1955,6 @@ function algorithmicGlyphNameToUnicode(name) {
1954
1955
  const codePoint = Number.parseInt(uMatch[1], 16);
1955
1956
  return codePoint <= MAX_UNICODE_CODE_POINT ? codePoint : void 0;
1956
1957
  }
1957
- const MAX_UNICODE_CODE_POINT = 1114111;
1958
1958
  //#endregion
1959
1959
  //#region src/afm-widths.ts
1960
1960
  function parseWidths(source) {