js.documents 1.62.0 → 1.63.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 +39 -6
- package/dist/convert/convert.cjs +69 -17
- package/dist/convert/convert.d.cts +2 -1
- package/dist/convert/convert.d.ts +2 -1
- package/dist/convert/convert.js +70 -18
- package/dist/convert/local.cjs +15 -2
- package/dist/convert/local.js +15 -2
- package/dist/convert/port.d.cts +8 -4
- package/dist/convert/port.d.ts +8 -4
- package/dist/fonts/obfuscation.cjs +50 -0
- package/dist/fonts/obfuscation.d.cts +9 -0
- package/dist/fonts/obfuscation.d.ts +9 -0
- package/dist/fonts/obfuscation.js +46 -0
- package/dist/fonts/odf.cjs +86 -0
- package/dist/fonts/odf.d.cts +9 -0
- package/dist/fonts/odf.d.ts +9 -0
- package/dist/fonts/odf.js +84 -0
- package/dist/fonts/ooxml.cjs +129 -0
- package/dist/fonts/ooxml.d.cts +9 -0
- package/dist/fonts/ooxml.d.ts +9 -0
- package/dist/fonts/ooxml.js +127 -0
- package/dist/fonts/registry.cjs +18 -0
- package/dist/fonts/registry.d.cts +2 -0
- package/dist/fonts/registry.d.ts +2 -0
- package/dist/fonts/registry.js +16 -0
- package/dist/index.cjs +32 -0
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +6 -2
- package/dist/registry-CrSqLIcn.d.ts +19 -0
- package/dist/registry-CtPhMD0f.d.cts +19 -0
- package/package.json +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { looksLikeSfnt } from "./obfuscation.js";
|
|
2
|
+
import { attrValue, base64ToBytes, childrenWithTag, decodeXmlText, rootElement } from "odf.js";
|
|
3
|
+
import { parseSfnt } from "pdf-codec/sfnt";
|
|
4
|
+
import { parseOs2 } from "pdf-codec/font-tables";
|
|
5
|
+
//#region src/fonts/odf.ts
|
|
6
|
+
const FONT_FACE_DECL_PARTS = ["content.xml", "styles.xml"];
|
|
7
|
+
const FS_SELECTION_ITALIC = 1;
|
|
8
|
+
const FS_SELECTION_BOLD = 32;
|
|
9
|
+
const BOLD_WEIGHT_THRESHOLD = 600;
|
|
10
|
+
var OdfEmbeddedFontError = class extends Error {
|
|
11
|
+
constructor(detail) {
|
|
12
|
+
super(`extractOdfEmbeddedFonts: ${detail}`);
|
|
13
|
+
this.name = "OdfEmbeddedFontError";
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
function normaliseFamily(value) {
|
|
17
|
+
const first = decodeXmlText(value).split(",")[0]?.trim() ?? "";
|
|
18
|
+
const quoted = /^'(.*)'$|^"(.*)"$/.exec(first);
|
|
19
|
+
return (quoted?.[1] ?? quoted?.[2] ?? first).trim();
|
|
20
|
+
}
|
|
21
|
+
function boldFromWeightAttribute(weight) {
|
|
22
|
+
const keyword = weight.trim().toLowerCase();
|
|
23
|
+
if (keyword === "bold" || keyword === "bolder") return true;
|
|
24
|
+
if (keyword === "normal" || keyword === "lighter") return false;
|
|
25
|
+
const numeric = Number.parseInt(keyword, 10);
|
|
26
|
+
return Number.isNaN(numeric) ? void 0 : numeric >= BOLD_WEIGHT_THRESHOLD;
|
|
27
|
+
}
|
|
28
|
+
function italicFromStyleAttribute(style) {
|
|
29
|
+
const keyword = style.trim().toLowerCase();
|
|
30
|
+
if (keyword === "italic" || keyword === "oblique") return true;
|
|
31
|
+
return keyword === "normal" ? false : void 0;
|
|
32
|
+
}
|
|
33
|
+
function styleFromFontBytes(bytes) {
|
|
34
|
+
const font = parseSfnt(bytes);
|
|
35
|
+
if (font === void 0) return;
|
|
36
|
+
const os2 = parseOs2(font);
|
|
37
|
+
if (os2 === void 0) return;
|
|
38
|
+
return {
|
|
39
|
+
bold: (os2.fsSelection & FS_SELECTION_BOLD) !== 0,
|
|
40
|
+
italic: (os2.fsSelection & FS_SELECTION_ITALIC) !== 0
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function fontPartBytes(pkg, href) {
|
|
44
|
+
const part = pkg.parts[href];
|
|
45
|
+
if (part === void 0) throw new OdfEmbeddedFontError(`svg:font-face-uri references ${JSON.stringify(href)}, which is not a part of this package`);
|
|
46
|
+
if (part.kind !== "binary") throw new OdfEmbeddedFontError(`embedded font part ${JSON.stringify(href)} is an XML part, not binary font data`);
|
|
47
|
+
return base64ToBytes(part.base64);
|
|
48
|
+
}
|
|
49
|
+
function collectFontFace(pkg, fontFace, seenHrefs, out) {
|
|
50
|
+
const declaredFamily = attrValue(fontFace, "svg:font-family") ?? attrValue(fontFace, "style:name");
|
|
51
|
+
for (const src of childrenWithTag(fontFace, "svg:font-face-src")) for (const uri of childrenWithTag(src, "svg:font-face-uri")) {
|
|
52
|
+
const rawHref = attrValue(uri, "xlink:href");
|
|
53
|
+
if (rawHref === void 0) throw new OdfEmbeddedFontError("a <svg:font-face-uri> carries no xlink:href");
|
|
54
|
+
const href = decodeXmlText(rawHref);
|
|
55
|
+
if (seenHrefs.has(href)) continue;
|
|
56
|
+
seenHrefs.add(href);
|
|
57
|
+
if (declaredFamily === void 0) throw new OdfEmbeddedFontError(`the <style:font-face> embedding ${JSON.stringify(href)} declares neither svg:font-family nor style:name`);
|
|
58
|
+
const bytes = fontPartBytes(pkg, href);
|
|
59
|
+
if (!looksLikeSfnt(bytes)) throw new OdfEmbeddedFontError(`embedded font part ${JSON.stringify(href)} does not begin with a recognisable sfnt signature`);
|
|
60
|
+
const declaredWeight = attrValue(uri, "loext:font-weight");
|
|
61
|
+
const declaredStyle = attrValue(uri, "loext:font-style");
|
|
62
|
+
const intrinsic = styleFromFontBytes(bytes);
|
|
63
|
+
out.push({
|
|
64
|
+
family: normaliseFamily(declaredFamily),
|
|
65
|
+
bold: (declaredWeight === void 0 ? void 0 : boldFromWeightAttribute(declaredWeight)) ?? intrinsic?.bold ?? false,
|
|
66
|
+
italic: (declaredStyle === void 0 ? void 0 : italicFromStyleAttribute(declaredStyle)) ?? intrinsic?.italic ?? false,
|
|
67
|
+
bytes
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function extractOdfEmbeddedFonts(pkg) {
|
|
72
|
+
const out = [];
|
|
73
|
+
const seenHrefs = /* @__PURE__ */ new Set();
|
|
74
|
+
for (const partPath of FONT_FACE_DECL_PARTS) {
|
|
75
|
+
const part = pkg.parts[partPath];
|
|
76
|
+
if (part?.kind !== "xml") continue;
|
|
77
|
+
const root = rootElement(part.nodes);
|
|
78
|
+
if (root === void 0) continue;
|
|
79
|
+
for (const decls of childrenWithTag(root, "office:font-face-decls")) for (const fontFace of childrenWithTag(decls, "style:font-face")) collectFontFace(pkg, fontFace, seenHrefs, out);
|
|
80
|
+
}
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { OdfEmbeddedFontError, extractOdfEmbeddedFonts };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_fonts_obfuscation = require("./obfuscation.cjs");
|
|
3
|
+
let ooxml_js = require("ooxml.js");
|
|
4
|
+
//#region src/fonts/ooxml.ts
|
|
5
|
+
const OFFICE_DOCUMENT_RELATIONSHIP = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
|
|
6
|
+
const FONT_TABLE_RELATIONSHIP = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";
|
|
7
|
+
const ROOT_RELS_PART = "_rels/.rels";
|
|
8
|
+
const DOCX_EMBED_ELEMENTS = [
|
|
9
|
+
[
|
|
10
|
+
"w:embedRegular",
|
|
11
|
+
false,
|
|
12
|
+
false
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"w:embedBold",
|
|
16
|
+
true,
|
|
17
|
+
false
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"w:embedItalic",
|
|
21
|
+
false,
|
|
22
|
+
true
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"w:embedBoldItalic",
|
|
26
|
+
true,
|
|
27
|
+
true
|
|
28
|
+
]
|
|
29
|
+
];
|
|
30
|
+
const PPTX_EMBED_ELEMENTS = [
|
|
31
|
+
[
|
|
32
|
+
"p:regular",
|
|
33
|
+
false,
|
|
34
|
+
false
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
"p:bold",
|
|
38
|
+
true,
|
|
39
|
+
false
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"p:italic",
|
|
43
|
+
false,
|
|
44
|
+
true
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"p:boldItalic",
|
|
48
|
+
true,
|
|
49
|
+
true
|
|
50
|
+
]
|
|
51
|
+
];
|
|
52
|
+
var OoxmlEmbeddedFontError = class extends Error {
|
|
53
|
+
constructor(detail) {
|
|
54
|
+
super(`extractOoxmlEmbeddedFonts: ${detail}`);
|
|
55
|
+
this.name = "OoxmlEmbeddedFontError";
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
function relatedPartPath(pkg, fromPartPath, relationshipType) {
|
|
59
|
+
for (const relationship of (0, ooxml_js.resolveRelationships)(pkg, fromPartPath).values()) if (relationship.type === relationshipType && relationship.targetMode === void 0) return relationship.target;
|
|
60
|
+
}
|
|
61
|
+
function officeDocumentPartPath(pkg) {
|
|
62
|
+
const rels = (0, ooxml_js.rootElement)(pkg.parts[ROOT_RELS_PART]);
|
|
63
|
+
if (rels !== void 0) for (const relationship of (0, ooxml_js.childrenWithTag)(rels, "Relationship")) {
|
|
64
|
+
if ((0, ooxml_js.attr)(relationship, "Type") !== OFFICE_DOCUMENT_RELATIONSHIP || (0, ooxml_js.attr)(relationship, "TargetMode") !== void 0) continue;
|
|
65
|
+
const target = (0, ooxml_js.attr)(relationship, "Target");
|
|
66
|
+
if (target !== void 0) return target.startsWith("/") ? target.slice(1) : target;
|
|
67
|
+
}
|
|
68
|
+
throw new OoxmlEmbeddedFontError(`the package declares no officeDocument relationship in ${ROOT_RELS_PART}`);
|
|
69
|
+
}
|
|
70
|
+
function fontPartBytes(pkg, fromPartPath, relationships, relationshipId) {
|
|
71
|
+
const relationship = relationships.get(relationshipId);
|
|
72
|
+
if (relationship === void 0) throw new OoxmlEmbeddedFontError(`${fromPartPath} references relationship id ${JSON.stringify(relationshipId)}, which its .rels part does not declare`);
|
|
73
|
+
const part = pkg.parts[relationship.target];
|
|
74
|
+
if (part === void 0) throw new OoxmlEmbeddedFontError(`relationship id ${JSON.stringify(relationshipId)} targets ${JSON.stringify(relationship.target)}, which is not a part of this package`);
|
|
75
|
+
if (part.kind !== "binary") throw new OoxmlEmbeddedFontError(`embedded font part ${JSON.stringify(relationship.target)} is an XML part, not binary font data`);
|
|
76
|
+
return (0, ooxml_js.base64ToBytes)(part.base64);
|
|
77
|
+
}
|
|
78
|
+
function collectFaces(pkg, declaringPartPath, relationships, fontElementChildren, fontElement, family, fontKeyAttribute, out) {
|
|
79
|
+
for (const [tag, bold, italic] of fontElementChildren) for (const embed of (0, ooxml_js.childrenWithTag)(fontElement, tag)) {
|
|
80
|
+
const relationshipId = (0, ooxml_js.attr)(embed, "r:id");
|
|
81
|
+
if (relationshipId === void 0) throw new OoxmlEmbeddedFontError(`<${tag}> for font ${JSON.stringify(family)} carries no r:id`);
|
|
82
|
+
const fontKey = fontKeyAttribute === void 0 ? void 0 : (0, ooxml_js.attr)(embed, fontKeyAttribute);
|
|
83
|
+
out.push({
|
|
84
|
+
family,
|
|
85
|
+
bold,
|
|
86
|
+
italic,
|
|
87
|
+
bytes: require_fonts_obfuscation.deobfuscateEmbeddedFont(fontPartBytes(pkg, declaringPartPath, relationships, relationshipId), fontKey)
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function extractDocxFonts(pkg) {
|
|
92
|
+
const fontTablePath = relatedPartPath(pkg, officeDocumentPartPath(pkg), FONT_TABLE_RELATIONSHIP);
|
|
93
|
+
if (fontTablePath === void 0) return [];
|
|
94
|
+
const fontTablePart = pkg.parts[fontTablePath];
|
|
95
|
+
if (fontTablePart?.kind !== "xml") throw new OoxmlEmbeddedFontError(`font table part ${JSON.stringify(fontTablePath)} is missing or is not an XML part`);
|
|
96
|
+
const fonts = (0, ooxml_js.rootElement)(fontTablePart);
|
|
97
|
+
if (fonts === void 0) return [];
|
|
98
|
+
const relationships = (0, ooxml_js.resolveRelationships)(pkg, fontTablePath);
|
|
99
|
+
const out = [];
|
|
100
|
+
for (const font of (0, ooxml_js.childrenWithTag)(fonts, "w:font")) {
|
|
101
|
+
const family = (0, ooxml_js.attr)(font, "w:name");
|
|
102
|
+
if (family === void 0) throw new OoxmlEmbeddedFontError(`a <w:font> in ${JSON.stringify(fontTablePath)} carries no w:name`);
|
|
103
|
+
collectFaces(pkg, fontTablePath, relationships, DOCX_EMBED_ELEMENTS, font, (0, ooxml_js.decodeEntities)(family), "w:fontKey", out);
|
|
104
|
+
}
|
|
105
|
+
return out;
|
|
106
|
+
}
|
|
107
|
+
function extractPptxFonts(pkg) {
|
|
108
|
+
const presentationPartPath = officeDocumentPartPath(pkg);
|
|
109
|
+
const presentationPart = pkg.parts[presentationPartPath];
|
|
110
|
+
if (presentationPart?.kind !== "xml") throw new OoxmlEmbeddedFontError(`presentation part ${JSON.stringify(presentationPartPath)} is missing or is not an XML part`);
|
|
111
|
+
const presentation = (0, ooxml_js.rootElement)(presentationPart);
|
|
112
|
+
if (presentation === void 0) return [];
|
|
113
|
+
const relationships = (0, ooxml_js.resolveRelationships)(pkg, presentationPartPath);
|
|
114
|
+
const out = [];
|
|
115
|
+
for (const list of (0, ooxml_js.childrenWithTag)(presentation, "p:embeddedFontLst")) for (const embeddedFont of (0, ooxml_js.childrenWithTag)(list, "p:embeddedFont")) {
|
|
116
|
+
const fontElement = (0, ooxml_js.childrenWithTag)(embeddedFont, "p:font")[0];
|
|
117
|
+
if (fontElement === void 0) throw new OoxmlEmbeddedFontError(`a <p:embeddedFont> in ${JSON.stringify(presentationPartPath)} carries no <p:font>`);
|
|
118
|
+
const family = (0, ooxml_js.attr)(fontElement, "typeface");
|
|
119
|
+
if (family === void 0) throw new OoxmlEmbeddedFontError(`a <p:font> in ${JSON.stringify(presentationPartPath)} carries no typeface`);
|
|
120
|
+
collectFaces(pkg, presentationPartPath, relationships, PPTX_EMBED_ELEMENTS, embeddedFont, (0, ooxml_js.decodeEntities)(family), void 0, out);
|
|
121
|
+
}
|
|
122
|
+
return out;
|
|
123
|
+
}
|
|
124
|
+
function extractOoxmlEmbeddedFonts(pkg, kind) {
|
|
125
|
+
return kind === "docx" ? extractDocxFonts(pkg) : extractPptxFonts(pkg);
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
exports.OoxmlEmbeddedFontError = OoxmlEmbeddedFontError;
|
|
129
|
+
exports.extractOoxmlEmbeddedFonts = extractOoxmlEmbeddedFonts;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Package } from "ooxml.js";
|
|
2
|
+
import { ProvidedFont } from "pdf-codec";
|
|
3
|
+
//#region src/fonts/ooxml.d.ts
|
|
4
|
+
declare class OoxmlEmbeddedFontError extends Error {
|
|
5
|
+
constructor(detail: string);
|
|
6
|
+
}
|
|
7
|
+
declare function extractOoxmlEmbeddedFonts(pkg: Package, kind: 'docx' | 'pptx'): ProvidedFont[];
|
|
8
|
+
//#endregion
|
|
9
|
+
export { OoxmlEmbeddedFontError, extractOoxmlEmbeddedFonts };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Package } from "ooxml.js";
|
|
2
|
+
import { ProvidedFont } from "pdf-codec";
|
|
3
|
+
//#region src/fonts/ooxml.d.ts
|
|
4
|
+
declare class OoxmlEmbeddedFontError extends Error {
|
|
5
|
+
constructor(detail: string);
|
|
6
|
+
}
|
|
7
|
+
declare function extractOoxmlEmbeddedFonts(pkg: Package, kind: 'docx' | 'pptx'): ProvidedFont[];
|
|
8
|
+
//#endregion
|
|
9
|
+
export { OoxmlEmbeddedFontError, extractOoxmlEmbeddedFonts };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { deobfuscateEmbeddedFont } from "./obfuscation.js";
|
|
2
|
+
import { attr, base64ToBytes, childrenWithTag, decodeEntities, resolveRelationships, rootElement } from "ooxml.js";
|
|
3
|
+
//#region src/fonts/ooxml.ts
|
|
4
|
+
const OFFICE_DOCUMENT_RELATIONSHIP = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
|
|
5
|
+
const FONT_TABLE_RELATIONSHIP = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";
|
|
6
|
+
const ROOT_RELS_PART = "_rels/.rels";
|
|
7
|
+
const DOCX_EMBED_ELEMENTS = [
|
|
8
|
+
[
|
|
9
|
+
"w:embedRegular",
|
|
10
|
+
false,
|
|
11
|
+
false
|
|
12
|
+
],
|
|
13
|
+
[
|
|
14
|
+
"w:embedBold",
|
|
15
|
+
true,
|
|
16
|
+
false
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"w:embedItalic",
|
|
20
|
+
false,
|
|
21
|
+
true
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"w:embedBoldItalic",
|
|
25
|
+
true,
|
|
26
|
+
true
|
|
27
|
+
]
|
|
28
|
+
];
|
|
29
|
+
const PPTX_EMBED_ELEMENTS = [
|
|
30
|
+
[
|
|
31
|
+
"p:regular",
|
|
32
|
+
false,
|
|
33
|
+
false
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"p:bold",
|
|
37
|
+
true,
|
|
38
|
+
false
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"p:italic",
|
|
42
|
+
false,
|
|
43
|
+
true
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
"p:boldItalic",
|
|
47
|
+
true,
|
|
48
|
+
true
|
|
49
|
+
]
|
|
50
|
+
];
|
|
51
|
+
var OoxmlEmbeddedFontError = class extends Error {
|
|
52
|
+
constructor(detail) {
|
|
53
|
+
super(`extractOoxmlEmbeddedFonts: ${detail}`);
|
|
54
|
+
this.name = "OoxmlEmbeddedFontError";
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
function relatedPartPath(pkg, fromPartPath, relationshipType) {
|
|
58
|
+
for (const relationship of resolveRelationships(pkg, fromPartPath).values()) if (relationship.type === relationshipType && relationship.targetMode === void 0) return relationship.target;
|
|
59
|
+
}
|
|
60
|
+
function officeDocumentPartPath(pkg) {
|
|
61
|
+
const rels = rootElement(pkg.parts[ROOT_RELS_PART]);
|
|
62
|
+
if (rels !== void 0) for (const relationship of childrenWithTag(rels, "Relationship")) {
|
|
63
|
+
if (attr(relationship, "Type") !== OFFICE_DOCUMENT_RELATIONSHIP || attr(relationship, "TargetMode") !== void 0) continue;
|
|
64
|
+
const target = attr(relationship, "Target");
|
|
65
|
+
if (target !== void 0) return target.startsWith("/") ? target.slice(1) : target;
|
|
66
|
+
}
|
|
67
|
+
throw new OoxmlEmbeddedFontError(`the package declares no officeDocument relationship in ${ROOT_RELS_PART}`);
|
|
68
|
+
}
|
|
69
|
+
function fontPartBytes(pkg, fromPartPath, relationships, relationshipId) {
|
|
70
|
+
const relationship = relationships.get(relationshipId);
|
|
71
|
+
if (relationship === void 0) throw new OoxmlEmbeddedFontError(`${fromPartPath} references relationship id ${JSON.stringify(relationshipId)}, which its .rels part does not declare`);
|
|
72
|
+
const part = pkg.parts[relationship.target];
|
|
73
|
+
if (part === void 0) throw new OoxmlEmbeddedFontError(`relationship id ${JSON.stringify(relationshipId)} targets ${JSON.stringify(relationship.target)}, which is not a part of this package`);
|
|
74
|
+
if (part.kind !== "binary") throw new OoxmlEmbeddedFontError(`embedded font part ${JSON.stringify(relationship.target)} is an XML part, not binary font data`);
|
|
75
|
+
return base64ToBytes(part.base64);
|
|
76
|
+
}
|
|
77
|
+
function collectFaces(pkg, declaringPartPath, relationships, fontElementChildren, fontElement, family, fontKeyAttribute, out) {
|
|
78
|
+
for (const [tag, bold, italic] of fontElementChildren) for (const embed of childrenWithTag(fontElement, tag)) {
|
|
79
|
+
const relationshipId = attr(embed, "r:id");
|
|
80
|
+
if (relationshipId === void 0) throw new OoxmlEmbeddedFontError(`<${tag}> for font ${JSON.stringify(family)} carries no r:id`);
|
|
81
|
+
const fontKey = fontKeyAttribute === void 0 ? void 0 : attr(embed, fontKeyAttribute);
|
|
82
|
+
out.push({
|
|
83
|
+
family,
|
|
84
|
+
bold,
|
|
85
|
+
italic,
|
|
86
|
+
bytes: deobfuscateEmbeddedFont(fontPartBytes(pkg, declaringPartPath, relationships, relationshipId), fontKey)
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function extractDocxFonts(pkg) {
|
|
91
|
+
const fontTablePath = relatedPartPath(pkg, officeDocumentPartPath(pkg), FONT_TABLE_RELATIONSHIP);
|
|
92
|
+
if (fontTablePath === void 0) return [];
|
|
93
|
+
const fontTablePart = pkg.parts[fontTablePath];
|
|
94
|
+
if (fontTablePart?.kind !== "xml") throw new OoxmlEmbeddedFontError(`font table part ${JSON.stringify(fontTablePath)} is missing or is not an XML part`);
|
|
95
|
+
const fonts = rootElement(fontTablePart);
|
|
96
|
+
if (fonts === void 0) return [];
|
|
97
|
+
const relationships = resolveRelationships(pkg, fontTablePath);
|
|
98
|
+
const out = [];
|
|
99
|
+
for (const font of childrenWithTag(fonts, "w:font")) {
|
|
100
|
+
const family = attr(font, "w:name");
|
|
101
|
+
if (family === void 0) throw new OoxmlEmbeddedFontError(`a <w:font> in ${JSON.stringify(fontTablePath)} carries no w:name`);
|
|
102
|
+
collectFaces(pkg, fontTablePath, relationships, DOCX_EMBED_ELEMENTS, font, decodeEntities(family), "w:fontKey", out);
|
|
103
|
+
}
|
|
104
|
+
return out;
|
|
105
|
+
}
|
|
106
|
+
function extractPptxFonts(pkg) {
|
|
107
|
+
const presentationPartPath = officeDocumentPartPath(pkg);
|
|
108
|
+
const presentationPart = pkg.parts[presentationPartPath];
|
|
109
|
+
if (presentationPart?.kind !== "xml") throw new OoxmlEmbeddedFontError(`presentation part ${JSON.stringify(presentationPartPath)} is missing or is not an XML part`);
|
|
110
|
+
const presentation = rootElement(presentationPart);
|
|
111
|
+
if (presentation === void 0) return [];
|
|
112
|
+
const relationships = resolveRelationships(pkg, presentationPartPath);
|
|
113
|
+
const out = [];
|
|
114
|
+
for (const list of childrenWithTag(presentation, "p:embeddedFontLst")) for (const embeddedFont of childrenWithTag(list, "p:embeddedFont")) {
|
|
115
|
+
const fontElement = childrenWithTag(embeddedFont, "p:font")[0];
|
|
116
|
+
if (fontElement === void 0) throw new OoxmlEmbeddedFontError(`a <p:embeddedFont> in ${JSON.stringify(presentationPartPath)} carries no <p:font>`);
|
|
117
|
+
const family = attr(fontElement, "typeface");
|
|
118
|
+
if (family === void 0) throw new OoxmlEmbeddedFontError(`a <p:font> in ${JSON.stringify(presentationPartPath)} carries no typeface`);
|
|
119
|
+
collectFaces(pkg, presentationPartPath, relationships, PPTX_EMBED_ELEMENTS, embeddedFont, decodeEntities(family), void 0, out);
|
|
120
|
+
}
|
|
121
|
+
return out;
|
|
122
|
+
}
|
|
123
|
+
function extractOoxmlEmbeddedFonts(pkg, kind) {
|
|
124
|
+
return kind === "docx" ? extractDocxFonts(pkg) : extractPptxFonts(pkg);
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { OoxmlEmbeddedFontError, extractOoxmlEmbeddedFonts };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_fonts_odf = require("./odf.cjs");
|
|
3
|
+
const require_fonts_ooxml = require("./ooxml.cjs");
|
|
4
|
+
let pdf_codec = require("pdf-codec");
|
|
5
|
+
//#region src/fonts/registry.ts
|
|
6
|
+
function extractSourceFonts(source) {
|
|
7
|
+
return source.kind === "odf" ? require_fonts_odf.extractOdfEmbeddedFonts(source.package) : require_fonts_ooxml.extractOoxmlEmbeddedFonts(source.package, source.kind);
|
|
8
|
+
}
|
|
9
|
+
function createDocumentFontRegistry(source, options) {
|
|
10
|
+
return (0, pdf_codec.createFontRegistry)({
|
|
11
|
+
sourceFonts: extractSourceFonts(source),
|
|
12
|
+
fonts: options?.fonts,
|
|
13
|
+
onSubstitution: options?.onFontSubstitution
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.createDocumentFontRegistry = createDocumentFontRegistry;
|
|
18
|
+
exports.extractSourceFonts = extractSourceFonts;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { extractOdfEmbeddedFonts } from "./odf.js";
|
|
2
|
+
import { extractOoxmlEmbeddedFonts } from "./ooxml.js";
|
|
3
|
+
import { createFontRegistry } from "pdf-codec";
|
|
4
|
+
//#region src/fonts/registry.ts
|
|
5
|
+
function extractSourceFonts(source) {
|
|
6
|
+
return source.kind === "odf" ? extractOdfEmbeddedFonts(source.package) : extractOoxmlEmbeddedFonts(source.package, source.kind);
|
|
7
|
+
}
|
|
8
|
+
function createDocumentFontRegistry(source, options) {
|
|
9
|
+
return createFontRegistry({
|
|
10
|
+
sourceFonts: extractSourceFonts(source),
|
|
11
|
+
fonts: options?.fonts,
|
|
12
|
+
onSubstitution: options?.onFontSubstitution
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { createDocumentFontRegistry, extractSourceFonts };
|
package/dist/index.cjs
CHANGED
|
@@ -35,6 +35,10 @@ const require_edit_odg_vector = require("./edit/odg/vector.cjs");
|
|
|
35
35
|
const require_edit_odg_page = require("./edit/odg/page.cjs");
|
|
36
36
|
const require_edit_odg_editor = require("./edit/odg/editor.cjs");
|
|
37
37
|
const require_edit_odg_content = require("./edit/odg/content.cjs");
|
|
38
|
+
const require_fonts_obfuscation = require("./fonts/obfuscation.cjs");
|
|
39
|
+
const require_fonts_odf = require("./fonts/odf.cjs");
|
|
40
|
+
const require_fonts_ooxml = require("./fonts/ooxml.cjs");
|
|
41
|
+
const require_fonts_registry = require("./fonts/registry.cjs");
|
|
38
42
|
const require_mathml_layout = require("./mathml/layout.cjs");
|
|
39
43
|
const require_ooxml_docx_read = require("./ooxml/docx/read.cjs");
|
|
40
44
|
const require_ooxml_pptx_read = require("./ooxml/pptx/read.cjs");
|
|
@@ -311,6 +315,7 @@ exports.FirebirdCompositeRecordUnsupportedError = require_firebird_data.Firebird
|
|
|
311
315
|
exports.FirebirdDataParseError = require_firebird_data.FirebirdDataParseError;
|
|
312
316
|
exports.FirebirdSchemaParseError = require_firebird_schema.FirebirdSchemaParseError;
|
|
313
317
|
exports.FirebirdUnsupportedFieldTypeError = require_firebird_blr_types.FirebirdUnsupportedFieldTypeError;
|
|
318
|
+
exports.FontDeobfuscationError = require_fonts_obfuscation.FontDeobfuscationError;
|
|
314
319
|
exports.HsqldbBinaryScriptParseError = require_hsqldb_binary_script.HsqldbBinaryScriptParseError;
|
|
315
320
|
exports.HsqldbRowFormatError = require_hsqldb_rowformat.HsqldbRowFormatError;
|
|
316
321
|
exports.HsqldbScriptParseError = require_hsqldb_script.HsqldbScriptParseError;
|
|
@@ -337,6 +342,7 @@ exports.OdbNoEmbeddedDataSourceError = require_odb_read.OdbNoEmbeddedDataSourceE
|
|
|
337
342
|
exports.OdbTableNotFoundError = require_odb_csv.OdbTableNotFoundError;
|
|
338
343
|
exports.OdbTableNotSpecifiedError = require_odb_csv.OdbTableNotSpecifiedError;
|
|
339
344
|
exports.OdbUnsupportedFormatError = require_odb_read.OdbUnsupportedFormatError;
|
|
345
|
+
exports.OdfEmbeddedFontError = require_fonts_odf.OdfEmbeddedFontError;
|
|
340
346
|
exports.OdgBoxVector = require_edit_odg_vector.OdgBoxVector;
|
|
341
347
|
exports.OdgBytesSchema = require_model_bytes.OdgBytesSchema;
|
|
342
348
|
exports.OdgEditor = require_edit_odg_editor.OdgEditor;
|
|
@@ -361,6 +367,7 @@ exports.OdtRun = require_edit_odt_run.OdtRun;
|
|
|
361
367
|
exports.OdtTable = require_edit_odt_table.OdtTable;
|
|
362
368
|
exports.OdtTableCell = require_edit_odt_table.OdtTableCell;
|
|
363
369
|
exports.OdtTableRow = require_edit_odt_table.OdtTableRow;
|
|
370
|
+
exports.OoxmlEmbeddedFontError = require_fonts_ooxml.OoxmlEmbeddedFontError;
|
|
364
371
|
Object.defineProperty(exports, "PAGE_SIZE_A4", {
|
|
365
372
|
enumerable: true,
|
|
366
373
|
get: function() {
|
|
@@ -536,13 +543,32 @@ exports.convertDrawingToLayout = require_layout_drawing.convertDrawingToLayout;
|
|
|
536
543
|
exports.convertPresentationToLayout = require_layout_slides.convertPresentationToLayout;
|
|
537
544
|
exports.convertSpreadsheetToLayout = require_layout_sheets.convertSpreadsheetToLayout;
|
|
538
545
|
exports.convertWordprocessingToLayout = require_layout_engine.convertWordprocessingToLayout;
|
|
546
|
+
exports.createDocumentFontRegistry = require_fonts_registry.createDocumentFontRegistry;
|
|
539
547
|
exports.createDocx = require_edit_docx_editor.createDocx;
|
|
548
|
+
Object.defineProperty(exports, "createFontMeasurer", {
|
|
549
|
+
enumerable: true,
|
|
550
|
+
get: function() {
|
|
551
|
+
return pdf_codec.createFontMeasurer;
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
Object.defineProperty(exports, "createFontRegistry", {
|
|
555
|
+
enumerable: true,
|
|
556
|
+
get: function() {
|
|
557
|
+
return pdf_codec.createFontRegistry;
|
|
558
|
+
}
|
|
559
|
+
});
|
|
540
560
|
exports.createLocalDocumentConverter = require_convert_local.createLocalDocumentConverter;
|
|
541
561
|
exports.createOdg = require_edit_odg_editor.createOdg;
|
|
542
562
|
exports.createOdp = require_edit_odp_editor.createOdp;
|
|
543
563
|
exports.createOds = require_edit_ods_editor.createOds;
|
|
544
564
|
exports.createOdt = require_edit_odt_editor.createOdt;
|
|
545
565
|
exports.createPptx = require_edit_pptx_editor.createPptx;
|
|
566
|
+
Object.defineProperty(exports, "createStandardFontMeasurer", {
|
|
567
|
+
enumerable: true,
|
|
568
|
+
get: function() {
|
|
569
|
+
return pdf_codec.createStandardFontMeasurer;
|
|
570
|
+
}
|
|
571
|
+
});
|
|
546
572
|
Object.defineProperty(exports, "decodeCompactPackage", {
|
|
547
573
|
enumerable: true,
|
|
548
574
|
get: function() {
|
|
@@ -563,6 +589,8 @@ Object.defineProperty(exports, "decodePackage", {
|
|
|
563
589
|
return ooxml_js.decodePackage;
|
|
564
590
|
}
|
|
565
591
|
});
|
|
592
|
+
exports.deobfuscateEmbeddedFont = require_fonts_obfuscation.deobfuscateEmbeddedFont;
|
|
593
|
+
exports.deriveFontKey = require_fonts_obfuscation.deriveFontKey;
|
|
566
594
|
exports.detectGridLattice = require_layout_lattice.detectGridLattice;
|
|
567
595
|
Object.defineProperty(exports, "documentFromJson", {
|
|
568
596
|
enumerable: true,
|
|
@@ -608,6 +636,9 @@ Object.defineProperty(exports, "encodePackage", {
|
|
|
608
636
|
return ooxml_js.encodePackage;
|
|
609
637
|
}
|
|
610
638
|
});
|
|
639
|
+
exports.extractOdfEmbeddedFonts = require_fonts_odf.extractOdfEmbeddedFonts;
|
|
640
|
+
exports.extractOoxmlEmbeddedFonts = require_fonts_ooxml.extractOoxmlEmbeddedFonts;
|
|
641
|
+
exports.extractSourceFonts = require_fonts_registry.extractSourceFonts;
|
|
611
642
|
exports.firstChildByLocalName = require_mathml_nodes.firstChildByLocalName;
|
|
612
643
|
exports.fixedClock = require_ports_clock.fixedClock;
|
|
613
644
|
exports.flipY = require_model_geometry.flipY;
|
|
@@ -657,6 +688,7 @@ Object.defineProperty(exports, "loadMathFont", {
|
|
|
657
688
|
}
|
|
658
689
|
});
|
|
659
690
|
exports.localName = require_mathml_nodes.localName;
|
|
691
|
+
exports.looksLikeSfnt = require_fonts_obfuscation.looksLikeSfnt;
|
|
660
692
|
exports.mapMathVariant = require_mathml_variant.mapMathVariant;
|
|
661
693
|
exports.markdownDocxCodec = require_convert_codec.markdownDocxCodec;
|
|
662
694
|
exports.markdownOdtCodec = require_convert_codec.markdownOdtCodec;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { n as HsqldbDecodeOptions, r as HsqldbRowFormatError } from "./rowformat-Cl2exlEh.cjs";
|
|
2
2
|
import { c as firstChildByLocalName, d as textContent, i as MathMlText, l as isMathMlElement, n as MathMlElement, o as elementChildren, r as MathMlNode, s as elementLocalName, t as MathMlAttribute, u as localName } from "./nodes-pArN9ilm.cjs";
|
|
3
3
|
import { a as buildOfficeMathParagraph, i as buildOfficeMath, n as OmmlDiagnosticKind, r as OmmlWriteResult, t as OmmlDiagnostic } from "./write-DuyfnbL_.cjs";
|
|
4
|
+
import { i as extractSourceFonts, n as FontSourcePackage, r as createDocumentFontRegistry, t as DocumentFontRegistryOptions } from "./registry-CtPhMD0f.cjs";
|
|
4
5
|
import { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, markdownToDocx, markdownToOdt, markdownToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf } from "./convert/convert.cjs";
|
|
5
|
-
import { ConversionRequest, ConversionResult, Diagnostic, DocumentConverter, DocumentFormat, DocumentPayload } from "./convert/port.cjs";
|
|
6
|
+
import { ConversionOptions, ConversionRequest, ConversionResult, Diagnostic, DocumentConverter, DocumentFormat, DocumentPayload } from "./convert/port.cjs";
|
|
6
7
|
import { docxPdfCodec, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, odgPdfCodec, odpPdfCodec, odpPptxCodec, odsPdfCodec, odsXlsxCodec, odtDocxCodec, odtPdfCodec, pptxPdfCodec, xlsxPdfCodec } from "./convert/codec.cjs";
|
|
7
8
|
import { createLocalDocumentConverter } from "./convert/local.cjs";
|
|
8
9
|
import { BuildDocxPackageOptions, buildDocxPackage } from "./edit/docx/content.cjs";
|
|
@@ -42,6 +43,9 @@ import { D as FirebirdUnsupportedFieldTypeError } from "./blr-types-DVgO1DQ9.cjs
|
|
|
42
43
|
import { r as FirebirdSchemaParseError } from "./schema-BeR_KJ0X.cjs";
|
|
43
44
|
import { FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError } from "./firebird/data.cjs";
|
|
44
45
|
import { FirebirdBackupFormatError, FirebirdBackupSummary, ReadFirebirdBackupResult, SUPPORTED_BACKUP_FORMAT_VERSION, readFirebirdBackup } from "./firebird/backup.cjs";
|
|
46
|
+
import { FontDeobfuscationError, deobfuscateEmbeddedFont, deriveFontKey, looksLikeSfnt } from "./fonts/obfuscation.cjs";
|
|
47
|
+
import { OdfEmbeddedFontError, extractOdfEmbeddedFonts } from "./fonts/odf.cjs";
|
|
48
|
+
import { OoxmlEmbeddedFontError, extractOoxmlEmbeddedFonts } from "./fonts/ooxml.cjs";
|
|
45
49
|
import { HsqldbBinaryScript, HsqldbBinaryScriptParseError, inflateHsqldbCompressedScript, parseHsqldbBinaryScript } from "./hsqldb/binary-script.cjs";
|
|
46
50
|
import { decodeHsqldbCachedTables } from "./hsqldb/cache.cjs";
|
|
47
51
|
import { DocxBytesSchema, MarkdownBytesSchema, OdgBytesSchema, OdpBytesSchema, OdsBytesSchema, OdtBytesSchema, PdfBytesSchema, PptxBytesSchema, XlsxBytesSchema } from "./model/bytes.cjs";
|
|
@@ -78,5 +82,5 @@ import { throwIfAborted } from "./ports/abort.cjs";
|
|
|
78
82
|
import { CONTENT_FORMAT_VERSION, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocumentJson, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DocumentJsonResult, DocumentPackage, DocumentPackageJson, DocumentPackageSchema, DocumentSchemaKind, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocumentJson, LayoutDocumentSchema, LayoutEllipse, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, schemaUriFor } from "document-schema.js";
|
|
79
83
|
import { OdbComponentInfo, OdbConnectionInfo, OdbForm, OdbFormControl, OdbFormDefinition, OdbInventory, OdbQueryInfo, OdbReport, OdbReportBand, OdbReportElement, OdbReportFunction, OdbReportGroup, readOdbForm, readOdbInventory, readOdbReport, resolveOdbComponent } from "odf.js";
|
|
80
84
|
import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Package, PackageSchema, Part, PartSchema, Relationship, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElementSchema, XmlNode, XmlNodeSchema, XmlPart, XmlPartSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, attr, base64ToBytes, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, elementsWithTag, encodeCompactPackage, encodePackage, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, resolveRelationships, rootElement, serializePackage, textContent as textContent$1, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
|
|
81
|
-
import { LoadedMathFont, MathFont, MathFontDescriptorMetrics, NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfParseError, PositionedFormula, ReadPdfOptions, WinAnsiSubstitution, WritePdfOptions, loadMathFont, pdfCodec, readPdf, writePdf } from "pdf-codec";
|
|
82
|
-
export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildDocxPackageOptions, COLOR_BLACK, CONTENT_FORMAT_VERSION, type CellTypeDeclineReason, type CellTypeInference, type CellTypeInferenceResult, type CellTypeInferenceSink, type CellTypeRule, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFormat, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DocxVerticalMerge, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, type GridLattice, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutDocumentJson, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type Margins, MarkdownBytesSchema, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type SlideTableInit as OdpSlideTableInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlWriteResult, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type TextBoxInit$2 as TextBoxInit, UnrecognizedDocumentSchemaError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToDocx, markdownToOdt, markdownToPdf, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveOdbComponent, resolveRelationships, rgbHexToColor, rootElement, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
|
|
85
|
+
import { FontRegistry, FontRegistryOptions, FontSubstitution, LoadedMathFont, MathFont, MathFontDescriptorMetrics, NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfParseError, PositionedFormula, ProvidedFont, ReadPdfOptions, ResolvedFace, WinAnsiSubstitution, WritePdfOptions, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, loadMathFont, pdfCodec, readPdf, writePdf } from "pdf-codec";
|
|
86
|
+
export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildDocxPackageOptions, COLOR_BLACK, CONTENT_FORMAT_VERSION, type CellTypeDeclineReason, type CellTypeInference, type CellTypeInferenceResult, type CellTypeInferenceSink, type CellTypeRule, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionOptions, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DocxVerticalMerge, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, type FontRegistry, type FontRegistryOptions, type FontSourcePackage, type FontSubstitution, type GridLattice, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutDocumentJson, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type Margins, MarkdownBytesSchema, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdfEmbeddedFontError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type SlideTableInit as OdpSlideTableInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, type ResolvedFace, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type TextBoxInit$2 as TextBoxInit, UnrecognizedDocumentSchemaError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, looksLikeSfnt, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToDocx, markdownToOdt, markdownToPdf, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveOdbComponent, resolveRelationships, rgbHexToColor, rootElement, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
|