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.
- package/dist/annotations.d.cts +2 -2
- package/dist/annotations.d.ts +2 -2
- package/dist/attachments.d.cts +2 -2
- package/dist/attachments.d.ts +2 -2
- package/dist/cff-bounds.cjs +31 -21
- package/dist/cff-bounds.js +31 -21
- package/dist/content-read.d.cts +1 -1
- package/dist/content-read.d.ts +1 -1
- package/dist/content-write.cjs +18 -12
- package/dist/content-write.d.cts +2 -2
- package/dist/content-write.d.ts +2 -2
- package/dist/content-write.js +18 -12
- package/dist/document.cjs +17 -11
- package/dist/document.d.cts +1 -1
- package/dist/document.d.ts +1 -1
- package/dist/document.js +17 -11
- package/dist/{embedded-font-Bnhh4juV.d.ts → embedded-font-ByD7ZiQS.d.ts} +1 -1
- package/dist/{embedded-font-CEf-zBCA.d.cts → embedded-font-DgVBedw6.d.cts} +1 -1
- package/dist/embedded-font-write.d.cts +2 -2
- package/dist/embedded-font-write.d.ts +2 -2
- package/dist/embedded-font.d.cts +1 -1
- package/dist/embedded-font.d.ts +1 -1
- package/dist/encrypt-write.d.cts +1 -1
- package/dist/encrypt-write.d.ts +1 -1
- package/dist/encrypt.d.cts +1 -1
- package/dist/encrypt.d.ts +1 -1
- package/dist/filters.cjs +6 -6
- package/dist/filters.d.cts +1 -1
- package/dist/filters.d.ts +1 -1
- package/dist/filters.js +6 -6
- package/dist/font-read.d.cts +1 -1
- package/dist/font-read.d.ts +1 -1
- package/dist/font-registry.d.cts +3 -3
- package/dist/font-registry.d.ts +3 -3
- package/dist/form.cjs +13 -8
- package/dist/form.d.cts +2 -2
- package/dist/form.d.ts +2 -2
- package/dist/form.js +13 -8
- package/dist/{glyf-contours-C0epBNqP.d.ts → glyf-contours-B1PsI9oA.d.ts} +1 -1
- package/dist/{glyf-contours-BRpvd0rt.d.cts → glyf-contours-NHBpgks-.d.cts} +1 -1
- package/dist/glyf-contours.d.cts +1 -1
- package/dist/glyf-contours.d.ts +1 -1
- package/dist/gsub-table.cjs +12 -8
- package/dist/gsub-table.js +12 -8
- package/dist/image/jpeg2000-codestream.cjs +17 -8
- package/dist/image/jpeg2000-codestream.js +17 -8
- package/dist/images-read.d.cts +2 -2
- package/dist/images-read.d.ts +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/interpret.cjs +29 -16
- package/dist/interpret.d.cts +1 -1
- package/dist/interpret.d.ts +1 -1
- package/dist/interpret.js +29 -16
- package/dist/math-font-write.d.cts +1 -1
- package/dist/math-font-write.d.ts +1 -1
- package/dist/names.cjs +7 -7
- package/dist/names.d.cts +2 -2
- package/dist/names.d.ts +2 -2
- package/dist/names.js +7 -7
- package/dist/navigation.cjs +6 -7
- package/dist/navigation.d.cts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.js +6 -7
- package/dist/{objects-B7HdMeWS.d.cts → objects-e2RS3-yT.d.cts} +3 -3
- package/dist/{objects-B7HdMeWS.d.ts → objects-e2RS3-yT.d.ts} +3 -3
- package/dist/objects.d.cts +1 -1
- package/dist/objects.d.ts +1 -1
- package/dist/optional-content.d.cts +2 -2
- package/dist/optional-content.d.ts +2 -2
- package/dist/ot-layout-common.cjs +18 -13
- package/dist/ot-layout-common.js +18 -13
- package/dist/parse.d.cts +1 -1
- package/dist/parse.d.ts +1 -1
- package/dist/predictors.d.cts +1 -1
- package/dist/predictors.d.ts +1 -1
- package/dist/raster.d.cts +8 -8
- package/dist/raster.d.ts +8 -8
- package/dist/read.cjs +12 -8
- package/dist/read.js +12 -8
- package/dist/serialize.d.cts +1 -1
- package/dist/serialize.d.ts +1 -1
- package/dist/sfnt-subset.d.cts +1 -1
- package/dist/sfnt-subset.d.ts +1 -1
- package/dist/structure.d.cts +2 -2
- package/dist/structure.d.ts +2 -2
- package/dist/text-layout.d.cts +1 -1
- package/dist/text-layout.d.ts +1 -1
- package/dist/tounicode.d.cts +1 -1
- package/dist/tounicode.d.ts +1 -1
- package/dist/write.d.cts +1 -1
- package/dist/write.d.ts +1 -1
- package/dist/xref.d.cts +1 -1
- package/dist/xref.d.ts +1 -1
- package/package.json +1 -1
package/dist/ot-layout-common.js
CHANGED
|
@@ -11,21 +11,18 @@ function findRange(ranges, glyphId) {
|
|
|
11
11
|
else return range;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
function
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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++)
|
|
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++)
|
|
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-
|
|
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-
|
|
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;
|
package/dist/predictors.d.cts
CHANGED
package/dist/predictors.d.ts
CHANGED
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-
|
|
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
|
-
}
|
|
87
|
+
}>, c1: Readonly<{
|
|
88
88
|
x: number;
|
|
89
89
|
y: number;
|
|
90
|
-
}
|
|
90
|
+
}>, c2: Readonly<{
|
|
91
91
|
x: number;
|
|
92
92
|
y: number;
|
|
93
|
-
}
|
|
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
|
|
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-
|
|
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
|
-
}
|
|
87
|
+
}>, c1: Readonly<{
|
|
88
88
|
x: number;
|
|
89
89
|
y: number;
|
|
90
|
-
}
|
|
90
|
+
}>, c2: Readonly<{
|
|
91
91
|
x: number;
|
|
92
92
|
y: number;
|
|
93
|
-
}
|
|
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
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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) {
|
package/dist/serialize.d.cts
CHANGED
package/dist/serialize.d.ts
CHANGED
package/dist/sfnt-subset.d.cts
CHANGED
|
@@ -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
|
|
9
|
+
declare function subsetSfnt(font: SfntFont, codePoints: Readonly<Iterable<number>>, extraGlyphIds?: Readonly<Iterable<number>>): SfntSubsetResult | undefined;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { SfntSubsetResult, subsetSfnt };
|
package/dist/sfnt-subset.d.ts
CHANGED
|
@@ -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
|
|
9
|
+
declare function subsetSfnt(font: SfntFont, codePoints: Readonly<Iterable<number>>, extraGlyphIds?: Readonly<Iterable<number>>): SfntSubsetResult | undefined;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { SfntSubsetResult, subsetSfnt };
|
package/dist/structure.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PdfDiagnosticSink } from "./diagnostics.cjs";
|
|
2
|
-
import { n as PdfDict } from "./objects-
|
|
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
|
|
10
|
+
declare function readStructure(catalog: PdfDict, pages: readonly PdfDict[], resolver: Readonly<PdfObjectResolver>, sink: PdfDiagnosticSink): StructureContext;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { StructureContext, readStructure };
|
package/dist/structure.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PdfDiagnosticSink } from "./diagnostics.js";
|
|
2
|
-
import { n as PdfDict } from "./objects-
|
|
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
|
|
10
|
+
declare function readStructure(catalog: PdfDict, pages: readonly PdfDict[], resolver: Readonly<PdfObjectResolver>, sink: PdfDiagnosticSink): StructureContext;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { StructureContext, readStructure };
|
package/dist/text-layout.d.cts
CHANGED
|
@@ -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
|
|
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 };
|
package/dist/text-layout.d.ts
CHANGED
|
@@ -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
|
|
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 };
|
package/dist/tounicode.d.cts
CHANGED
package/dist/tounicode.d.ts
CHANGED
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-
|
|
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-
|
|
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
package/dist/xref.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pdf-parser.js",
|
|
3
|
-
"version": "5.2.
|
|
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": {
|