documents.js 1.43.1 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -11
- package/dist/index.cjs +219 -9
- package/dist/index.d.cts +209 -3
- package/dist/index.d.ts +209 -3
- package/dist/index.js +183 -12
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AttributeSchema, BinaryPartSchema, CommentSchema, CompactPackageSchema, CompactPartSchema, CompactXmlNodeSchema, DefinedNameSchema, PackageSchema, PartSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, attr, attr as attr$1, base64ToBytes, base64ToBytes as base64ToBytes$1, buildXml, bytesToBase64, bytesToBase64 as bytesToBase64$1, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, decodePackage as decodePackage$1, elementsWithTag, elementsWithTag as elementsWithTag$1, encodeCompactPackage, encodePackage, encodePackage as encodePackage$1, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, readDocx, readPptx, resolveRelationships, resolveRelationships as resolveRelationships$1, rootElement, rootElement as rootElement$1, serializePackage, textContent, textContent as textContent$1, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
|
|
2
|
-
import { COLOR_BLACK, ContentBlockSchema, ContentCellValueSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentRunSchema, ContentSectionSchema, ContentSectionSchema as ContentSectionSchema$1, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSheetSchema as ContentSheetSchema$1, ContentSlideSchema, ContentSlideSchema as ContentSlideSchema$1, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, DEFAULT_LAYOUT_FONT, LAYOUT_FORMAT_VERSION, LAYOUT_FORMAT_VERSION as LAYOUT_FORMAT_VERSION$1, LayoutDocumentSchema, LayoutMetadataSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, colorToRgbHex, isContentBlock, rgbHexToColor } from "document-content-model";
|
|
2
|
+
import { COLOR_BLACK, ContentBlockSchema, ContentCellValueSchema, ContentDrawPageSchema, ContentDrawPageSchema as ContentDrawPageSchema$1, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentSectionSchema as ContentSectionSchema$1, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSheetSchema as ContentSheetSchema$1, ContentSlideSchema, ContentSlideSchema as ContentSlideSchema$1, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, LAYOUT_FORMAT_VERSION, LAYOUT_FORMAT_VERSION as LAYOUT_FORMAT_VERSION$1, LayoutDocumentSchema, LayoutMetadataSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, colorToRgbHex, isContentBlock, rgbHexToColor } from "document-content-model";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { ODF_MEDIA_TYPES, StyleRegistry, applyOdfTransform, base64ToBytes as base64ToBytes$2, bytesToBase64 as bytesToBase64$2, decodeOdfText, decodePackage as decodePackage$2, encodePackage as encodePackage$2, formatOdfLength, parseCellReference, parseOdfLength, readOdp, readOds, readOdt, resolveOdfShapeGeometry, resolveStyle, setDocumentMediaType, syncManifest, syncManifest as syncManifest$1, xmlnsAttributes } from "odf.js";
|
|
4
|
+
import { ODF_MEDIA_TYPES, StyleRegistry, applyOdfTransform, base64ToBytes as base64ToBytes$2, bytesToBase64 as bytesToBase64$2, decodeOdfText, decodePackage as decodePackage$2, encodePackage as encodePackage$2, formatOdfLength, parseCellReference, parseOdfLength, readOdg, readOdp, readOds, readOdt, resolveOdfShapeGeometry, resolveStyle, setDocumentMediaType, syncManifest, syncManifest as syncManifest$1, xmlnsAttributes } from "odf.js";
|
|
5
5
|
import { Unzlib, inflateSync, unzlibSync, zlibSync } from "fflate";
|
|
6
6
|
//#region src/model/content.ts
|
|
7
7
|
const CONTENT_FORMAT_VERSION = 1;
|
|
@@ -23,6 +23,12 @@ const ContentDocumentSchema = z.discriminatedUnion("kind", [
|
|
|
23
23
|
formatVersion: z.literal(1),
|
|
24
24
|
metadata: LayoutMetadataSchema,
|
|
25
25
|
sheets: z.array(ContentSheetSchema$1)
|
|
26
|
+
}),
|
|
27
|
+
z.object({
|
|
28
|
+
kind: z.literal("drawing"),
|
|
29
|
+
formatVersion: z.literal(1),
|
|
30
|
+
metadata: LayoutMetadataSchema,
|
|
31
|
+
pages: z.array(ContentDrawPageSchema$1)
|
|
26
32
|
})
|
|
27
33
|
]);
|
|
28
34
|
//#endregion
|
|
@@ -7603,11 +7609,15 @@ function writeText(writer, item, context, substitutions) {
|
|
|
7603
7609
|
writeUnderline(writer, item, item.widthPt ?? encoded.width1000 / 1e3 * item.sizePt * scale, context.measurer);
|
|
7604
7610
|
}
|
|
7605
7611
|
}
|
|
7606
|
-
function paintOperatorFor(fill, stroke) {
|
|
7607
|
-
|
|
7608
|
-
if (fill !== void 0) return "
|
|
7612
|
+
function paintOperatorFor(fill, stroke, fillRule) {
|
|
7613
|
+
const evenOdd = fillRule === "evenodd";
|
|
7614
|
+
if (fill !== void 0 && stroke !== void 0) return evenOdd ? "B*" : "B";
|
|
7615
|
+
if (fill !== void 0) return evenOdd ? "f*" : "f";
|
|
7609
7616
|
if (stroke !== void 0) return "S";
|
|
7610
7617
|
}
|
|
7618
|
+
function formatPoint(x, y) {
|
|
7619
|
+
return `${formatNumber(x)} ${formatNumber(y)}`;
|
|
7620
|
+
}
|
|
7611
7621
|
function writeFillAndStroke(writer, fill, stroke) {
|
|
7612
7622
|
if (fill !== void 0) writeRgbOperator(writer, fill, "rg");
|
|
7613
7623
|
if (stroke !== void 0) {
|
|
@@ -7638,12 +7648,24 @@ function writeEllipse(writer, item) {
|
|
|
7638
7648
|
const ry = item.heightPt / 2;
|
|
7639
7649
|
const kx = rx * BEZIER_KAPPA;
|
|
7640
7650
|
const ky = ry * BEZIER_KAPPA;
|
|
7641
|
-
|
|
7642
|
-
writer.writeAscii(`${
|
|
7643
|
-
writer.writeAscii(`${
|
|
7644
|
-
writer.writeAscii(`${
|
|
7645
|
-
writer.writeAscii(`${
|
|
7646
|
-
writer.writeAscii(`${
|
|
7651
|
+
writer.writeAscii(`${formatPoint(cx + rx, cy)} m\n`);
|
|
7652
|
+
writer.writeAscii(`${formatPoint(cx + rx, cy + ky)} ${formatPoint(cx + kx, cy + ry)} ${formatPoint(cx, cy + ry)} c\n`);
|
|
7653
|
+
writer.writeAscii(`${formatPoint(cx - kx, cy + ry)} ${formatPoint(cx - rx, cy + ky)} ${formatPoint(cx - rx, cy)} c\n`);
|
|
7654
|
+
writer.writeAscii(`${formatPoint(cx - rx, cy - ky)} ${formatPoint(cx - kx, cy - ry)} ${formatPoint(cx, cy - ry)} c\n`);
|
|
7655
|
+
writer.writeAscii(`${formatPoint(cx + kx, cy - ry)} ${formatPoint(cx + rx, cy - ky)} ${formatPoint(cx + rx, cy)} c\n`);
|
|
7656
|
+
writer.writeAscii(`${paint}\n`);
|
|
7657
|
+
}
|
|
7658
|
+
function writeSubpath(writer, subpath) {
|
|
7659
|
+
writer.writeAscii(`${formatPoint(subpath.startXPt, subpath.startYPt)} m\n`);
|
|
7660
|
+
for (const segment of subpath.segments) if (segment.kind === "line") writer.writeAscii(`${formatPoint(segment.xPt, segment.yPt)} l\n`);
|
|
7661
|
+
else writer.writeAscii(`${formatPoint(segment.c1xPt, segment.c1yPt)} ${formatPoint(segment.c2xPt, segment.c2yPt)} ${formatPoint(segment.xPt, segment.yPt)} c\n`);
|
|
7662
|
+
if (subpath.closed) writer.writeAscii("h\n");
|
|
7663
|
+
}
|
|
7664
|
+
function writePath(writer, item) {
|
|
7665
|
+
const paint = paintOperatorFor(item.fill, item.stroke, item.fillRule);
|
|
7666
|
+
if (paint === void 0) return;
|
|
7667
|
+
writeFillAndStroke(writer, item.fill, item.stroke);
|
|
7668
|
+
for (const subpath of item.subpaths) writeSubpath(writer, subpath);
|
|
7647
7669
|
writer.writeAscii(`${paint}\n`);
|
|
7648
7670
|
}
|
|
7649
7671
|
function writeImage(writer, item, context) {
|
|
@@ -7662,6 +7684,7 @@ function writeContentStream(items, context) {
|
|
|
7662
7684
|
else if (item.kind === "rect") writeRect(writer, item);
|
|
7663
7685
|
else if (item.kind === "line") writeLine(writer, item);
|
|
7664
7686
|
else if (item.kind === "ellipse") writeEllipse(writer, item);
|
|
7687
|
+
else if (item.kind === "path") writePath(writer, item);
|
|
7665
7688
|
return {
|
|
7666
7689
|
bytes: writer.toBytes(),
|
|
7667
7690
|
substitutions
|
|
@@ -8468,6 +8491,17 @@ function readOdsContent(pkg) {
|
|
|
8468
8491
|
};
|
|
8469
8492
|
}
|
|
8470
8493
|
//#endregion
|
|
8494
|
+
//#region src/odf/odg/read.ts
|
|
8495
|
+
function readOdgContent(pkg) {
|
|
8496
|
+
const odgDoc = readOdg(pkg);
|
|
8497
|
+
return {
|
|
8498
|
+
kind: "drawing",
|
|
8499
|
+
formatVersion: 1,
|
|
8500
|
+
metadata: { ...odgDoc.metadata },
|
|
8501
|
+
pages: odgDoc.pages
|
|
8502
|
+
};
|
|
8503
|
+
}
|
|
8504
|
+
//#endregion
|
|
8471
8505
|
//#region src/pdf/text-layout.ts
|
|
8472
8506
|
const WORD_OR_WHITESPACE_PATTERN = /\n|\s+|\S+/g;
|
|
8473
8507
|
function atomizeRuns(runs, measurer) {
|
|
@@ -9499,6 +9533,118 @@ function convertSpreadsheetToLayout(doc, options) {
|
|
|
9499
9533
|
};
|
|
9500
9534
|
}
|
|
9501
9535
|
//#endregion
|
|
9536
|
+
//#region src/layout/drawing.ts
|
|
9537
|
+
function convertRectVector(vector, pageHeightPt, out) {
|
|
9538
|
+
const flipped = flipY(vector.frame, pageHeightPt);
|
|
9539
|
+
out.push({
|
|
9540
|
+
kind: "rect",
|
|
9541
|
+
xPt: flipped.xPt,
|
|
9542
|
+
yPt: flipped.yPt,
|
|
9543
|
+
widthPt: flipped.widthPt,
|
|
9544
|
+
heightPt: flipped.heightPt,
|
|
9545
|
+
fill: vector.fill,
|
|
9546
|
+
stroke: vector.stroke,
|
|
9547
|
+
sourcePath: vector.sourcePath
|
|
9548
|
+
});
|
|
9549
|
+
}
|
|
9550
|
+
function convertEllipseVector(vector, pageHeightPt, out) {
|
|
9551
|
+
const flipped = flipY(vector.frame, pageHeightPt);
|
|
9552
|
+
out.push({
|
|
9553
|
+
kind: "ellipse",
|
|
9554
|
+
xPt: flipped.xPt,
|
|
9555
|
+
yPt: flipped.yPt,
|
|
9556
|
+
widthPt: flipped.widthPt,
|
|
9557
|
+
heightPt: flipped.heightPt,
|
|
9558
|
+
fill: vector.fill,
|
|
9559
|
+
stroke: vector.stroke,
|
|
9560
|
+
sourcePath: vector.sourcePath
|
|
9561
|
+
});
|
|
9562
|
+
}
|
|
9563
|
+
function convertLineVector(vector, pageHeightPt, out) {
|
|
9564
|
+
out.push({
|
|
9565
|
+
kind: "line",
|
|
9566
|
+
x1Pt: vector.from.xPt,
|
|
9567
|
+
y1Pt: pageHeightPt - vector.from.yPt,
|
|
9568
|
+
x2Pt: vector.to.xPt,
|
|
9569
|
+
y2Pt: pageHeightPt - vector.to.yPt,
|
|
9570
|
+
color: vector.stroke.color,
|
|
9571
|
+
widthPt: vector.stroke.widthPt,
|
|
9572
|
+
sourcePath: vector.sourcePath
|
|
9573
|
+
});
|
|
9574
|
+
}
|
|
9575
|
+
function placePathPoint(frame, point, pageHeightPt) {
|
|
9576
|
+
return {
|
|
9577
|
+
xPt: frame.xPt + point.xPt,
|
|
9578
|
+
yPt: pageHeightPt - frame.yPt - point.yPt
|
|
9579
|
+
};
|
|
9580
|
+
}
|
|
9581
|
+
function convertPathVector(vector, pageHeightPt, out) {
|
|
9582
|
+
const subpaths = vector.subpaths.map((subpath) => {
|
|
9583
|
+
const start = placePathPoint(vector.frame, subpath.start, pageHeightPt);
|
|
9584
|
+
return {
|
|
9585
|
+
startXPt: start.xPt,
|
|
9586
|
+
startYPt: start.yPt,
|
|
9587
|
+
closed: subpath.closed,
|
|
9588
|
+
segments: subpath.segments.map((segment) => {
|
|
9589
|
+
if (segment.kind === "line") {
|
|
9590
|
+
const to = placePathPoint(vector.frame, segment.to, pageHeightPt);
|
|
9591
|
+
return {
|
|
9592
|
+
kind: "line",
|
|
9593
|
+
xPt: to.xPt,
|
|
9594
|
+
yPt: to.yPt
|
|
9595
|
+
};
|
|
9596
|
+
}
|
|
9597
|
+
const control1 = placePathPoint(vector.frame, segment.control1, pageHeightPt);
|
|
9598
|
+
const control2 = placePathPoint(vector.frame, segment.control2, pageHeightPt);
|
|
9599
|
+
const to = placePathPoint(vector.frame, segment.to, pageHeightPt);
|
|
9600
|
+
return {
|
|
9601
|
+
kind: "cubic",
|
|
9602
|
+
c1xPt: control1.xPt,
|
|
9603
|
+
c1yPt: control1.yPt,
|
|
9604
|
+
c2xPt: control2.xPt,
|
|
9605
|
+
c2yPt: control2.yPt,
|
|
9606
|
+
xPt: to.xPt,
|
|
9607
|
+
yPt: to.yPt
|
|
9608
|
+
};
|
|
9609
|
+
})
|
|
9610
|
+
};
|
|
9611
|
+
});
|
|
9612
|
+
out.push({
|
|
9613
|
+
kind: "path",
|
|
9614
|
+
subpaths,
|
|
9615
|
+
fill: vector.fill,
|
|
9616
|
+
fillRule: vector.fillRule,
|
|
9617
|
+
stroke: vector.stroke,
|
|
9618
|
+
sourcePath: vector.sourcePath
|
|
9619
|
+
});
|
|
9620
|
+
}
|
|
9621
|
+
function convertVector(vector, pageHeightPt, out) {
|
|
9622
|
+
if (vector.kind === "rect") convertRectVector(vector, pageHeightPt, out);
|
|
9623
|
+
else if (vector.kind === "ellipse") convertEllipseVector(vector, pageHeightPt, out);
|
|
9624
|
+
else if (vector.kind === "line") convertLineVector(vector, pageHeightPt, out);
|
|
9625
|
+
else convertPathVector(vector, pageHeightPt, out);
|
|
9626
|
+
}
|
|
9627
|
+
function convertPage(page, measurer, images) {
|
|
9628
|
+
const items = [];
|
|
9629
|
+
for (const vector of page.vectors) convertVector(vector, page.size.heightPt, items);
|
|
9630
|
+
for (const shape of page.shapes) convertShape(shape, page.size.heightPt, measurer, images, items);
|
|
9631
|
+
return {
|
|
9632
|
+
widthPt: page.size.widthPt,
|
|
9633
|
+
heightPt: page.size.heightPt,
|
|
9634
|
+
items
|
|
9635
|
+
};
|
|
9636
|
+
}
|
|
9637
|
+
function convertDrawingToLayout(doc, options) {
|
|
9638
|
+
const images = {};
|
|
9639
|
+
const pages = doc.pages.map((page) => convertPage(page, options.measurer, images));
|
|
9640
|
+
return {
|
|
9641
|
+
formatVersion: LAYOUT_FORMAT_VERSION$1,
|
|
9642
|
+
metadata: doc.metadata,
|
|
9643
|
+
pages,
|
|
9644
|
+
images
|
|
9645
|
+
};
|
|
9646
|
+
}
|
|
9647
|
+
//#endregion
|
|
9502
9648
|
//#region src/layout/reconstruct.ts
|
|
9503
9649
|
const ZERO_MARGINS = {
|
|
9504
9650
|
topPt: 0,
|
|
@@ -9878,6 +10024,14 @@ function odsToPdf(bytes, options) {
|
|
|
9878
10024
|
onSubstitution: options?.onSubstitution
|
|
9879
10025
|
});
|
|
9880
10026
|
}
|
|
10027
|
+
function odgToPdf(bytes, options) {
|
|
10028
|
+
const content = readOdgContent(decodePackage$2(bytes));
|
|
10029
|
+
if (content.kind !== "drawing") throw new Error("readOdgContent returned a non-drawing ContentDocument");
|
|
10030
|
+
return writePdf(convertDrawingToLayout(content, { measurer: createStandardFontMeasurer() }), {
|
|
10031
|
+
signal: options?.signal,
|
|
10032
|
+
onSubstitution: options?.onSubstitution
|
|
10033
|
+
});
|
|
10034
|
+
}
|
|
9881
10035
|
function pdfToDocx(bytes, options) {
|
|
9882
10036
|
const content = reconstructWordprocessing(readPdf(bytes, {
|
|
9883
10037
|
signal: options?.signal,
|
|
@@ -9947,6 +10101,10 @@ const SUPPORTED_CONVERSIONS = [
|
|
|
9947
10101
|
source: "ods",
|
|
9948
10102
|
target: "pdf"
|
|
9949
10103
|
},
|
|
10104
|
+
{
|
|
10105
|
+
source: "odg",
|
|
10106
|
+
target: "pdf"
|
|
10107
|
+
},
|
|
9950
10108
|
{
|
|
9951
10109
|
source: "pdf",
|
|
9952
10110
|
target: "docx"
|
|
@@ -10052,6 +10210,19 @@ function createLocalDocumentConverter() {
|
|
|
10052
10210
|
diagnostics
|
|
10053
10211
|
});
|
|
10054
10212
|
}
|
|
10213
|
+
if (source.format === "odg" && targetFormat === "pdf") {
|
|
10214
|
+
const bytes = odgToPdf(source.bytes, {
|
|
10215
|
+
signal: options.signal,
|
|
10216
|
+
onSubstitution: (s, c) => diagnostics.push(substitutionDiagnostic(s, c))
|
|
10217
|
+
});
|
|
10218
|
+
return Promise.resolve({
|
|
10219
|
+
document: {
|
|
10220
|
+
format: "pdf",
|
|
10221
|
+
bytes
|
|
10222
|
+
},
|
|
10223
|
+
diagnostics
|
|
10224
|
+
});
|
|
10225
|
+
}
|
|
10055
10226
|
if (source.format === "pdf" && targetFormat === "docx") {
|
|
10056
10227
|
const bytes = pdfToDocx(source.bytes, {
|
|
10057
10228
|
signal: options.signal,
|
|
@@ -10115,4 +10286,4 @@ function fixedClock(date) {
|
|
|
10115
10286
|
return { now: () => date };
|
|
10116
10287
|
}
|
|
10117
10288
|
//#endregion
|
|
10118
|
-
export { AttributeSchema, BinaryPartSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, CommentSchema, CompactPackageSchema, CompactPartSchema, CompactXmlNodeSchema, ContentBlockSchema, ContentCellValueSchema, ContentDocumentSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, DEFAULT_LAYOUT_FONT, DefinedNameSchema, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, LAYOUT_FORMAT_VERSION, NOOP_DIAGNOSTIC_SINK, OdgBytesSchema, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, OdtRun, OdtTable, OdtTableCell, OdtTableRow, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PackageSchema, PartSchema, PdfBytesSchema, PdfEncryptedError, PdfParseError, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, attr, base64ToBytes, buildDocxPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodePackage, docxPdfCodec, docxToPdf, elementsWithTag, encodeCompactPackage, encodePackage, fixedClock, flipY, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, odpPdfCodec, odpToPdf, odsToPdf, odtPdfCodec, odtToPdf, openDocx, openOdp, openOds, openOdt, openPptx, packageCodec, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdp, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToPdf, readDocxContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructPresentation, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xmlCodec, zipPackage };
|
|
10289
|
+
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, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, LAYOUT_FORMAT_VERSION, NOOP_DIAGNOSTIC_SINK, OdgBytesSchema, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, OdtRun, OdtTable, OdtTableCell, OdtTableRow, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PackageSchema, PartSchema, PdfBytesSchema, PdfEncryptedError, PdfParseError, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, attr, base64ToBytes, buildDocxPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodePackage, docxPdfCodec, docxToPdf, elementsWithTag, encodeCompactPackage, encodePackage, fixedClock, flipY, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, odgToPdf, odpPdfCodec, odpToPdf, odsToPdf, odtPdfCodec, odtToPdf, openDocx, openOdp, openOds, openOdt, openPptx, packageCodec, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdp, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToPdf, readDocxContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructPresentation, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xmlCodec, zipPackage };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "documents.js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.44.0",
|
|
4
4
|
"description": "Bidirectional docx/pptx <-> PDF conversion and a read+write editable OOXML document model, built on ooxml.js and Zod 4 codecs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"license": "MIT",
|
|
65
65
|
"packageManager": "pnpm@11.6.0",
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"document-content-model": "^1.
|
|
67
|
+
"document-content-model": "^1.3.0",
|
|
68
68
|
"fflate": "^0.8.3",
|
|
69
69
|
"odf.js": "^1.8.0",
|
|
70
70
|
"ooxml.js": "^2.1.0",
|