pdf-codec 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -12
- package/dist/cff-bounds.cjs +432 -0
- package/dist/cff-bounds.d.cts +9 -0
- package/dist/cff-bounds.d.ts +9 -0
- package/dist/cff-bounds.js +431 -0
- package/dist/cff-probe.cjs +8 -106
- package/dist/cff-probe.js +9 -107
- package/dist/cff.cjs +158 -0
- package/dist/cff.d.cts +17 -0
- package/dist/cff.d.ts +17 -0
- package/dist/cff.js +150 -0
- package/dist/filters.cjs +45 -2
- package/dist/filters.d.cts +4 -3
- package/dist/filters.d.ts +4 -3
- package/dist/filters.js +45 -2
- package/dist/formula.d.cts +1 -1
- package/dist/formula.d.ts +1 -1
- package/dist/glyf.cjs +62 -6
- package/dist/glyf.d.cts +2 -0
- package/dist/glyf.d.ts +2 -0
- package/dist/glyf.js +62 -6
- package/dist/glyph-bounds-BV_Z40KS.d.cts +10 -0
- package/dist/glyph-bounds-BV_Z40KS.d.ts +10 -0
- package/dist/glyph-bounds.cjs +12 -0
- package/dist/glyph-bounds.d.cts +2 -0
- package/dist/glyph-bounds.d.ts +2 -0
- package/dist/glyph-bounds.js +11 -0
- package/dist/image/jbig2-arith.cjs +432 -0
- package/dist/image/jbig2-arith.d.cts +23 -0
- package/dist/image/jbig2-arith.d.ts +23 -0
- package/dist/image/jbig2-arith.js +426 -0
- package/dist/image/jbig2-bitmap.cjs +80 -0
- package/dist/image/jbig2-bitmap.d.cts +20 -0
- package/dist/image/jbig2-bitmap.d.ts +20 -0
- package/dist/image/jbig2-bitmap.js +72 -0
- package/dist/image/jbig2-errors.cjs +17 -0
- package/dist/image/jbig2-errors.d.cts +2 -0
- package/dist/image/jbig2-errors.d.ts +2 -0
- package/dist/image/jbig2-errors.js +15 -0
- package/dist/image/jbig2-generic.cjs +242 -0
- package/dist/image/jbig2-generic.d.cts +27 -0
- package/dist/image/jbig2-generic.d.ts +27 -0
- package/dist/image/jbig2-generic.js +237 -0
- package/dist/image/jbig2-text.cjs +175 -0
- package/dist/image/jbig2-text.d.cts +58 -0
- package/dist/image/jbig2-text.d.ts +58 -0
- package/dist/image/jbig2-text.js +170 -0
- package/dist/image/jbig2.cjs +333 -0
- package/dist/image/jbig2.d.cts +15 -0
- package/dist/image/jbig2.d.ts +15 -0
- package/dist/image/jbig2.js +332 -0
- package/dist/image/jp2-boxes.cjs +148 -0
- package/dist/image/jp2-boxes.d.cts +26 -0
- package/dist/image/jp2-boxes.d.ts +26 -0
- package/dist/image/jp2-boxes.js +146 -0
- package/dist/image/jpeg2000-codestream.cjs +309 -0
- package/dist/image/jpeg2000-codestream.d.cts +78 -0
- package/dist/image/jpeg2000-codestream.d.ts +78 -0
- package/dist/image/jpeg2000-codestream.js +308 -0
- package/dist/image/jpeg2000-dwt.cjs +148 -0
- package/dist/image/jpeg2000-dwt.d.cts +34 -0
- package/dist/image/jpeg2000-dwt.d.ts +34 -0
- package/dist/image/jpeg2000-dwt.js +145 -0
- package/dist/image/jpeg2000-errors.cjs +17 -0
- package/dist/image/jpeg2000-errors.d.cts +9 -0
- package/dist/image/jpeg2000-errors.d.ts +9 -0
- package/dist/image/jpeg2000-errors.js +15 -0
- package/dist/image/jpeg2000-t1.cjs +254 -0
- package/dist/image/jpeg2000-t1.d.cts +18 -0
- package/dist/image/jpeg2000-t1.d.ts +18 -0
- package/dist/image/jpeg2000-t1.js +253 -0
- package/dist/image/jpeg2000-t2.cjs +316 -0
- package/dist/image/jpeg2000-t2.d.cts +79 -0
- package/dist/image/jpeg2000-t2.d.ts +79 -0
- package/dist/image/jpeg2000-t2.js +311 -0
- package/dist/image/jpeg2000-tagtree.cjs +105 -0
- package/dist/image/jpeg2000-tagtree.d.cts +29 -0
- package/dist/image/jpeg2000-tagtree.d.ts +29 -0
- package/dist/image/jpeg2000-tagtree.js +103 -0
- package/dist/image/jpeg2000.cjs +322 -0
- package/dist/image/jpeg2000.d.cts +54 -0
- package/dist/image/jpeg2000.d.ts +54 -0
- package/dist/image/jpeg2000.js +320 -0
- package/dist/images-read.cjs +78 -1
- package/dist/images-read.js +78 -1
- package/dist/index.cjs +17 -0
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +7 -1
- package/dist/jbig2-errors-Bj6MPxrx.d.cts +9 -0
- package/dist/jbig2-errors-Bj6MPxrx.d.ts +9 -0
- package/dist/math-content-write.cjs +37 -1
- package/dist/math-content-write.d.cts +1 -1
- package/dist/math-content-write.d.ts +1 -1
- package/dist/math-content-write.js +38 -2
- package/dist/math-font-write.cjs +6 -1
- package/dist/math-font-write.d.cts +1 -1
- package/dist/math-font-write.d.ts +1 -1
- package/dist/math-font-write.js +6 -1
- package/dist/math-font.cjs +91 -18
- package/dist/math-font.d.cts +8 -1
- package/dist/math-font.d.ts +8 -1
- package/dist/math-font.js +91 -18
- package/dist/math-stretch-Bwk_bxh1.d.ts +24 -0
- package/dist/math-stretch-DXWjs8gL.d.cts +24 -0
- package/dist/math-stretch.cjs +96 -0
- package/dist/math-stretch.d.cts +2 -0
- package/dist/math-stretch.d.ts +2 -0
- package/dist/math-stretch.js +94 -0
- package/dist/math-table-DhPrNoPa.d.ts +70 -0
- package/dist/math-table-gFNB8DmQ.d.cts +70 -0
- package/dist/math-table.cjs +69 -1
- package/dist/math-table.d.cts +2 -45
- package/dist/math-table.d.ts +2 -45
- package/dist/math-table.js +69 -1
- package/dist/{math-types-Ba8qAf1p.d.ts → math-types-BZkWO5Ow.d.cts} +30 -2
- package/dist/{math-types-Ba8qAf1p.d.cts → math-types-Bq7tyV4g.d.ts} +30 -2
- package/dist/math-types.d.cts +3 -2
- package/dist/math-types.d.ts +3 -2
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as MathStretchAxis } from "./math-stretch-DXWjs8gL.cjs";
|
|
1
2
|
//#region src/math-types.d.ts
|
|
2
3
|
interface MathColor {
|
|
3
4
|
readonly r: number;
|
|
@@ -29,7 +30,19 @@ interface MathStroke {
|
|
|
29
30
|
readonly widthPt: number;
|
|
30
31
|
readonly color: MathColor;
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
interface MathGlyphPlacement {
|
|
34
|
+
readonly glyphId: number;
|
|
35
|
+
readonly xPt: number;
|
|
36
|
+
readonly yPt: number;
|
|
37
|
+
}
|
|
38
|
+
interface MathAssembledGlyphs {
|
|
39
|
+
readonly kind: 'assembled-glyphs';
|
|
40
|
+
readonly placements: readonly MathGlyphPlacement[];
|
|
41
|
+
readonly text: string;
|
|
42
|
+
readonly sizePt: number;
|
|
43
|
+
readonly color: MathColor;
|
|
44
|
+
}
|
|
45
|
+
type MathLayoutItem = MathGlyphRun | MathRule | MathStroke | MathAssembledGlyphs;
|
|
33
46
|
interface MathBox {
|
|
34
47
|
readonly widthPt: number;
|
|
35
48
|
readonly heightPt: number;
|
|
@@ -41,6 +54,20 @@ interface MathGlyphMetrics {
|
|
|
41
54
|
readonly advanceWidthPt: number;
|
|
42
55
|
readonly italicCorrectionPt: number;
|
|
43
56
|
readonly topAccentXPt?: number;
|
|
57
|
+
readonly inkAscentPt?: number;
|
|
58
|
+
readonly inkDescentPt?: number;
|
|
59
|
+
}
|
|
60
|
+
interface MathStretchGlyph {
|
|
61
|
+
readonly glyphId: number;
|
|
62
|
+
readonly offsetPt: number;
|
|
63
|
+
}
|
|
64
|
+
interface MathStretchResult {
|
|
65
|
+
readonly kind: 'base' | 'variant' | 'assembly';
|
|
66
|
+
readonly sizePt: number;
|
|
67
|
+
readonly advanceWidthPt: number;
|
|
68
|
+
readonly inkAscentPt: number;
|
|
69
|
+
readonly inkDescentPt: number;
|
|
70
|
+
readonly placements: readonly MathStretchGlyph[];
|
|
44
71
|
}
|
|
45
72
|
interface MathFontMetrics {
|
|
46
73
|
readonly ascentPerEm: number;
|
|
@@ -77,6 +104,7 @@ interface MathFontMetrics {
|
|
|
77
104
|
readonly scriptScriptPercentScaleDown: number;
|
|
78
105
|
readonly defaultRuleThicknessPt: number;
|
|
79
106
|
glyph(codePoint: number, sizePt: number): MathGlyphMetrics | undefined;
|
|
107
|
+
stretch(codePoint: number, axis: MathStretchAxis, targetSizePt: number, sizePt: number): MathStretchResult | undefined;
|
|
80
108
|
}
|
|
81
109
|
//#endregion
|
|
82
|
-
export {
|
|
110
|
+
export { MathGlyphMetrics as a, MathLayoutItem as c, MathStretchResult as d, MathStroke as f, MathFontMetrics as i, MathRule as l, MathBox as n, MathGlyphPlacement as o, MathColor as r, MathGlyphRun as s, MathAssembledGlyphs as t, MathStretchGlyph as u };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as MathStretchAxis } from "./math-stretch-Bwk_bxh1.js";
|
|
1
2
|
//#region src/math-types.d.ts
|
|
2
3
|
interface MathColor {
|
|
3
4
|
readonly r: number;
|
|
@@ -29,7 +30,19 @@ interface MathStroke {
|
|
|
29
30
|
readonly widthPt: number;
|
|
30
31
|
readonly color: MathColor;
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
interface MathGlyphPlacement {
|
|
34
|
+
readonly glyphId: number;
|
|
35
|
+
readonly xPt: number;
|
|
36
|
+
readonly yPt: number;
|
|
37
|
+
}
|
|
38
|
+
interface MathAssembledGlyphs {
|
|
39
|
+
readonly kind: 'assembled-glyphs';
|
|
40
|
+
readonly placements: readonly MathGlyphPlacement[];
|
|
41
|
+
readonly text: string;
|
|
42
|
+
readonly sizePt: number;
|
|
43
|
+
readonly color: MathColor;
|
|
44
|
+
}
|
|
45
|
+
type MathLayoutItem = MathGlyphRun | MathRule | MathStroke | MathAssembledGlyphs;
|
|
33
46
|
interface MathBox {
|
|
34
47
|
readonly widthPt: number;
|
|
35
48
|
readonly heightPt: number;
|
|
@@ -41,6 +54,20 @@ interface MathGlyphMetrics {
|
|
|
41
54
|
readonly advanceWidthPt: number;
|
|
42
55
|
readonly italicCorrectionPt: number;
|
|
43
56
|
readonly topAccentXPt?: number;
|
|
57
|
+
readonly inkAscentPt?: number;
|
|
58
|
+
readonly inkDescentPt?: number;
|
|
59
|
+
}
|
|
60
|
+
interface MathStretchGlyph {
|
|
61
|
+
readonly glyphId: number;
|
|
62
|
+
readonly offsetPt: number;
|
|
63
|
+
}
|
|
64
|
+
interface MathStretchResult {
|
|
65
|
+
readonly kind: 'base' | 'variant' | 'assembly';
|
|
66
|
+
readonly sizePt: number;
|
|
67
|
+
readonly advanceWidthPt: number;
|
|
68
|
+
readonly inkAscentPt: number;
|
|
69
|
+
readonly inkDescentPt: number;
|
|
70
|
+
readonly placements: readonly MathStretchGlyph[];
|
|
44
71
|
}
|
|
45
72
|
interface MathFontMetrics {
|
|
46
73
|
readonly ascentPerEm: number;
|
|
@@ -77,6 +104,7 @@ interface MathFontMetrics {
|
|
|
77
104
|
readonly scriptScriptPercentScaleDown: number;
|
|
78
105
|
readonly defaultRuleThicknessPt: number;
|
|
79
106
|
glyph(codePoint: number, sizePt: number): MathGlyphMetrics | undefined;
|
|
107
|
+
stretch(codePoint: number, axis: MathStretchAxis, targetSizePt: number, sizePt: number): MathStretchResult | undefined;
|
|
80
108
|
}
|
|
81
109
|
//#endregion
|
|
82
|
-
export {
|
|
110
|
+
export { MathGlyphMetrics as a, MathLayoutItem as c, MathStretchResult as d, MathStroke as f, MathFontMetrics as i, MathRule as l, MathBox as n, MathGlyphPlacement as o, MathColor as r, MathGlyphRun as s, MathAssembledGlyphs as t, MathStretchGlyph as u };
|
package/dist/math-types.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as MathStretchAxis } from "./math-stretch-DXWjs8gL.cjs";
|
|
2
|
+
import { a as MathGlyphMetrics, c as MathLayoutItem, d as MathStretchResult, f as MathStroke, i as MathFontMetrics, l as MathRule, n as MathBox, o as MathGlyphPlacement, r as MathColor, s as MathGlyphRun, t as MathAssembledGlyphs, u as MathStretchGlyph } from "./math-types-BZkWO5Ow.cjs";
|
|
3
|
+
export { MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, type MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke };
|
package/dist/math-types.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as MathStretchAxis } from "./math-stretch-Bwk_bxh1.js";
|
|
2
|
+
import { a as MathGlyphMetrics, c as MathLayoutItem, d as MathStretchResult, f as MathStroke, i as MathFontMetrics, l as MathRule, n as MathBox, o as MathGlyphPlacement, r as MathColor, s as MathGlyphRun, t as MathAssembledGlyphs, u as MathStretchGlyph } from "./math-types-Bq7tyV4g.js";
|
|
3
|
+
export { MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, type MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pdf-codec",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Hand-written, dependency-minimal PDF codec: parses arbitrary real-world PDFs and generates new ones, built on document-schema.js's LayoutDocument pivot and Zod 4 codecs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|