js.documents 1.75.2 → 1.76.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/dist/convert/convert.cjs +31 -0
- package/dist/convert/convert.d.cts +14 -2
- package/dist/convert/convert.d.ts +14 -2
- package/dist/convert/convert.js +29 -1
- package/dist/convert/document-fonts.cjs +29 -0
- package/dist/convert/document-fonts.d.cts +6 -0
- package/dist/convert/document-fonts.d.ts +6 -0
- package/dist/convert/document-fonts.js +28 -0
- package/dist/convert/from-package.cjs +32 -0
- package/dist/convert/from-package.d.cts +6 -0
- package/dist/convert/from-package.d.ts +6 -0
- package/dist/convert/from-package.js +31 -0
- package/dist/convert/port.cjs +18 -0
- package/dist/convert/port.d.cts +16 -2
- package/dist/convert/port.d.ts +16 -2
- package/dist/convert/port.js +17 -0
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +7 -2
- package/dist/metadata/read.cjs +47 -0
- package/dist/metadata/read.d.cts +9 -0
- package/dist/metadata/read.d.ts +9 -0
- package/dist/metadata/read.js +46 -0
- package/dist/metadata/write.cjs +96 -0
- package/dist/metadata/write.d.cts +14 -0
- package/dist/metadata/write.d.ts +14 -0
- package/dist/metadata/write.js +95 -0
- package/package.json +1 -1
package/dist/convert/convert.cjs
CHANGED
|
@@ -576,6 +576,34 @@ function odbToCsv(bytes, options) {
|
|
|
576
576
|
require_ports_abort.throwIfAborted(options?.signal);
|
|
577
577
|
return require_odb_csv.buildOdbTableCsv(tables, options?.table);
|
|
578
578
|
}
|
|
579
|
+
function odbReportToDocx(content, options) {
|
|
580
|
+
require_ports_abort.throwIfAborted(options?.signal);
|
|
581
|
+
return (0, ooxml_js.encodePackage)(require_edit_docx_content.buildDocxPackage(content, { onMathDiagnostic: options?.onMathDiagnostic }));
|
|
582
|
+
}
|
|
583
|
+
function odbReportToOdt(content, options) {
|
|
584
|
+
require_ports_abort.throwIfAborted(options?.signal);
|
|
585
|
+
return (0, odf_js.encodePackage)(require_edit_odt_content.buildOdtPackage(content));
|
|
586
|
+
}
|
|
587
|
+
function odbReportToPdf(content, options) {
|
|
588
|
+
require_ports_abort.throwIfAborted(options?.signal);
|
|
589
|
+
if (content.kind !== "wordprocessing") throw new Error("odbReportToPdf requires a wordprocessing ContentDocument");
|
|
590
|
+
const fonts = (0, pdf_codec.createFontRegistry)({
|
|
591
|
+
fonts: options?.fonts,
|
|
592
|
+
onSubstitution: options?.onFontSubstitution
|
|
593
|
+
});
|
|
594
|
+
const { document: layout, formulas } = require_layout_engine.convertWordprocessingToLayout(content, { measurer: (0, pdf_codec.createFontMeasurer)(fonts) });
|
|
595
|
+
options?.onDocument?.({
|
|
596
|
+
formatVersion: document_schema_js.DOCUMENT_PACKAGE_FORMAT_VERSION,
|
|
597
|
+
content,
|
|
598
|
+
layout
|
|
599
|
+
});
|
|
600
|
+
return (0, pdf_codec.writePdf)(layout, {
|
|
601
|
+
signal: options?.signal,
|
|
602
|
+
onSubstitution: options?.onSubstitution,
|
|
603
|
+
formulas,
|
|
604
|
+
fonts
|
|
605
|
+
});
|
|
606
|
+
}
|
|
579
607
|
//#endregion
|
|
580
608
|
exports.OdmUnresolvedSectionError = OdmUnresolvedSectionError;
|
|
581
609
|
exports.docxToMarkdown = docxToMarkdown;
|
|
@@ -585,6 +613,9 @@ exports.inlineOdmSectionToContentSection = inlineOdmSectionToContentSection;
|
|
|
585
613
|
exports.markdownToDocx = markdownToDocx;
|
|
586
614
|
exports.markdownToOdt = markdownToOdt;
|
|
587
615
|
exports.markdownToPdf = markdownToPdf;
|
|
616
|
+
exports.odbReportToDocx = odbReportToDocx;
|
|
617
|
+
exports.odbReportToOdt = odbReportToOdt;
|
|
618
|
+
exports.odbReportToPdf = odbReportToPdf;
|
|
588
619
|
exports.odbToCsv = odbToCsv;
|
|
589
620
|
exports.odbToXlsx = odbToXlsx;
|
|
590
621
|
exports.odfToPdf = odfToPdf;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as HsqldbDecodeOptions } from "../rowformat-Cl2exlEh.cjs";
|
|
2
2
|
import { t as OmmlDiagnostic } from "../shared-DLZ3IQUl.cjs";
|
|
3
3
|
import { t as DocumentFontRegistryOptions } from "../registry-lqJej0Jr.cjs";
|
|
4
|
-
import { ContentSection, DocumentPackage } from "document-schema.js";
|
|
4
|
+
import { ContentDocument, ContentSection, DocumentPackage } from "document-schema.js";
|
|
5
5
|
import { OdmSection, Package } from "odf.js";
|
|
6
6
|
import { PdfDiagnosticSink, WinAnsiSubstitution } from "pdf-codec";
|
|
7
7
|
//#region src/convert/convert.d.ts
|
|
@@ -69,5 +69,17 @@ interface OdbToCsvOptions extends OdbConversionOptions {
|
|
|
69
69
|
readonly table?: string;
|
|
70
70
|
}
|
|
71
71
|
declare function odbToCsv(bytes: Uint8Array<ArrayBuffer>, options?: OdbToCsvOptions): Uint8Array<ArrayBuffer>;
|
|
72
|
+
interface OdbReportToDocxOptions {
|
|
73
|
+
readonly signal?: AbortSignal;
|
|
74
|
+
readonly onMathDiagnostic?: (diagnostic: OmmlDiagnostic, context: {
|
|
75
|
+
readonly sourcePath?: string;
|
|
76
|
+
}) => void;
|
|
77
|
+
}
|
|
78
|
+
declare function odbReportToDocx(content: ContentDocument, options?: OdbReportToDocxOptions): Uint8Array<ArrayBuffer>;
|
|
79
|
+
interface OdbReportToOdtOptions {
|
|
80
|
+
readonly signal?: AbortSignal;
|
|
81
|
+
}
|
|
82
|
+
declare function odbReportToOdt(content: ContentDocument, options?: OdbReportToOdtOptions): Uint8Array<ArrayBuffer>;
|
|
83
|
+
declare function odbReportToPdf(content: ContentDocument, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
72
84
|
//#endregion
|
|
73
|
-
export { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, inlineOdmSectionToContentSection, 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 };
|
|
85
|
+
export { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, inlineOdmSectionToContentSection, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as HsqldbDecodeOptions } from "../rowformat-Cl2exlEh.js";
|
|
2
2
|
import { t as OmmlDiagnostic } from "../shared-DUOzjwcL.js";
|
|
3
3
|
import { t as DocumentFontRegistryOptions } from "../registry-CrSqLIcn.js";
|
|
4
|
-
import { ContentSection, DocumentPackage } from "document-schema.js";
|
|
4
|
+
import { ContentDocument, ContentSection, DocumentPackage } from "document-schema.js";
|
|
5
5
|
import { OdmSection, Package } from "odf.js";
|
|
6
6
|
import { PdfDiagnosticSink, WinAnsiSubstitution } from "pdf-codec";
|
|
7
7
|
//#region src/convert/convert.d.ts
|
|
@@ -69,5 +69,17 @@ interface OdbToCsvOptions extends OdbConversionOptions {
|
|
|
69
69
|
readonly table?: string;
|
|
70
70
|
}
|
|
71
71
|
declare function odbToCsv(bytes: Uint8Array<ArrayBuffer>, options?: OdbToCsvOptions): Uint8Array<ArrayBuffer>;
|
|
72
|
+
interface OdbReportToDocxOptions {
|
|
73
|
+
readonly signal?: AbortSignal;
|
|
74
|
+
readonly onMathDiagnostic?: (diagnostic: OmmlDiagnostic, context: {
|
|
75
|
+
readonly sourcePath?: string;
|
|
76
|
+
}) => void;
|
|
77
|
+
}
|
|
78
|
+
declare function odbReportToDocx(content: ContentDocument, options?: OdbReportToDocxOptions): Uint8Array<ArrayBuffer>;
|
|
79
|
+
interface OdbReportToOdtOptions {
|
|
80
|
+
readonly signal?: AbortSignal;
|
|
81
|
+
}
|
|
82
|
+
declare function odbReportToOdt(content: ContentDocument, options?: OdbReportToOdtOptions): Uint8Array<ArrayBuffer>;
|
|
83
|
+
declare function odbReportToPdf(content: ContentDocument, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
72
84
|
//#endregion
|
|
73
|
-
export { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, inlineOdmSectionToContentSection, 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 };
|
|
85
|
+
export { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, inlineOdmSectionToContentSection, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf };
|
package/dist/convert/convert.js
CHANGED
|
@@ -575,5 +575,33 @@ function odbToCsv(bytes, options) {
|
|
|
575
575
|
throwIfAborted(options?.signal);
|
|
576
576
|
return buildOdbTableCsv(tables, options?.table);
|
|
577
577
|
}
|
|
578
|
+
function odbReportToDocx(content, options) {
|
|
579
|
+
throwIfAborted(options?.signal);
|
|
580
|
+
return encodePackage(buildDocxPackage(content, { onMathDiagnostic: options?.onMathDiagnostic }));
|
|
581
|
+
}
|
|
582
|
+
function odbReportToOdt(content, options) {
|
|
583
|
+
throwIfAborted(options?.signal);
|
|
584
|
+
return encodePackage$1(buildOdtPackage(content));
|
|
585
|
+
}
|
|
586
|
+
function odbReportToPdf(content, options) {
|
|
587
|
+
throwIfAborted(options?.signal);
|
|
588
|
+
if (content.kind !== "wordprocessing") throw new Error("odbReportToPdf requires a wordprocessing ContentDocument");
|
|
589
|
+
const fonts = createFontRegistry({
|
|
590
|
+
fonts: options?.fonts,
|
|
591
|
+
onSubstitution: options?.onFontSubstitution
|
|
592
|
+
});
|
|
593
|
+
const { document: layout, formulas } = convertWordprocessingToLayout(content, { measurer: createFontMeasurer(fonts) });
|
|
594
|
+
options?.onDocument?.({
|
|
595
|
+
formatVersion: DOCUMENT_PACKAGE_FORMAT_VERSION,
|
|
596
|
+
content,
|
|
597
|
+
layout
|
|
598
|
+
});
|
|
599
|
+
return writePdf(layout, {
|
|
600
|
+
signal: options?.signal,
|
|
601
|
+
onSubstitution: options?.onSubstitution,
|
|
602
|
+
formulas,
|
|
603
|
+
fonts
|
|
604
|
+
});
|
|
605
|
+
}
|
|
578
606
|
//#endregion
|
|
579
|
-
export { OdmUnresolvedSectionError, docxToMarkdown, docxToOdt, docxToPdf, inlineOdmSectionToContentSection, 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 };
|
|
607
|
+
export { OdmUnresolvedSectionError, docxToMarkdown, docxToOdt, docxToPdf, inlineOdmSectionToContentSection, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_fonts_registry = require("../fonts/registry.cjs");
|
|
3
|
+
let ooxml_js = require("ooxml.js");
|
|
4
|
+
let odf_js = require("odf.js");
|
|
5
|
+
//#region src/convert/document-fonts.ts
|
|
6
|
+
const FONT_SOURCE_FORMATS = {
|
|
7
|
+
docx: true,
|
|
8
|
+
pptx: true,
|
|
9
|
+
odt: true,
|
|
10
|
+
odp: true,
|
|
11
|
+
ods: true,
|
|
12
|
+
odg: true
|
|
13
|
+
};
|
|
14
|
+
function isFontSourceFormat(format) {
|
|
15
|
+
return format in FONT_SOURCE_FORMATS;
|
|
16
|
+
}
|
|
17
|
+
function extractSourceFontsForFormat(format, bytes) {
|
|
18
|
+
if (!isFontSourceFormat(format)) throw new Error(`'${format}' documents carry no source-embedded font faces to extract -- expected one of docx, pptx, odt, odp, ods, odg`);
|
|
19
|
+
const source = format === "docx" || format === "pptx" ? {
|
|
20
|
+
kind: format,
|
|
21
|
+
package: (0, ooxml_js.decodePackage)(bytes)
|
|
22
|
+
} : {
|
|
23
|
+
kind: "odf",
|
|
24
|
+
package: (0, odf_js.decodePackage)(bytes)
|
|
25
|
+
};
|
|
26
|
+
return require_fonts_registry.extractSourceFonts(source);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.extractSourceFontsForFormat = extractSourceFontsForFormat;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DocumentFormat } from "./port.cjs";
|
|
2
|
+
import { ProvidedFont } from "pdf-codec";
|
|
3
|
+
//#region src/convert/document-fonts.d.ts
|
|
4
|
+
declare function extractSourceFontsForFormat(format: DocumentFormat, bytes: Uint8Array<ArrayBuffer>): readonly ProvidedFont[];
|
|
5
|
+
//#endregion
|
|
6
|
+
export { extractSourceFontsForFormat };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DocumentFormat } from "./port.js";
|
|
2
|
+
import { ProvidedFont } from "pdf-codec";
|
|
3
|
+
//#region src/convert/document-fonts.d.ts
|
|
4
|
+
declare function extractSourceFontsForFormat(format: DocumentFormat, bytes: Uint8Array<ArrayBuffer>): readonly ProvidedFont[];
|
|
5
|
+
//#endregion
|
|
6
|
+
export { extractSourceFontsForFormat };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { extractSourceFonts } from "../fonts/registry.js";
|
|
2
|
+
import { decodePackage } from "ooxml.js";
|
|
3
|
+
import { decodePackage as decodePackage$1 } from "odf.js";
|
|
4
|
+
//#region src/convert/document-fonts.ts
|
|
5
|
+
const FONT_SOURCE_FORMATS = {
|
|
6
|
+
docx: true,
|
|
7
|
+
pptx: true,
|
|
8
|
+
odt: true,
|
|
9
|
+
odp: true,
|
|
10
|
+
ods: true,
|
|
11
|
+
odg: true
|
|
12
|
+
};
|
|
13
|
+
function isFontSourceFormat(format) {
|
|
14
|
+
return format in FONT_SOURCE_FORMATS;
|
|
15
|
+
}
|
|
16
|
+
function extractSourceFontsForFormat(format, bytes) {
|
|
17
|
+
if (!isFontSourceFormat(format)) throw new Error(`'${format}' documents carry no source-embedded font faces to extract -- expected one of docx, pptx, odt, odp, ods, odg`);
|
|
18
|
+
const source = format === "docx" || format === "pptx" ? {
|
|
19
|
+
kind: format,
|
|
20
|
+
package: decodePackage(bytes)
|
|
21
|
+
} : {
|
|
22
|
+
kind: "odf",
|
|
23
|
+
package: decodePackage$1(bytes)
|
|
24
|
+
};
|
|
25
|
+
return extractSourceFonts(source);
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { extractSourceFontsForFormat };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_edit_docx_content = require("../edit/docx/content.cjs");
|
|
3
|
+
const require_edit_pptx_content = require("../edit/pptx/content.cjs");
|
|
4
|
+
const require_edit_odt_content = require("../edit/odt/content.cjs");
|
|
5
|
+
const require_edit_odp_content = require("../edit/odp/content.cjs");
|
|
6
|
+
const require_edit_ods_content = require("../edit/ods/content.cjs");
|
|
7
|
+
const require_edit_odg_content = require("../edit/odg/content.cjs");
|
|
8
|
+
const require_markdown_write = require("../markdown/write.cjs");
|
|
9
|
+
const require_markdown_text = require("../markdown/text.cjs");
|
|
10
|
+
let ooxml_js = require("ooxml.js");
|
|
11
|
+
let odf_js = require("odf.js");
|
|
12
|
+
let pdf_codec = require("pdf-codec");
|
|
13
|
+
//#region src/convert/from-package.ts
|
|
14
|
+
function buildDocumentBytes(pkg, target) {
|
|
15
|
+
if (target === "pdf") {
|
|
16
|
+
if (pkg.layout === void 0) throw new Error("this DocumentPackage has no layout -- only a package dumped from a <format>-to-pdf or pdf-to-<format> conversion carries one; a bridge conversion's own dump (e.g. odt-to-docx) never does, so 'pdf' is not a reachable target from it");
|
|
17
|
+
return (0, pdf_codec.writePdf)(pkg.layout);
|
|
18
|
+
}
|
|
19
|
+
switch (target) {
|
|
20
|
+
case "docx": return (0, ooxml_js.encodePackage)(require_edit_docx_content.buildDocxPackage(pkg.content));
|
|
21
|
+
case "pptx": return (0, ooxml_js.encodePackage)(require_edit_pptx_content.buildPptxPackage(pkg.content));
|
|
22
|
+
case "odt": return (0, odf_js.encodePackage)(require_edit_odt_content.buildOdtPackage(pkg.content));
|
|
23
|
+
case "odp": return (0, odf_js.encodePackage)(require_edit_odp_content.buildOdpPackage(pkg.content));
|
|
24
|
+
case "ods": return (0, odf_js.encodePackage)(require_edit_ods_content.buildOdsPackage(pkg.content));
|
|
25
|
+
case "odg": return (0, odf_js.encodePackage)(require_edit_odg_content.buildOdgPackage(pkg.content));
|
|
26
|
+
case "markdown": return require_markdown_text.encodeMarkdownText(require_markdown_write.buildMarkdownText(pkg.content));
|
|
27
|
+
case "xlsx": throw new Error("'xlsx' cannot be built from a DocumentPackage directly -- this package does not re-export a ContentDocument-to-xlsx builder; convert to 'ods' here, then call odsToXlsx on the result instead");
|
|
28
|
+
case "odf": throw new Error("'odf' (a standalone formula document) cannot be built from a DocumentPackage -- there is no ContentDocument-to-odf builder");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.buildDocumentBytes = buildDocumentBytes;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DocumentFormat } from "./port.cjs";
|
|
2
|
+
import { DocumentPackage } from "document-schema.js";
|
|
3
|
+
//#region src/convert/from-package.d.ts
|
|
4
|
+
declare function buildDocumentBytes(pkg: DocumentPackage, target: DocumentFormat): Uint8Array<ArrayBuffer>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { buildDocumentBytes };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DocumentFormat } from "./port.js";
|
|
2
|
+
import { DocumentPackage } from "document-schema.js";
|
|
3
|
+
//#region src/convert/from-package.d.ts
|
|
4
|
+
declare function buildDocumentBytes(pkg: DocumentPackage, target: DocumentFormat): Uint8Array<ArrayBuffer>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { buildDocumentBytes };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { buildDocxPackage } from "../edit/docx/content.js";
|
|
2
|
+
import { buildPptxPackage } from "../edit/pptx/content.js";
|
|
3
|
+
import { buildOdtPackage } from "../edit/odt/content.js";
|
|
4
|
+
import { buildOdpPackage } from "../edit/odp/content.js";
|
|
5
|
+
import { buildOdsPackage } from "../edit/ods/content.js";
|
|
6
|
+
import { buildOdgPackage } from "../edit/odg/content.js";
|
|
7
|
+
import { buildMarkdownText } from "../markdown/write.js";
|
|
8
|
+
import { encodeMarkdownText } from "../markdown/text.js";
|
|
9
|
+
import { encodePackage } from "ooxml.js";
|
|
10
|
+
import { encodePackage as encodePackage$1 } from "odf.js";
|
|
11
|
+
import { writePdf } from "pdf-codec";
|
|
12
|
+
//#region src/convert/from-package.ts
|
|
13
|
+
function buildDocumentBytes(pkg, target) {
|
|
14
|
+
if (target === "pdf") {
|
|
15
|
+
if (pkg.layout === void 0) throw new Error("this DocumentPackage has no layout -- only a package dumped from a <format>-to-pdf or pdf-to-<format> conversion carries one; a bridge conversion's own dump (e.g. odt-to-docx) never does, so 'pdf' is not a reachable target from it");
|
|
16
|
+
return writePdf(pkg.layout);
|
|
17
|
+
}
|
|
18
|
+
switch (target) {
|
|
19
|
+
case "docx": return encodePackage(buildDocxPackage(pkg.content));
|
|
20
|
+
case "pptx": return encodePackage(buildPptxPackage(pkg.content));
|
|
21
|
+
case "odt": return encodePackage$1(buildOdtPackage(pkg.content));
|
|
22
|
+
case "odp": return encodePackage$1(buildOdpPackage(pkg.content));
|
|
23
|
+
case "ods": return encodePackage$1(buildOdsPackage(pkg.content));
|
|
24
|
+
case "odg": return encodePackage$1(buildOdgPackage(pkg.content));
|
|
25
|
+
case "markdown": return encodeMarkdownText(buildMarkdownText(pkg.content));
|
|
26
|
+
case "xlsx": throw new Error("'xlsx' cannot be built from a DocumentPackage directly -- this package does not re-export a ContentDocument-to-xlsx builder; convert to 'ods' here, then call odsToXlsx on the result instead");
|
|
27
|
+
case "odf": throw new Error("'odf' (a standalone formula document) cannot be built from a DocumentPackage -- there is no ContentDocument-to-odf builder");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { buildDocumentBytes };
|
package/dist/convert/port.cjs
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/convert/port.ts
|
|
3
|
+
const DocumentFormatSchema = require("zod").z.enum([
|
|
4
|
+
"docx",
|
|
5
|
+
"pptx",
|
|
6
|
+
"xlsx",
|
|
7
|
+
"odt",
|
|
8
|
+
"odp",
|
|
9
|
+
"ods",
|
|
10
|
+
"odg",
|
|
11
|
+
"odf",
|
|
12
|
+
"markdown",
|
|
13
|
+
"pdf"
|
|
14
|
+
]);
|
|
15
|
+
const DOCUMENT_FORMATS = DocumentFormatSchema.options;
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.DOCUMENT_FORMATS = DOCUMENT_FORMATS;
|
|
18
|
+
exports.DocumentFormatSchema = DocumentFormatSchema;
|
package/dist/convert/port.d.cts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { DocumentPackage } from "document-schema.js";
|
|
2
2
|
import { FontSubstitution, ProvidedFont } from "pdf-codec";
|
|
3
|
+
import { z } from "zod";
|
|
3
4
|
//#region src/convert/port.d.ts
|
|
4
|
-
|
|
5
|
+
declare const DocumentFormatSchema: z.ZodEnum<{
|
|
6
|
+
docx: "docx";
|
|
7
|
+
pptx: "pptx";
|
|
8
|
+
xlsx: "xlsx";
|
|
9
|
+
odt: "odt";
|
|
10
|
+
odp: "odp";
|
|
11
|
+
ods: "ods";
|
|
12
|
+
odg: "odg";
|
|
13
|
+
odf: "odf";
|
|
14
|
+
markdown: "markdown";
|
|
15
|
+
pdf: "pdf";
|
|
16
|
+
}>;
|
|
17
|
+
type DocumentFormat = z.infer<typeof DocumentFormatSchema>;
|
|
18
|
+
declare const DOCUMENT_FORMATS: readonly DocumentFormat[];
|
|
5
19
|
interface DocumentPayload {
|
|
6
20
|
readonly format: DocumentFormat;
|
|
7
21
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
@@ -35,4 +49,4 @@ interface DocumentConverter {
|
|
|
35
49
|
convert(request: ConversionRequest, options: ConversionOptions): Promise<ConversionResult>;
|
|
36
50
|
}
|
|
37
51
|
//#endregion
|
|
38
|
-
export { ConversionOptions, ConversionRequest, ConversionResult, Diagnostic, DocumentConverter, DocumentFormat, DocumentPayload };
|
|
52
|
+
export { ConversionOptions, ConversionRequest, ConversionResult, DOCUMENT_FORMATS, Diagnostic, DocumentConverter, DocumentFormat, DocumentFormatSchema, DocumentPayload };
|
package/dist/convert/port.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { DocumentPackage } from "document-schema.js";
|
|
2
|
+
import { z } from "zod";
|
|
2
3
|
import { FontSubstitution, ProvidedFont } from "pdf-codec";
|
|
3
4
|
//#region src/convert/port.d.ts
|
|
4
|
-
|
|
5
|
+
declare const DocumentFormatSchema: z.ZodEnum<{
|
|
6
|
+
docx: "docx";
|
|
7
|
+
pptx: "pptx";
|
|
8
|
+
xlsx: "xlsx";
|
|
9
|
+
odt: "odt";
|
|
10
|
+
odp: "odp";
|
|
11
|
+
ods: "ods";
|
|
12
|
+
odg: "odg";
|
|
13
|
+
odf: "odf";
|
|
14
|
+
markdown: "markdown";
|
|
15
|
+
pdf: "pdf";
|
|
16
|
+
}>;
|
|
17
|
+
type DocumentFormat = z.infer<typeof DocumentFormatSchema>;
|
|
18
|
+
declare const DOCUMENT_FORMATS: readonly DocumentFormat[];
|
|
5
19
|
interface DocumentPayload {
|
|
6
20
|
readonly format: DocumentFormat;
|
|
7
21
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
@@ -35,4 +49,4 @@ interface DocumentConverter {
|
|
|
35
49
|
convert(request: ConversionRequest, options: ConversionOptions): Promise<ConversionResult>;
|
|
36
50
|
}
|
|
37
51
|
//#endregion
|
|
38
|
-
export { ConversionOptions, ConversionRequest, ConversionResult, Diagnostic, DocumentConverter, DocumentFormat, DocumentPayload };
|
|
52
|
+
export { ConversionOptions, ConversionRequest, ConversionResult, DOCUMENT_FORMATS, Diagnostic, DocumentConverter, DocumentFormat, DocumentFormatSchema, DocumentPayload };
|
package/dist/convert/port.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/convert/port.ts
|
|
3
|
+
const DocumentFormatSchema = z.enum([
|
|
4
|
+
"docx",
|
|
5
|
+
"pptx",
|
|
6
|
+
"xlsx",
|
|
7
|
+
"odt",
|
|
8
|
+
"odp",
|
|
9
|
+
"ods",
|
|
10
|
+
"odg",
|
|
11
|
+
"odf",
|
|
12
|
+
"markdown",
|
|
13
|
+
"pdf"
|
|
14
|
+
]);
|
|
15
|
+
const DOCUMENT_FORMATS = DocumentFormatSchema.options;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DOCUMENT_FORMATS, DocumentFormatSchema };
|
package/dist/index.cjs
CHANGED
|
@@ -96,7 +96,12 @@ const require_odb_formula_definition = require("./odb/formula/definition.cjs");
|
|
|
96
96
|
const require_odb_report_render = require("./odb/report/render.cjs");
|
|
97
97
|
const require_odb_report_source = require("./odb/report/source.cjs");
|
|
98
98
|
const require_odb_report_content = require("./odb/report/content.cjs");
|
|
99
|
+
const require_convert_port = require("./convert/port.cjs");
|
|
99
100
|
const require_convert_local = require("./convert/local.cjs");
|
|
101
|
+
const require_convert_from_package = require("./convert/from-package.cjs");
|
|
102
|
+
const require_convert_document_fonts = require("./convert/document-fonts.cjs");
|
|
103
|
+
const require_metadata_read = require("./metadata/read.cjs");
|
|
104
|
+
const require_metadata_write = require("./metadata/write.cjs");
|
|
100
105
|
let ooxml_js = require("ooxml.js");
|
|
101
106
|
let document_schema_js = require("document-schema.js");
|
|
102
107
|
let odf_js = require("odf.js");
|
|
@@ -311,12 +316,14 @@ Object.defineProperty(exports, "DEFAULT_LAYOUT_FONT", {
|
|
|
311
316
|
return document_schema_js.DEFAULT_LAYOUT_FONT;
|
|
312
317
|
}
|
|
313
318
|
});
|
|
319
|
+
exports.DOCUMENT_FORMATS = require_convert_port.DOCUMENT_FORMATS;
|
|
314
320
|
Object.defineProperty(exports, "DefinedNameSchema", {
|
|
315
321
|
enumerable: true,
|
|
316
322
|
get: function() {
|
|
317
323
|
return ooxml_js.DefinedNameSchema;
|
|
318
324
|
}
|
|
319
325
|
});
|
|
326
|
+
exports.DocumentFormatSchema = require_convert_port.DocumentFormatSchema;
|
|
320
327
|
Object.defineProperty(exports, "DocumentPackageSchema", {
|
|
321
328
|
enumerable: true,
|
|
322
329
|
get: function() {
|
|
@@ -557,6 +564,7 @@ Object.defineProperty(exports, "base64ToBytes", {
|
|
|
557
564
|
return ooxml_js.base64ToBytes;
|
|
558
565
|
}
|
|
559
566
|
});
|
|
567
|
+
exports.buildDocumentBytes = require_convert_from_package.buildDocumentBytes;
|
|
560
568
|
exports.buildDocxPackage = require_edit_docx_content.buildDocxPackage;
|
|
561
569
|
exports.buildDrawingBlock = require_model_embedded_drawing.buildDrawingBlock;
|
|
562
570
|
exports.buildFormulaBlock = require_model_formula.buildFormulaBlock;
|
|
@@ -709,6 +717,7 @@ exports.evaluateSelect = require_odb_sql_evaluate.evaluateSelect;
|
|
|
709
717
|
exports.extractOdfEmbeddedFonts = require_fonts_odf.extractOdfEmbeddedFonts;
|
|
710
718
|
exports.extractOoxmlEmbeddedFonts = require_fonts_ooxml.extractOoxmlEmbeddedFonts;
|
|
711
719
|
exports.extractSourceFonts = require_fonts_registry.extractSourceFonts;
|
|
720
|
+
exports.extractSourceFontsForFormat = require_convert_document_fonts.extractSourceFontsForFormat;
|
|
712
721
|
exports.firstChildByLocalName = require_mathml_nodes.firstChildByLocalName;
|
|
713
722
|
exports.fixedClock = require_ports_clock.fixedClock;
|
|
714
723
|
exports.flipY = require_model_geometry.flipY;
|
|
@@ -769,6 +778,9 @@ exports.markdownToPdf = require_convert_convert.markdownToPdf;
|
|
|
769
778
|
exports.mathMlTextContent = require_mathml_nodes.textContent;
|
|
770
779
|
exports.odbReportCommandSql = require_odb_report_source.odbReportCommandSql;
|
|
771
780
|
exports.odbReportGroupChain = require_odb_formula_definition.odbReportGroupChain;
|
|
781
|
+
exports.odbReportToDocx = require_convert_convert.odbReportToDocx;
|
|
782
|
+
exports.odbReportToOdt = require_convert_convert.odbReportToOdt;
|
|
783
|
+
exports.odbReportToPdf = require_convert_convert.odbReportToPdf;
|
|
772
784
|
exports.odbTablesToSpreadsheetDocument = require_odb_spreadsheet.odbTablesToSpreadsheetDocument;
|
|
773
785
|
exports.odbToCsv = require_convert_convert.odbToCsv;
|
|
774
786
|
exports.odbToXlsx = require_convert_convert.odbToXlsx;
|
|
@@ -837,6 +849,7 @@ exports.pdfToXlsx = require_convert_convert.pdfToXlsx;
|
|
|
837
849
|
exports.pptxPdfCodec = require_convert_codec.pptxPdfCodec;
|
|
838
850
|
exports.pptxToOdp = require_convert_convert.pptxToOdp;
|
|
839
851
|
exports.pptxToPdf = require_convert_convert.pptxToPdf;
|
|
852
|
+
exports.readDocumentMetadata = require_metadata_read.readDocumentMetadata;
|
|
840
853
|
exports.readDocxContent = require_ooxml_docx_read.readDocxContent;
|
|
841
854
|
exports.readDocxExtras = require_ooxml_docx_extras.readDocxExtras;
|
|
842
855
|
exports.readFirebirdBackup = require_firebird_backup.readFirebirdBackup;
|
|
@@ -923,6 +936,7 @@ Object.defineProperty(exports, "serializePackage", {
|
|
|
923
936
|
return ooxml_js.serializePackage;
|
|
924
937
|
}
|
|
925
938
|
});
|
|
939
|
+
exports.setDocumentMetadata = require_metadata_write.setDocumentMetadata;
|
|
926
940
|
exports.systemClock = require_ports_clock.systemClock;
|
|
927
941
|
Object.defineProperty(exports, "textContent", {
|
|
928
942
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -2,9 +2,11 @@ import { n as HsqldbDecodeOptions, r as HsqldbRowFormatError } from "./rowformat
|
|
|
2
2
|
import { i as mapMathVariant, n as applyMathVariant, r as isMathVariant, t as MathVariant } from "./variant-BMrebjMw.cjs";
|
|
3
3
|
import { n as OmmlDiagnosticKind, t as OmmlDiagnostic } from "./shared-DLZ3IQUl.cjs";
|
|
4
4
|
import { i as extractSourceFonts, n as FontSourcePackage, r as createDocumentFontRegistry, t as DocumentFontRegistryOptions } from "./registry-lqJej0Jr.cjs";
|
|
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";
|
|
6
|
-
import { ConversionOptions, ConversionRequest, ConversionResult, Diagnostic, DocumentConverter, DocumentFormat, DocumentPayload } from "./convert/port.cjs";
|
|
5
|
+
import { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, 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";
|
|
6
|
+
import { ConversionOptions, ConversionRequest, ConversionResult, DOCUMENT_FORMATS, Diagnostic, DocumentConverter, DocumentFormat, DocumentFormatSchema, DocumentPayload } from "./convert/port.cjs";
|
|
7
7
|
import { docxPdfCodec, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, odgPdfCodec, odpPdfCodec, odpPptxCodec, odsPdfCodec, odsXlsxCodec, odtDocxCodec, odtPdfCodec, pptxPdfCodec, xlsxPdfCodec } from "./convert/codec.cjs";
|
|
8
|
+
import { extractSourceFontsForFormat } from "./convert/document-fonts.cjs";
|
|
9
|
+
import { buildDocumentBytes } from "./convert/from-package.cjs";
|
|
8
10
|
import { createLocalDocumentConverter } from "./convert/local.cjs";
|
|
9
11
|
import { ClockPort, fixedClock, systemClock } from "./ports/clock.cjs";
|
|
10
12
|
import { BuildDocxPackageOptions, buildDocxPackage } from "./edit/docx/content.cjs";
|
|
@@ -107,9 +109,11 @@ import { RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedE
|
|
|
107
109
|
import { OdbReportContentOptions, OdbReportNotSpecifiedError, readOdbReportContent } from "./odb/report/content.cjs";
|
|
108
110
|
import { renderOdbReportContent } from "./odb/report/render.cjs";
|
|
109
111
|
import { OdbReportDataSourceError, odbReportCommandSql, resolveOdbReportRows } from "./odb/report/source.cjs";
|
|
112
|
+
import { ReadDocumentMetadataOptions, readDocumentMetadata } from "./metadata/read.cjs";
|
|
113
|
+
import { MetadataOverrides, SetDocumentMetadataOptions, setDocumentMetadata } from "./metadata/write.cjs";
|
|
110
114
|
import { throwIfAborted } from "./ports/abort.cjs";
|
|
111
115
|
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";
|
|
112
116
|
import { OdbComponentInfo, OdbConnectionInfo, OdbForm, OdbFormControl, OdbFormDefinition, OdbInventory, OdbQueryInfo, OdbReport, OdbReportBand, OdbReportElement, OdbReportFunction, OdbReportGroup, readOdbForm, readOdbInventory, readOdbReport, resolveOdbComponent } from "odf.js";
|
|
113
117
|
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";
|
|
114
118
|
import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Footnote, FootnoteSchema, NumberingDefinition, NumberingDefinitionSchema, NumberingDefinitions, NumberingLevel, NumberingLevelSchema, 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";
|
|
115
|
-
export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, 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, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptxOptions, 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, type DocxExtras, 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 Footnote, FootnoteSchema, type GridLattice, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, 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, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, MarkdownParagraph, type ParagraphInit as MarkdownParagraphInit, MarkdownRun, type RunInit as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, 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 OdgVector, type OdgVectorKind, 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$1 as OdtParagraphInit, OdtRun, type RunInit$1 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$1 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, 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, collectOfficeMathElements, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, evaluateRptBandOutsideData, evaluateSelect, 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, odbReportCommandSql, odbReportGroupChain, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRptFormula, parseSelect, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readDocxExtras, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderOdbReportContent, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, runRptReport, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
|
|
119
|
+
export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, 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, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptxOptions, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, DocumentFormatSchema, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, type DocxExtras, 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 Footnote, FootnoteSchema, type GridLattice, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, 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, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, MarkdownParagraph, type ParagraphInit as MarkdownParagraphInit, MarkdownRun, type RunInit as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, type MetadataOverrides, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, type OdbReportToDocxOptions, type OdbReportToOdtOptions, 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 OdgVector, type OdgVectorKind, 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$1 as OdtParagraphInit, OdtRun, type RunInit$1 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$1 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadDocumentMetadataOptions, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SetDocumentMetadataOptions, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, 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, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, collectOfficeMathElements, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, 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, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRptFormula, parseSelect, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocumentMetadata, readDocxContent, readDocxExtras, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderOdbReportContent, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ import { n as HsqldbDecodeOptions, r as HsqldbRowFormatError } from "./rowformat
|
|
|
2
2
|
import { i as mapMathVariant, n as applyMathVariant, r as isMathVariant, t as MathVariant } from "./variant-BMrebjMw.js";
|
|
3
3
|
import { n as OmmlDiagnosticKind, t as OmmlDiagnostic } from "./shared-DUOzjwcL.js";
|
|
4
4
|
import { i as extractSourceFonts, n as FontSourcePackage, r as createDocumentFontRegistry, t as DocumentFontRegistryOptions } from "./registry-CrSqLIcn.js";
|
|
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.js";
|
|
6
|
-
import { ConversionOptions, ConversionRequest, ConversionResult, Diagnostic, DocumentConverter, DocumentFormat, DocumentPayload } from "./convert/port.js";
|
|
5
|
+
import { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, 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.js";
|
|
6
|
+
import { ConversionOptions, ConversionRequest, ConversionResult, DOCUMENT_FORMATS, Diagnostic, DocumentConverter, DocumentFormat, DocumentFormatSchema, DocumentPayload } from "./convert/port.js";
|
|
7
7
|
import { docxPdfCodec, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, odgPdfCodec, odpPdfCodec, odpPptxCodec, odsPdfCodec, odsXlsxCodec, odtDocxCodec, odtPdfCodec, pptxPdfCodec, xlsxPdfCodec } from "./convert/codec.js";
|
|
8
|
+
import { extractSourceFontsForFormat } from "./convert/document-fonts.js";
|
|
9
|
+
import { buildDocumentBytes } from "./convert/from-package.js";
|
|
8
10
|
import { createLocalDocumentConverter } from "./convert/local.js";
|
|
9
11
|
import { ClockPort, fixedClock, systemClock } from "./ports/clock.js";
|
|
10
12
|
import { BuildDocxPackageOptions, buildDocxPackage } from "./edit/docx/content.js";
|
|
@@ -107,9 +109,11 @@ import { RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedE
|
|
|
107
109
|
import { OdbReportContentOptions, OdbReportNotSpecifiedError, readOdbReportContent } from "./odb/report/content.js";
|
|
108
110
|
import { renderOdbReportContent } from "./odb/report/render.js";
|
|
109
111
|
import { OdbReportDataSourceError, odbReportCommandSql, resolveOdbReportRows } from "./odb/report/source.js";
|
|
112
|
+
import { ReadDocumentMetadataOptions, readDocumentMetadata } from "./metadata/read.js";
|
|
113
|
+
import { MetadataOverrides, SetDocumentMetadataOptions, setDocumentMetadata } from "./metadata/write.js";
|
|
110
114
|
import { throwIfAborted } from "./ports/abort.js";
|
|
111
115
|
import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Footnote, FootnoteSchema, NumberingDefinition, NumberingDefinitionSchema, NumberingDefinitions, NumberingLevel, NumberingLevelSchema, 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";
|
|
112
116
|
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";
|
|
113
117
|
import { OdbComponentInfo, OdbConnectionInfo, OdbForm, OdbFormControl, OdbFormDefinition, OdbInventory, OdbQueryInfo, OdbReport, OdbReportBand, OdbReportElement, OdbReportFunction, OdbReportGroup, readOdbForm, readOdbInventory, readOdbReport, resolveOdbComponent } from "odf.js";
|
|
114
118
|
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";
|
|
115
|
-
export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, 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, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptxOptions, 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, type DocxExtras, 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 Footnote, FootnoteSchema, type GridLattice, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, 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, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, MarkdownParagraph, type ParagraphInit as MarkdownParagraphInit, MarkdownRun, type RunInit as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, 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 OdgVector, type OdgVectorKind, 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$1 as OdtParagraphInit, OdtRun, type RunInit$1 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$1 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, 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, collectOfficeMathElements, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, evaluateRptBandOutsideData, evaluateSelect, 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, odbReportCommandSql, odbReportGroupChain, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRptFormula, parseSelect, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readDocxExtras, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderOdbReportContent, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, runRptReport, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
|
|
119
|
+
export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, 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, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptxOptions, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, DocumentFormatSchema, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, type DocxExtras, 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 Footnote, FootnoteSchema, type GridLattice, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, 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, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, MarkdownParagraph, type ParagraphInit as MarkdownParagraphInit, MarkdownRun, type RunInit as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, type MetadataOverrides, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, type OdbReportToDocxOptions, type OdbReportToOdtOptions, 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 OdgVector, type OdgVectorKind, 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$1 as OdtParagraphInit, OdtRun, type RunInit$1 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$1 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadDocumentMetadataOptions, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SetDocumentMetadataOptions, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, 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, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, collectOfficeMathElements, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, 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, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRptFormula, parseSelect, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocumentMetadata, readDocxContent, readDocxExtras, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderOdbReportContent, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
|
package/dist/index.js
CHANGED
|
@@ -83,7 +83,7 @@ import { FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError } from
|
|
|
83
83
|
import { FirebirdBackupFormatError, SUPPORTED_BACKUP_FORMAT_VERSION, readFirebirdBackup } from "./firebird/backup.js";
|
|
84
84
|
import { OdbNoEmbeddedDataSourceError, OdbUnsupportedFormatError, readOdbTables } from "./odb/read.js";
|
|
85
85
|
import { odbTablesToSpreadsheetDocument } from "./odb/spreadsheet.js";
|
|
86
|
-
import { OdmUnresolvedSectionError, 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.js";
|
|
86
|
+
import { OdmUnresolvedSectionError, docxToMarkdown, docxToOdt, docxToPdf, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, 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.js";
|
|
87
87
|
import { docxPdfCodec, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, odgPdfCodec, odpPdfCodec, odpPptxCodec, odsPdfCodec, odsXlsxCodec, odtDocxCodec, odtPdfCodec, pptxPdfCodec, xlsxPdfCodec } from "./convert/codec.js";
|
|
88
88
|
import { readOdbForms, readOdbReports } from "./odb/components.js";
|
|
89
89
|
import { HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError } from "./odb/sql/errors.js";
|
|
@@ -97,9 +97,14 @@ import { odbReportGroupChain, rptBandDefinition, rptDefinitionFromReport } from
|
|
|
97
97
|
import { renderOdbReportContent } from "./odb/report/render.js";
|
|
98
98
|
import { OdbReportDataSourceError, odbReportCommandSql, resolveOdbReportRows } from "./odb/report/source.js";
|
|
99
99
|
import { OdbReportNotSpecifiedError, readOdbReportContent } from "./odb/report/content.js";
|
|
100
|
+
import { DOCUMENT_FORMATS, DocumentFormatSchema } from "./convert/port.js";
|
|
100
101
|
import { createLocalDocumentConverter } from "./convert/local.js";
|
|
102
|
+
import { buildDocumentBytes } from "./convert/from-package.js";
|
|
103
|
+
import { extractSourceFontsForFormat } from "./convert/document-fonts.js";
|
|
104
|
+
import { readDocumentMetadata } from "./metadata/read.js";
|
|
105
|
+
import { setDocumentMetadata } from "./metadata/write.js";
|
|
101
106
|
import { AttributeSchema, BinaryPartSchema, CommentSchema, CompactPackageSchema, CompactPartSchema, CompactXmlNodeSchema, DefinedNameSchema, FootnoteSchema, NumberingDefinitionSchema, NumberingLevelSchema, PackageSchema, PartSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, 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";
|
|
102
107
|
import { CONTENT_FORMAT_VERSION, ContentBlockSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DocumentPackageSchema, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, schemaUriFor } from "document-schema.js";
|
|
103
108
|
import { readOdbForm, readOdbInventory, readOdbReport, resolveOdbComponent } from "odf.js";
|
|
104
109
|
import { NOOP_DIAGNOSTIC_SINK, PdfEncryptedError, PdfParseError, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, loadMathFont, pdfCodec, readPdf, writePdf } from "pdf-codec";
|
|
105
|
-
export { AttributeSchema, BinaryPartSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, CommentSchema, CompactPackageSchema, CompactPartSchema, CompactXmlNodeSchema, ContentBlockSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DefinedNameSchema, DocumentPackageSchema, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, FootnoteSchema, HsqldbBinaryScriptParseError, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, MarkdownBytesSchema, MarkdownEditor, MarkdownList, MarkdownParagraph, MarkdownRun, MarkdownTable, MarkdownTableCell, MarkdownTableRow, NOOP_DIAGNOSTIC_SINK, NumberingDefinitionSchema, NumberingLevelSchema, OdbNoEmbeddedDataSourceError, OdbReportDataSourceError, OdbReportNotSpecifiedError, OdbTableNotFoundError, OdbTableNotSpecifiedError, OdbUnsupportedFormatError, OdfEmbeddedFontError, OdgBoxVector, OdgBytesSchema, OdgEditor, OdgLineVector, OdgPage, OdgPathVector, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, OdtRun, OdtTable, OdtTableCell, OdtTableRow, OoxmlEmbeddedFontError, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PackageSchema, PartSchema, PdfBytesSchema, PdfEditor, PdfEllipseItem, PdfEncryptedError, PdfImageItem, PdfLineItem, PdfLinkItem, PdfPage, PdfParseError, PdfPathItem, PdfRectItem, PdfTextItem, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, PptxTableRow, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, RptReportStructureError, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, XlsxBytesSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, collectOfficeMathElements, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, evaluateRptBandOutsideData, evaluateSelect, 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, odbReportCommandSql, odbReportGroupChain, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRptFormula, parseSelect, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readDocxExtras, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderOdbReportContent, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, runRptReport, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
|
|
110
|
+
export { AttributeSchema, BinaryPartSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, CommentSchema, CompactPackageSchema, CompactPartSchema, CompactXmlNodeSchema, ContentBlockSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, DefinedNameSchema, DocumentFormatSchema, DocumentPackageSchema, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, FootnoteSchema, HsqldbBinaryScriptParseError, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, MarkdownBytesSchema, MarkdownEditor, MarkdownList, MarkdownParagraph, MarkdownRun, MarkdownTable, MarkdownTableCell, MarkdownTableRow, NOOP_DIAGNOSTIC_SINK, NumberingDefinitionSchema, NumberingLevelSchema, OdbNoEmbeddedDataSourceError, OdbReportDataSourceError, OdbReportNotSpecifiedError, OdbTableNotFoundError, OdbTableNotSpecifiedError, OdbUnsupportedFormatError, OdfEmbeddedFontError, OdgBoxVector, OdgBytesSchema, OdgEditor, OdgLineVector, OdgPage, OdgPathVector, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, OdtRun, OdtTable, OdtTableCell, OdtTableRow, OoxmlEmbeddedFontError, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PackageSchema, PartSchema, PdfBytesSchema, PdfEditor, PdfEllipseItem, PdfEncryptedError, PdfImageItem, PdfLineItem, PdfLinkItem, PdfPage, PdfParseError, PdfPathItem, PdfRectItem, PdfTextItem, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, PptxTableRow, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, RptReportStructureError, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, XlsxBytesSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, collectOfficeMathElements, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, 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, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRptFormula, parseSelect, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocumentMetadata, readDocxContent, readDocxExtras, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderOdbReportContent, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_markdown_read = require("../markdown/read.cjs");
|
|
3
|
+
const require_ooxml_docx_read = require("../ooxml/docx/read.cjs");
|
|
4
|
+
const require_ooxml_pptx_read = require("../ooxml/pptx/read.cjs");
|
|
5
|
+
const require_odf_formula_read = require("../odf/formula/read.cjs");
|
|
6
|
+
const require_odf_odt_read = require("../odf/odt/read.cjs");
|
|
7
|
+
const require_odf_odp_read = require("../odf/odp/read.cjs");
|
|
8
|
+
const require_odf_ods_read = require("../odf/ods/read.cjs");
|
|
9
|
+
const require_odf_odg_read = require("../odf/odg/read.cjs");
|
|
10
|
+
const require_markdown_text = require("../markdown/text.cjs");
|
|
11
|
+
const require_ports_abort = require("../ports/abort.cjs");
|
|
12
|
+
const require_convert_convert = require("../convert/convert.cjs");
|
|
13
|
+
let ooxml_js = require("ooxml.js");
|
|
14
|
+
let odf_js = require("odf.js");
|
|
15
|
+
let pdf_codec = require("pdf-codec");
|
|
16
|
+
//#region src/metadata/read.ts
|
|
17
|
+
function readDocumentMetadata(format, bytes, options) {
|
|
18
|
+
const signal = options?.signal;
|
|
19
|
+
switch (format) {
|
|
20
|
+
case "docx":
|
|
21
|
+
require_ports_abort.throwIfAborted(signal);
|
|
22
|
+
return require_ooxml_docx_read.readDocxContent((0, ooxml_js.decodePackage)(bytes)).metadata;
|
|
23
|
+
case "pptx":
|
|
24
|
+
require_ports_abort.throwIfAborted(signal);
|
|
25
|
+
return require_ooxml_pptx_read.readPptxContent((0, ooxml_js.decodePackage)(bytes)).metadata;
|
|
26
|
+
case "odt":
|
|
27
|
+
require_ports_abort.throwIfAborted(signal);
|
|
28
|
+
return require_odf_odt_read.readOdtContent((0, odf_js.decodePackage)(bytes)).metadata;
|
|
29
|
+
case "odp":
|
|
30
|
+
require_ports_abort.throwIfAborted(signal);
|
|
31
|
+
return require_odf_odp_read.readOdpContent((0, odf_js.decodePackage)(bytes)).metadata;
|
|
32
|
+
case "ods":
|
|
33
|
+
require_ports_abort.throwIfAborted(signal);
|
|
34
|
+
return require_odf_ods_read.readOdsContent((0, odf_js.decodePackage)(bytes)).metadata;
|
|
35
|
+
case "odg":
|
|
36
|
+
require_ports_abort.throwIfAborted(signal);
|
|
37
|
+
return require_odf_odg_read.readOdgContent((0, odf_js.decodePackage)(bytes)).metadata;
|
|
38
|
+
case "odf":
|
|
39
|
+
require_ports_abort.throwIfAborted(signal);
|
|
40
|
+
return require_odf_formula_read.readOdfFormulaContent((0, odf_js.decodePackage)(bytes)).metadata;
|
|
41
|
+
case "markdown": return require_markdown_read.readMarkdownContent(require_markdown_text.decodeMarkdownText(bytes), { signal }).metadata;
|
|
42
|
+
case "pdf": return (0, pdf_codec.readPdf)(bytes, { signal }).metadata;
|
|
43
|
+
case "xlsx": return (0, pdf_codec.readPdf)(require_convert_convert.xlsxToPdf(bytes, { signal }), { signal }).metadata;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
exports.readDocumentMetadata = readDocumentMetadata;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DocumentFormat } from "../convert/port.cjs";
|
|
2
|
+
import { LayoutMetadata } from "document-schema.js";
|
|
3
|
+
//#region src/metadata/read.d.ts
|
|
4
|
+
interface ReadDocumentMetadataOptions {
|
|
5
|
+
readonly signal?: AbortSignal;
|
|
6
|
+
}
|
|
7
|
+
declare function readDocumentMetadata(format: DocumentFormat, bytes: Uint8Array<ArrayBuffer>, options?: ReadDocumentMetadataOptions): LayoutMetadata;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ReadDocumentMetadataOptions, readDocumentMetadata };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DocumentFormat } from "../convert/port.js";
|
|
2
|
+
import { LayoutMetadata } from "document-schema.js";
|
|
3
|
+
//#region src/metadata/read.d.ts
|
|
4
|
+
interface ReadDocumentMetadataOptions {
|
|
5
|
+
readonly signal?: AbortSignal;
|
|
6
|
+
}
|
|
7
|
+
declare function readDocumentMetadata(format: DocumentFormat, bytes: Uint8Array<ArrayBuffer>, options?: ReadDocumentMetadataOptions): LayoutMetadata;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ReadDocumentMetadataOptions, readDocumentMetadata };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { readMarkdownContent } from "../markdown/read.js";
|
|
2
|
+
import { readDocxContent } from "../ooxml/docx/read.js";
|
|
3
|
+
import { readPptxContent } from "../ooxml/pptx/read.js";
|
|
4
|
+
import { readOdfFormulaContent } from "../odf/formula/read.js";
|
|
5
|
+
import { readOdtContent } from "../odf/odt/read.js";
|
|
6
|
+
import { readOdpContent } from "../odf/odp/read.js";
|
|
7
|
+
import { readOdsContent } from "../odf/ods/read.js";
|
|
8
|
+
import { readOdgContent } from "../odf/odg/read.js";
|
|
9
|
+
import { decodeMarkdownText } from "../markdown/text.js";
|
|
10
|
+
import { throwIfAborted } from "../ports/abort.js";
|
|
11
|
+
import { xlsxToPdf } from "../convert/convert.js";
|
|
12
|
+
import { decodePackage } from "ooxml.js";
|
|
13
|
+
import { decodePackage as decodePackage$1 } from "odf.js";
|
|
14
|
+
import { readPdf } from "pdf-codec";
|
|
15
|
+
//#region src/metadata/read.ts
|
|
16
|
+
function readDocumentMetadata(format, bytes, options) {
|
|
17
|
+
const signal = options?.signal;
|
|
18
|
+
switch (format) {
|
|
19
|
+
case "docx":
|
|
20
|
+
throwIfAborted(signal);
|
|
21
|
+
return readDocxContent(decodePackage(bytes)).metadata;
|
|
22
|
+
case "pptx":
|
|
23
|
+
throwIfAborted(signal);
|
|
24
|
+
return readPptxContent(decodePackage(bytes)).metadata;
|
|
25
|
+
case "odt":
|
|
26
|
+
throwIfAborted(signal);
|
|
27
|
+
return readOdtContent(decodePackage$1(bytes)).metadata;
|
|
28
|
+
case "odp":
|
|
29
|
+
throwIfAborted(signal);
|
|
30
|
+
return readOdpContent(decodePackage$1(bytes)).metadata;
|
|
31
|
+
case "ods":
|
|
32
|
+
throwIfAborted(signal);
|
|
33
|
+
return readOdsContent(decodePackage$1(bytes)).metadata;
|
|
34
|
+
case "odg":
|
|
35
|
+
throwIfAborted(signal);
|
|
36
|
+
return readOdgContent(decodePackage$1(bytes)).metadata;
|
|
37
|
+
case "odf":
|
|
38
|
+
throwIfAborted(signal);
|
|
39
|
+
return readOdfFormulaContent(decodePackage$1(bytes)).metadata;
|
|
40
|
+
case "markdown": return readMarkdownContent(decodeMarkdownText(bytes), { signal }).metadata;
|
|
41
|
+
case "pdf": return readPdf(bytes, { signal }).metadata;
|
|
42
|
+
case "xlsx": return readPdf(xlsxToPdf(bytes, { signal }), { signal }).metadata;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { readDocumentMetadata };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_edit_docx_content = require("../edit/docx/content.cjs");
|
|
3
|
+
const require_edit_pptx_content = require("../edit/pptx/content.cjs");
|
|
4
|
+
const require_edit_odt_content = require("../edit/odt/content.cjs");
|
|
5
|
+
const require_edit_odp_content = require("../edit/odp/content.cjs");
|
|
6
|
+
const require_edit_ods_content = require("../edit/ods/content.cjs");
|
|
7
|
+
const require_edit_odg_content = require("../edit/odg/content.cjs");
|
|
8
|
+
const require_markdown_read = require("../markdown/read.cjs");
|
|
9
|
+
const require_markdown_write = require("../markdown/write.cjs");
|
|
10
|
+
const require_ooxml_docx_read = require("../ooxml/docx/read.cjs");
|
|
11
|
+
const require_ooxml_pptx_read = require("../ooxml/pptx/read.cjs");
|
|
12
|
+
const require_odf_odt_read = require("../odf/odt/read.cjs");
|
|
13
|
+
const require_odf_odp_read = require("../odf/odp/read.cjs");
|
|
14
|
+
const require_odf_ods_read = require("../odf/ods/read.cjs");
|
|
15
|
+
const require_odf_odg_read = require("../odf/odg/read.cjs");
|
|
16
|
+
const require_markdown_text = require("../markdown/text.cjs");
|
|
17
|
+
const require_ports_abort = require("../ports/abort.cjs");
|
|
18
|
+
let ooxml_js = require("ooxml.js");
|
|
19
|
+
let odf_js = require("odf.js");
|
|
20
|
+
let pdf_codec = require("pdf-codec");
|
|
21
|
+
//#region src/metadata/write.ts
|
|
22
|
+
const REBUILD_FORMATS = {
|
|
23
|
+
docx: true,
|
|
24
|
+
pptx: true,
|
|
25
|
+
odt: true,
|
|
26
|
+
odp: true,
|
|
27
|
+
ods: true,
|
|
28
|
+
odg: true,
|
|
29
|
+
markdown: true
|
|
30
|
+
};
|
|
31
|
+
function isRebuildFormat(format) {
|
|
32
|
+
return format in REBUILD_FORMATS;
|
|
33
|
+
}
|
|
34
|
+
function readContentForFormat(format, bytes) {
|
|
35
|
+
switch (format) {
|
|
36
|
+
case "docx": return require_ooxml_docx_read.readDocxContent((0, ooxml_js.decodePackage)(bytes));
|
|
37
|
+
case "pptx": return require_ooxml_pptx_read.readPptxContent((0, ooxml_js.decodePackage)(bytes));
|
|
38
|
+
case "odt": return require_odf_odt_read.readOdtContent((0, odf_js.decodePackage)(bytes));
|
|
39
|
+
case "odp": return require_odf_odp_read.readOdpContent((0, odf_js.decodePackage)(bytes));
|
|
40
|
+
case "ods": return require_odf_ods_read.readOdsContent((0, odf_js.decodePackage)(bytes));
|
|
41
|
+
case "odg": return require_odf_odg_read.readOdgContent((0, odf_js.decodePackage)(bytes));
|
|
42
|
+
case "markdown": return require_markdown_read.readMarkdownContent(require_markdown_text.decodeMarkdownText(bytes));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function buildBytesForRebuildFormat(format, content) {
|
|
46
|
+
switch (format) {
|
|
47
|
+
case "docx": return (0, ooxml_js.encodePackage)(require_edit_docx_content.buildDocxPackage(content));
|
|
48
|
+
case "pptx": return (0, ooxml_js.encodePackage)(require_edit_pptx_content.buildPptxPackage(content));
|
|
49
|
+
case "odt": return (0, odf_js.encodePackage)(require_edit_odt_content.buildOdtPackage(content));
|
|
50
|
+
case "odp": return (0, odf_js.encodePackage)(require_edit_odp_content.buildOdpPackage(content));
|
|
51
|
+
case "ods": return (0, odf_js.encodePackage)(require_edit_ods_content.buildOdsPackage(content));
|
|
52
|
+
case "odg": return (0, odf_js.encodePackage)(require_edit_odg_content.buildOdgPackage(content));
|
|
53
|
+
case "markdown": return require_markdown_text.encodeMarkdownText(require_markdown_write.buildMarkdownText(content));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function mergeMetadata(current, overrides) {
|
|
57
|
+
return {
|
|
58
|
+
...current,
|
|
59
|
+
...overrides.title !== void 0 ? { title: overrides.title } : {},
|
|
60
|
+
...overrides.author !== void 0 ? { author: overrides.author } : {},
|
|
61
|
+
...overrides.subject !== void 0 ? { subject: overrides.subject } : {},
|
|
62
|
+
...overrides.keywords !== void 0 ? { keywords: overrides.keywords } : {}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function classifyWritePath(source, target) {
|
|
66
|
+
if (source === "pdf" && target === "pdf") return { kind: "pdf" };
|
|
67
|
+
if (target === "xlsx" || source === "xlsx") return { errorMessage: "'xlsx' is not a supported setDocumentMetadata source or target -- this package does not re-export a ContentDocument-to-xlsx builder or a readXlsxContent from its own public surface (see the README's Architecture section); convert via xlsxToOds/odsToXlsx first, then set metadata on the ods" };
|
|
68
|
+
if (target === "odf" || source === "odf") return { errorMessage: "'odf' (a standalone formula document) is not a supported setDocumentMetadata source or target -- it has no write path back out at all" };
|
|
69
|
+
if (!isRebuildFormat(source) || !isRebuildFormat(target)) return { errorMessage: `setDocumentMetadata only patches metadata in place; it does not convert format -- source ('${source}') and target ('${target}') must be the same format (or both 'pdf'). Convert first if you need a different target format.` };
|
|
70
|
+
if (source !== target) return { errorMessage: `setDocumentMetadata only patches metadata in place; it does not convert format -- source ('${source}') and target ('${target}') must be the same format. Convert first if you need a different target format.` };
|
|
71
|
+
return {
|
|
72
|
+
kind: "rebuild",
|
|
73
|
+
format: source
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function setDocumentMetadata(sourceFormat, targetFormat, bytes, overrides, options) {
|
|
77
|
+
const writePath = classifyWritePath(sourceFormat, targetFormat);
|
|
78
|
+
if ("errorMessage" in writePath) throw new Error(writePath.errorMessage);
|
|
79
|
+
require_ports_abort.throwIfAborted(options?.signal);
|
|
80
|
+
if (writePath.kind === "pdf") {
|
|
81
|
+
const layout = (0, pdf_codec.readPdf)(bytes, { signal: options?.signal });
|
|
82
|
+
const patched = {
|
|
83
|
+
...layout,
|
|
84
|
+
metadata: mergeMetadata(layout.metadata, overrides)
|
|
85
|
+
};
|
|
86
|
+
return (0, pdf_codec.writePdf)(patched, { signal: options?.signal });
|
|
87
|
+
}
|
|
88
|
+
const content = readContentForFormat(writePath.format, bytes);
|
|
89
|
+
const nextContent = {
|
|
90
|
+
...content,
|
|
91
|
+
metadata: mergeMetadata(content.metadata, overrides)
|
|
92
|
+
};
|
|
93
|
+
return buildBytesForRebuildFormat(writePath.format, nextContent);
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
exports.setDocumentMetadata = setDocumentMetadata;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DocumentFormat } from "../convert/port.cjs";
|
|
2
|
+
//#region src/metadata/write.d.ts
|
|
3
|
+
interface MetadataOverrides {
|
|
4
|
+
readonly title?: string;
|
|
5
|
+
readonly author?: string;
|
|
6
|
+
readonly subject?: string;
|
|
7
|
+
readonly keywords?: string[];
|
|
8
|
+
}
|
|
9
|
+
interface SetDocumentMetadataOptions {
|
|
10
|
+
readonly signal?: AbortSignal;
|
|
11
|
+
}
|
|
12
|
+
declare function setDocumentMetadata(sourceFormat: DocumentFormat, targetFormat: DocumentFormat, bytes: Uint8Array<ArrayBuffer>, overrides: MetadataOverrides, options?: SetDocumentMetadataOptions): Uint8Array<ArrayBuffer>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { MetadataOverrides, SetDocumentMetadataOptions, setDocumentMetadata };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DocumentFormat } from "../convert/port.js";
|
|
2
|
+
//#region src/metadata/write.d.ts
|
|
3
|
+
interface MetadataOverrides {
|
|
4
|
+
readonly title?: string;
|
|
5
|
+
readonly author?: string;
|
|
6
|
+
readonly subject?: string;
|
|
7
|
+
readonly keywords?: string[];
|
|
8
|
+
}
|
|
9
|
+
interface SetDocumentMetadataOptions {
|
|
10
|
+
readonly signal?: AbortSignal;
|
|
11
|
+
}
|
|
12
|
+
declare function setDocumentMetadata(sourceFormat: DocumentFormat, targetFormat: DocumentFormat, bytes: Uint8Array<ArrayBuffer>, overrides: MetadataOverrides, options?: SetDocumentMetadataOptions): Uint8Array<ArrayBuffer>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { MetadataOverrides, SetDocumentMetadataOptions, setDocumentMetadata };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { buildDocxPackage } from "../edit/docx/content.js";
|
|
2
|
+
import { buildPptxPackage } from "../edit/pptx/content.js";
|
|
3
|
+
import { buildOdtPackage } from "../edit/odt/content.js";
|
|
4
|
+
import { buildOdpPackage } from "../edit/odp/content.js";
|
|
5
|
+
import { buildOdsPackage } from "../edit/ods/content.js";
|
|
6
|
+
import { buildOdgPackage } from "../edit/odg/content.js";
|
|
7
|
+
import { readMarkdownContent } from "../markdown/read.js";
|
|
8
|
+
import { buildMarkdownText } from "../markdown/write.js";
|
|
9
|
+
import { readDocxContent } from "../ooxml/docx/read.js";
|
|
10
|
+
import { readPptxContent } from "../ooxml/pptx/read.js";
|
|
11
|
+
import { readOdtContent } from "../odf/odt/read.js";
|
|
12
|
+
import { readOdpContent } from "../odf/odp/read.js";
|
|
13
|
+
import { readOdsContent } from "../odf/ods/read.js";
|
|
14
|
+
import { readOdgContent } from "../odf/odg/read.js";
|
|
15
|
+
import { decodeMarkdownText, encodeMarkdownText } from "../markdown/text.js";
|
|
16
|
+
import { throwIfAborted } from "../ports/abort.js";
|
|
17
|
+
import { decodePackage, encodePackage } from "ooxml.js";
|
|
18
|
+
import { decodePackage as decodePackage$1, encodePackage as encodePackage$1 } from "odf.js";
|
|
19
|
+
import { readPdf, writePdf } from "pdf-codec";
|
|
20
|
+
//#region src/metadata/write.ts
|
|
21
|
+
const REBUILD_FORMATS = {
|
|
22
|
+
docx: true,
|
|
23
|
+
pptx: true,
|
|
24
|
+
odt: true,
|
|
25
|
+
odp: true,
|
|
26
|
+
ods: true,
|
|
27
|
+
odg: true,
|
|
28
|
+
markdown: true
|
|
29
|
+
};
|
|
30
|
+
function isRebuildFormat(format) {
|
|
31
|
+
return format in REBUILD_FORMATS;
|
|
32
|
+
}
|
|
33
|
+
function readContentForFormat(format, bytes) {
|
|
34
|
+
switch (format) {
|
|
35
|
+
case "docx": return readDocxContent(decodePackage(bytes));
|
|
36
|
+
case "pptx": return readPptxContent(decodePackage(bytes));
|
|
37
|
+
case "odt": return readOdtContent(decodePackage$1(bytes));
|
|
38
|
+
case "odp": return readOdpContent(decodePackage$1(bytes));
|
|
39
|
+
case "ods": return readOdsContent(decodePackage$1(bytes));
|
|
40
|
+
case "odg": return readOdgContent(decodePackage$1(bytes));
|
|
41
|
+
case "markdown": return readMarkdownContent(decodeMarkdownText(bytes));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function buildBytesForRebuildFormat(format, content) {
|
|
45
|
+
switch (format) {
|
|
46
|
+
case "docx": return encodePackage(buildDocxPackage(content));
|
|
47
|
+
case "pptx": return encodePackage(buildPptxPackage(content));
|
|
48
|
+
case "odt": return encodePackage$1(buildOdtPackage(content));
|
|
49
|
+
case "odp": return encodePackage$1(buildOdpPackage(content));
|
|
50
|
+
case "ods": return encodePackage$1(buildOdsPackage(content));
|
|
51
|
+
case "odg": return encodePackage$1(buildOdgPackage(content));
|
|
52
|
+
case "markdown": return encodeMarkdownText(buildMarkdownText(content));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function mergeMetadata(current, overrides) {
|
|
56
|
+
return {
|
|
57
|
+
...current,
|
|
58
|
+
...overrides.title !== void 0 ? { title: overrides.title } : {},
|
|
59
|
+
...overrides.author !== void 0 ? { author: overrides.author } : {},
|
|
60
|
+
...overrides.subject !== void 0 ? { subject: overrides.subject } : {},
|
|
61
|
+
...overrides.keywords !== void 0 ? { keywords: overrides.keywords } : {}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function classifyWritePath(source, target) {
|
|
65
|
+
if (source === "pdf" && target === "pdf") return { kind: "pdf" };
|
|
66
|
+
if (target === "xlsx" || source === "xlsx") return { errorMessage: "'xlsx' is not a supported setDocumentMetadata source or target -- this package does not re-export a ContentDocument-to-xlsx builder or a readXlsxContent from its own public surface (see the README's Architecture section); convert via xlsxToOds/odsToXlsx first, then set metadata on the ods" };
|
|
67
|
+
if (target === "odf" || source === "odf") return { errorMessage: "'odf' (a standalone formula document) is not a supported setDocumentMetadata source or target -- it has no write path back out at all" };
|
|
68
|
+
if (!isRebuildFormat(source) || !isRebuildFormat(target)) return { errorMessage: `setDocumentMetadata only patches metadata in place; it does not convert format -- source ('${source}') and target ('${target}') must be the same format (or both 'pdf'). Convert first if you need a different target format.` };
|
|
69
|
+
if (source !== target) return { errorMessage: `setDocumentMetadata only patches metadata in place; it does not convert format -- source ('${source}') and target ('${target}') must be the same format. Convert first if you need a different target format.` };
|
|
70
|
+
return {
|
|
71
|
+
kind: "rebuild",
|
|
72
|
+
format: source
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function setDocumentMetadata(sourceFormat, targetFormat, bytes, overrides, options) {
|
|
76
|
+
const writePath = classifyWritePath(sourceFormat, targetFormat);
|
|
77
|
+
if ("errorMessage" in writePath) throw new Error(writePath.errorMessage);
|
|
78
|
+
throwIfAborted(options?.signal);
|
|
79
|
+
if (writePath.kind === "pdf") {
|
|
80
|
+
const layout = readPdf(bytes, { signal: options?.signal });
|
|
81
|
+
const patched = {
|
|
82
|
+
...layout,
|
|
83
|
+
metadata: mergeMetadata(layout.metadata, overrides)
|
|
84
|
+
};
|
|
85
|
+
return writePdf(patched, { signal: options?.signal });
|
|
86
|
+
}
|
|
87
|
+
const content = readContentForFormat(writePath.format, bytes);
|
|
88
|
+
const nextContent = {
|
|
89
|
+
...content,
|
|
90
|
+
metadata: mergeMetadata(content.metadata, overrides)
|
|
91
|
+
};
|
|
92
|
+
return buildBytesForRebuildFormat(writePath.format, nextContent);
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { setDocumentMetadata };
|
package/package.json
CHANGED