pdf-codec 4.0.9 → 4.0.11
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 +7 -1
- package/dist/codec.d.cts +2 -0
- package/dist/codec.d.ts +2 -0
- package/dist/layout.d.cts +4 -0
- package/dist/layout.d.ts +4 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
This is a genuinely large undertaking with an honest trade-off spelled out in [Fidelity](#fidelity): this is not, and does not attempt to be, as robust against adversarial or badly malformed real-world PDFs as a library with 15+ years of hardening. What it buys instead is a dependency-free, fully auditable PDF implementation with no supply-chain surface beyond `document-schema.js`, `fflate`, and `zod`.
|
|
10
10
|
|
|
11
|
-
`documents.js` uses this package to convert docx/pptx/odt/odp/ods/odg to and from PDF, and to render MathML formulas (typeset by its own `src/mathml/` engine) through the embedded math font this package parses and writes. That MathML _layout_ engine deliberately stays in `documents.js` — see [Architecture](#architecture) for exactly where the boundary sits and why a real `MathBox` value crosses it with zero cast or wrapper.
|
|
11
|
+
`documents.js` uses this package to convert docx/pptx/odt/odp/ods/odg to and from PDF, and to render MathML formulas (typeset by its own `src/mathml/` engine) through the embedded math font this package parses and writes. That MathML _layout_ engine deliberately stays in `documents.js` — see [Architecture](#architecture) for exactly where the boundary sits and why a real `MathBox` value crosses it with zero cast or wrapper. [`document-outline.js`](https://github.com/ExaDev/documents.js/tree/main/packages/document-outline.js)'s `segmentPdfRegions` ([ExaDev/documents.js#931](https://github.com/ExaDev/documents.js/issues/931)) is a second, independent consumer of this package's `LayoutPage`/`LayoutItem` types alone — a recursive X-Y cut page-segmentation pass classifying a page's own positioned items into columns, tables, figures, and captions, entirely without the semantic reconstruction this package deliberately keeps out of itself.
|
|
12
12
|
|
|
13
13
|
```mermaid
|
|
14
14
|
graph TD
|
|
@@ -21,23 +21,28 @@ graph TD
|
|
|
21
21
|
documents("documents.js")
|
|
22
22
|
mcp("document-mcp")
|
|
23
23
|
cli("document-cli")
|
|
24
|
+
outline("document-outline.js")
|
|
24
25
|
|
|
25
26
|
schema --> ooxml
|
|
26
27
|
schema --> odf
|
|
27
28
|
schema --> pdfcodec
|
|
28
29
|
schema --> mdcodec
|
|
29
30
|
schema --> documents
|
|
31
|
+
schema --> outline
|
|
30
32
|
ooxml --> documents
|
|
31
33
|
odf --> documents
|
|
32
34
|
pdfcodec --> documents
|
|
33
35
|
mdcodec --> documents
|
|
34
36
|
bytecodec --> pdfcodec
|
|
35
37
|
bytecodec --> documents
|
|
38
|
+
pdfcodec --> outline
|
|
36
39
|
documents --> mcp
|
|
37
40
|
pdfcodec --> mcp
|
|
38
41
|
documents --> cli
|
|
39
42
|
odf --> cli
|
|
40
43
|
pdfcodec --> cli
|
|
44
|
+
outline --> mcp
|
|
45
|
+
outline --> cli
|
|
41
46
|
|
|
42
47
|
click schema "https://github.com/ExaDev/documents.js/tree/main/packages/document-schema.js" "document-schema.js"
|
|
43
48
|
click ooxml "https://github.com/ExaDev/documents.js/tree/main/packages/ooxml.js" "ooxml.js"
|
|
@@ -48,6 +53,7 @@ graph TD
|
|
|
48
53
|
click documents "https://github.com/ExaDev/documents.js" "documents.js"
|
|
49
54
|
click mcp "https://github.com/ExaDev/documents.js/tree/main/packages/document-mcp" "document-mcp"
|
|
50
55
|
click cli "https://github.com/ExaDev/documents.js/tree/main/packages/document-cli" "document-cli"
|
|
56
|
+
click outline "https://github.com/ExaDev/documents.js/tree/main/packages/document-outline.js" "document-outline.js"
|
|
51
57
|
|
|
52
58
|
style pdfcodec fill:#f9a825,stroke:#333,stroke-width:3px
|
|
53
59
|
```
|
package/dist/codec.d.cts
CHANGED
|
@@ -238,6 +238,7 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
238
238
|
pdf: "pdf";
|
|
239
239
|
epub: "epub";
|
|
240
240
|
rtf: "rtf";
|
|
241
|
+
wpd: "wpd";
|
|
241
242
|
}>;
|
|
242
243
|
xml: z.ZodString;
|
|
243
244
|
}, z.core.$strict>>;
|
|
@@ -303,6 +304,7 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
303
304
|
pdf: "pdf";
|
|
304
305
|
epub: "epub";
|
|
305
306
|
rtf: "rtf";
|
|
307
|
+
wpd: "wpd";
|
|
306
308
|
}>;
|
|
307
309
|
xml: z.ZodString;
|
|
308
310
|
}, z.core.$strict>>>;
|
package/dist/codec.d.ts
CHANGED
|
@@ -238,6 +238,7 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
238
238
|
pdf: "pdf";
|
|
239
239
|
epub: "epub";
|
|
240
240
|
rtf: "rtf";
|
|
241
|
+
wpd: "wpd";
|
|
241
242
|
}>;
|
|
242
243
|
xml: z.ZodString;
|
|
243
244
|
}, z.core.$strict>>;
|
|
@@ -303,6 +304,7 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
303
304
|
pdf: "pdf";
|
|
304
305
|
epub: "epub";
|
|
305
306
|
rtf: "rtf";
|
|
307
|
+
wpd: "wpd";
|
|
306
308
|
}>;
|
|
307
309
|
xml: z.ZodString;
|
|
308
310
|
}, z.core.$strict>>>;
|
package/dist/layout.d.cts
CHANGED
|
@@ -442,6 +442,7 @@ declare const LayoutAnnotationSchema: z.ZodObject<{
|
|
|
442
442
|
pdf: "pdf";
|
|
443
443
|
epub: "epub";
|
|
444
444
|
rtf: "rtf";
|
|
445
|
+
wpd: "wpd";
|
|
445
446
|
}>;
|
|
446
447
|
xml: z.ZodString;
|
|
447
448
|
}, z.core.$strict>>;
|
|
@@ -658,6 +659,7 @@ declare const LayoutPageSchema: z.ZodObject<{
|
|
|
658
659
|
pdf: "pdf";
|
|
659
660
|
epub: "epub";
|
|
660
661
|
rtf: "rtf";
|
|
662
|
+
wpd: "wpd";
|
|
661
663
|
}>;
|
|
662
664
|
xml: z.ZodString;
|
|
663
665
|
}, z.core.$strict>>;
|
|
@@ -999,6 +1001,7 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
999
1001
|
pdf: "pdf";
|
|
1000
1002
|
epub: "epub";
|
|
1001
1003
|
rtf: "rtf";
|
|
1004
|
+
wpd: "wpd";
|
|
1002
1005
|
}>;
|
|
1003
1006
|
xml: z.ZodString;
|
|
1004
1007
|
}, z.core.$strict>>;
|
|
@@ -1064,6 +1067,7 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
1064
1067
|
pdf: "pdf";
|
|
1065
1068
|
epub: "epub";
|
|
1066
1069
|
rtf: "rtf";
|
|
1070
|
+
wpd: "wpd";
|
|
1067
1071
|
}>;
|
|
1068
1072
|
xml: z.ZodString;
|
|
1069
1073
|
}, z.core.$strict>>>;
|
package/dist/layout.d.ts
CHANGED
|
@@ -442,6 +442,7 @@ declare const LayoutAnnotationSchema: z.ZodObject<{
|
|
|
442
442
|
pdf: "pdf";
|
|
443
443
|
epub: "epub";
|
|
444
444
|
rtf: "rtf";
|
|
445
|
+
wpd: "wpd";
|
|
445
446
|
}>;
|
|
446
447
|
xml: z.ZodString;
|
|
447
448
|
}, z.core.$strict>>;
|
|
@@ -658,6 +659,7 @@ declare const LayoutPageSchema: z.ZodObject<{
|
|
|
658
659
|
pdf: "pdf";
|
|
659
660
|
epub: "epub";
|
|
660
661
|
rtf: "rtf";
|
|
662
|
+
wpd: "wpd";
|
|
661
663
|
}>;
|
|
662
664
|
xml: z.ZodString;
|
|
663
665
|
}, z.core.$strict>>;
|
|
@@ -999,6 +1001,7 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
999
1001
|
pdf: "pdf";
|
|
1000
1002
|
epub: "epub";
|
|
1001
1003
|
rtf: "rtf";
|
|
1004
|
+
wpd: "wpd";
|
|
1002
1005
|
}>;
|
|
1003
1006
|
xml: z.ZodString;
|
|
1004
1007
|
}, z.core.$strict>>;
|
|
@@ -1064,6 +1067,7 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
1064
1067
|
pdf: "pdf";
|
|
1065
1068
|
epub: "epub";
|
|
1066
1069
|
rtf: "rtf";
|
|
1070
|
+
wpd: "wpd";
|
|
1067
1071
|
}>;
|
|
1068
1072
|
xml: z.ZodString;
|
|
1069
1073
|
}, z.core.$strict>>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pdf-codec",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.11",
|
|
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": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"packageManager": "pnpm@11.6.0",
|
|
101
101
|
"dependencies": {
|
|
102
102
|
"byte-codec": "1.4.1",
|
|
103
|
-
"document-schema.js": "7.
|
|
103
|
+
"document-schema.js": "7.5.0",
|
|
104
104
|
"fflate": "0.8.3",
|
|
105
105
|
"zod": "4.4.3"
|
|
106
106
|
},
|