js.documents 1.58.0 → 1.59.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.
@@ -1,83 +1,9 @@
1
- import { docxToOdt, docxToPdf, odfToPdf, odgToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToPdf, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pptxToOdp, pptxToPdf, xlsxToOds } from "./convert.js";
1
+ import { DIRECT_EDGES, resolveConversionPath } from "./capability.js";
2
2
  //#region src/convert/local.ts
3
- const SUPPORTED_CONVERSIONS = [
4
- {
5
- source: "docx",
6
- target: "pdf"
7
- },
8
- {
9
- source: "pptx",
10
- target: "pdf"
11
- },
12
- {
13
- source: "odt",
14
- target: "pdf"
15
- },
16
- {
17
- source: "odp",
18
- target: "pdf"
19
- },
20
- {
21
- source: "ods",
22
- target: "pdf"
23
- },
24
- {
25
- source: "odg",
26
- target: "pdf"
27
- },
28
- {
29
- source: "odf",
30
- target: "pdf"
31
- },
32
- {
33
- source: "pdf",
34
- target: "docx"
35
- },
36
- {
37
- source: "pdf",
38
- target: "pptx"
39
- },
40
- {
41
- source: "pdf",
42
- target: "odt"
43
- },
44
- {
45
- source: "pdf",
46
- target: "odp"
47
- },
48
- {
49
- source: "pdf",
50
- target: "ods"
51
- },
52
- {
53
- source: "pdf",
54
- target: "odg"
55
- },
56
- {
57
- source: "odt",
58
- target: "docx"
59
- },
60
- {
61
- source: "docx",
62
- target: "odt"
63
- },
64
- {
65
- source: "odp",
66
- target: "pptx"
67
- },
68
- {
69
- source: "pptx",
70
- target: "odp"
71
- },
72
- {
73
- source: "ods",
74
- target: "xlsx"
75
- },
76
- {
77
- source: "xlsx",
78
- target: "ods"
79
- }
80
- ];
3
+ const SUPPORTED_CONVERSIONS = DIRECT_EDGES.map((edge) => ({
4
+ source: edge.source,
5
+ target: edge.target
6
+ }));
81
7
  function substitutionDiagnostic(substitution, context) {
82
8
  return {
83
9
  severity: "info",
@@ -105,286 +31,51 @@ function createLocalDocumentConverter() {
105
31
  const onDocument = (pkg) => {
106
32
  documentPackage = pkg;
107
33
  };
108
- if (source.format === "docx" && targetFormat === "pdf") {
109
- const bytes = docxToPdf(source.bytes, {
34
+ const strategy = resolveConversionPath(source.format, targetFormat);
35
+ if (strategy?.kind !== "direct") return Promise.reject(/* @__PURE__ */ new Error(`unsupported conversion: ${source.format} -> ${targetFormat}`));
36
+ const edge = strategy.edge;
37
+ if (edge.kind === "toPdf") {
38
+ const bytes = edge.convert(source.bytes, {
110
39
  signal: options.signal,
111
40
  onSubstitution: (s, c) => diagnostics.push(substitutionDiagnostic(s, c)),
112
41
  onDocument
113
42
  });
114
43
  return Promise.resolve({
115
44
  document: {
116
- format: "pdf",
45
+ format: edge.target,
117
46
  bytes
118
47
  },
119
48
  diagnostics,
120
49
  package: documentPackage
121
50
  });
122
51
  }
123
- if (source.format === "pptx" && targetFormat === "pdf") {
124
- const bytes = pptxToPdf(source.bytes, {
125
- signal: options.signal,
126
- onSubstitution: (s, c) => diagnostics.push(substitutionDiagnostic(s, c)),
127
- onDocument
128
- });
129
- return Promise.resolve({
130
- document: {
131
- format: "pdf",
132
- bytes
133
- },
134
- diagnostics,
135
- package: documentPackage
136
- });
137
- }
138
- if (source.format === "odt" && targetFormat === "pdf") {
139
- const bytes = odtToPdf(source.bytes, {
140
- signal: options.signal,
141
- onSubstitution: (s, c) => diagnostics.push(substitutionDiagnostic(s, c)),
142
- onDocument
143
- });
144
- return Promise.resolve({
145
- document: {
146
- format: "pdf",
147
- bytes
148
- },
149
- diagnostics,
150
- package: documentPackage
151
- });
152
- }
153
- if (source.format === "odp" && targetFormat === "pdf") {
154
- const bytes = odpToPdf(source.bytes, {
155
- signal: options.signal,
156
- onSubstitution: (s, c) => diagnostics.push(substitutionDiagnostic(s, c)),
157
- onDocument
158
- });
159
- return Promise.resolve({
160
- document: {
161
- format: "pdf",
162
- bytes
163
- },
164
- diagnostics,
165
- package: documentPackage
166
- });
167
- }
168
- if (source.format === "ods" && targetFormat === "pdf") {
169
- const bytes = odsToPdf(source.bytes, {
170
- signal: options.signal,
171
- onSubstitution: (s, c) => diagnostics.push(substitutionDiagnostic(s, c)),
172
- onDocument
173
- });
174
- return Promise.resolve({
175
- document: {
176
- format: "pdf",
177
- bytes
178
- },
179
- diagnostics,
180
- package: documentPackage
181
- });
182
- }
183
- if (source.format === "odg" && targetFormat === "pdf") {
184
- const bytes = odgToPdf(source.bytes, {
185
- signal: options.signal,
186
- onSubstitution: (s, c) => diagnostics.push(substitutionDiagnostic(s, c)),
187
- onDocument
188
- });
189
- return Promise.resolve({
190
- document: {
191
- format: "pdf",
192
- bytes
193
- },
194
- diagnostics,
195
- package: documentPackage
196
- });
197
- }
198
- if (source.format === "odf" && targetFormat === "pdf") {
199
- const bytes = odfToPdf(source.bytes, {
200
- signal: options.signal,
201
- onSubstitution: (s, c) => diagnostics.push(substitutionDiagnostic(s, c)),
202
- onDocument
203
- });
204
- return Promise.resolve({
205
- document: {
206
- format: "pdf",
207
- bytes
208
- },
209
- diagnostics,
210
- package: documentPackage
211
- });
212
- }
213
- if (source.format === "pdf" && targetFormat === "docx") {
214
- const bytes = pdfToDocx(source.bytes, {
215
- signal: options.signal,
216
- sink: (d) => diagnostics.push(fromPdfDiagnostic(d)),
217
- onDocument
218
- });
219
- return Promise.resolve({
220
- document: {
221
- format: "docx",
222
- bytes
223
- },
224
- diagnostics,
225
- package: documentPackage
226
- });
227
- }
228
- if (source.format === "pdf" && targetFormat === "pptx") {
229
- const bytes = pdfToPptx(source.bytes, {
230
- signal: options.signal,
231
- sink: (d) => diagnostics.push(fromPdfDiagnostic(d)),
232
- onDocument
233
- });
234
- return Promise.resolve({
235
- document: {
236
- format: "pptx",
237
- bytes
238
- },
239
- diagnostics,
240
- package: documentPackage
241
- });
242
- }
243
- if (source.format === "pdf" && targetFormat === "odt") {
244
- const bytes = pdfToOdt(source.bytes, {
245
- signal: options.signal,
246
- sink: (d) => diagnostics.push(fromPdfDiagnostic(d)),
247
- onDocument
248
- });
249
- return Promise.resolve({
250
- document: {
251
- format: "odt",
252
- bytes
253
- },
254
- diagnostics,
255
- package: documentPackage
256
- });
257
- }
258
- if (source.format === "pdf" && targetFormat === "odp") {
259
- const bytes = pdfToOdp(source.bytes, {
260
- signal: options.signal,
261
- sink: (d) => diagnostics.push(fromPdfDiagnostic(d)),
262
- onDocument
263
- });
264
- return Promise.resolve({
265
- document: {
266
- format: "odp",
267
- bytes
268
- },
269
- diagnostics,
270
- package: documentPackage
271
- });
272
- }
273
- if (source.format === "pdf" && targetFormat === "ods") {
274
- const bytes = pdfToOds(source.bytes, {
275
- signal: options.signal,
276
- sink: (d) => diagnostics.push(fromPdfDiagnostic(d)),
277
- onDocument
278
- });
279
- return Promise.resolve({
280
- document: {
281
- format: "ods",
282
- bytes
283
- },
284
- diagnostics,
285
- package: documentPackage
286
- });
287
- }
288
- if (source.format === "pdf" && targetFormat === "odg") {
289
- const bytes = pdfToOdg(source.bytes, {
52
+ if (edge.kind === "fromPdf") {
53
+ const bytes = edge.convert(source.bytes, {
290
54
  signal: options.signal,
291
55
  sink: (d) => diagnostics.push(fromPdfDiagnostic(d)),
292
56
  onDocument
293
57
  });
294
58
  return Promise.resolve({
295
59
  document: {
296
- format: "odg",
297
- bytes
298
- },
299
- diagnostics,
300
- package: documentPackage
301
- });
302
- }
303
- if (source.format === "odt" && targetFormat === "docx") {
304
- const bytes = odtToDocx(source.bytes, {
305
- signal: options.signal,
306
- onDocument
307
- });
308
- return Promise.resolve({
309
- document: {
310
- format: "docx",
311
- bytes
312
- },
313
- diagnostics,
314
- package: documentPackage
315
- });
316
- }
317
- if (source.format === "docx" && targetFormat === "odt") {
318
- const bytes = docxToOdt(source.bytes, {
319
- signal: options.signal,
320
- onDocument
321
- });
322
- return Promise.resolve({
323
- document: {
324
- format: "odt",
325
- bytes
326
- },
327
- diagnostics,
328
- package: documentPackage
329
- });
330
- }
331
- if (source.format === "odp" && targetFormat === "pptx") {
332
- const bytes = odpToPptx(source.bytes, {
333
- signal: options.signal,
334
- onDocument
335
- });
336
- return Promise.resolve({
337
- document: {
338
- format: "pptx",
339
- bytes
340
- },
341
- diagnostics,
342
- package: documentPackage
343
- });
344
- }
345
- if (source.format === "pptx" && targetFormat === "odp") {
346
- const bytes = pptxToOdp(source.bytes, {
347
- signal: options.signal,
348
- onDocument
349
- });
350
- return Promise.resolve({
351
- document: {
352
- format: "odp",
353
- bytes
354
- },
355
- diagnostics,
356
- package: documentPackage
357
- });
358
- }
359
- if (source.format === "ods" && targetFormat === "xlsx") {
360
- const bytes = odsToXlsx(source.bytes, {
361
- signal: options.signal,
362
- onDocument
363
- });
364
- return Promise.resolve({
365
- document: {
366
- format: "xlsx",
367
- bytes
368
- },
369
- diagnostics,
370
- package: documentPackage
371
- });
372
- }
373
- if (source.format === "xlsx" && targetFormat === "ods") {
374
- const bytes = xlsxToOds(source.bytes, {
375
- signal: options.signal,
376
- onDocument
377
- });
378
- return Promise.resolve({
379
- document: {
380
- format: "ods",
60
+ format: edge.target,
381
61
  bytes
382
62
  },
383
63
  diagnostics,
384
64
  package: documentPackage
385
65
  });
386
66
  }
387
- return Promise.reject(/* @__PURE__ */ new Error(`unsupported conversion: ${source.format} -> ${targetFormat}`));
67
+ const bytes = edge.convert(source.bytes, {
68
+ signal: options.signal,
69
+ onDocument
70
+ });
71
+ return Promise.resolve({
72
+ document: {
73
+ format: edge.target,
74
+ bytes
75
+ },
76
+ diagnostics,
77
+ package: documentPackage
78
+ });
388
79
  }
389
80
  };
390
81
  }
@@ -0,0 +1,31 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_xml_fragment = require("../../xml/fragment.cjs");
3
+ const require_xml_edit = require("../../xml/edit.cjs");
4
+ const require_edit_odt_automatic_styles = require("../odt/automatic-styles.cjs");
5
+ const require_edit_ods_address = require("./address.cjs");
6
+ let odf_js = require("odf.js");
7
+ //#region src/edit/ods/column-row.ts
8
+ function writeColumnWidth(pkg, tableElement, index, widthPt) {
9
+ require_edit_ods_address.ensureColumnCoverage(tableElement, index + 1);
10
+ const columnElement = require_edit_ods_address.replaceRun(tableElement.children, require_edit_ods_address.isElementWithTag(require_edit_ods_address.COLUMN_TAG), index, require_edit_ods_address.COLUMN_REPEAT_ATTR, () => require_xml_fragment.el(require_edit_ods_address.COLUMN_TAG));
11
+ const automaticStyles = require_edit_odt_automatic_styles.ensureAutomaticStyles(pkg);
12
+ const styleName = require_edit_odt_automatic_styles.nextStyleName(automaticStyles, "style:style", "OdsColumn");
13
+ automaticStyles.children.push(require_xml_fragment.el("style:style", {
14
+ "style:name": styleName,
15
+ "style:family": "table-column"
16
+ }, [require_xml_fragment.el("style:table-column-properties", { "style:column-width": (0, odf_js.formatOdfLength)(widthPt) })]));
17
+ require_xml_edit.setAttr(columnElement, "table:style-name", styleName);
18
+ }
19
+ function writeRowHeight(pkg, tableElement, index, heightPt) {
20
+ const rowElement = require_edit_ods_address.replaceRun(tableElement.children, require_edit_ods_address.isElementWithTag(require_edit_ods_address.ROW_TAG), index, require_edit_ods_address.ROW_REPEAT_ATTR, () => require_xml_fragment.el(require_edit_ods_address.ROW_TAG));
21
+ const automaticStyles = require_edit_odt_automatic_styles.ensureAutomaticStyles(pkg);
22
+ const styleName = require_edit_odt_automatic_styles.nextStyleName(automaticStyles, "style:style", "OdsRow");
23
+ automaticStyles.children.push(require_xml_fragment.el("style:style", {
24
+ "style:name": styleName,
25
+ "style:family": "table-row"
26
+ }, [require_xml_fragment.el("style:table-row-properties", { "style:row-height": (0, odf_js.formatOdfLength)(heightPt) })]));
27
+ require_xml_edit.setAttr(rowElement, "table:style-name", styleName);
28
+ }
29
+ //#endregion
30
+ exports.writeColumnWidth = writeColumnWidth;
31
+ exports.writeRowHeight = writeRowHeight;
@@ -0,0 +1,6 @@
1
+ import { Package, XmlElement } from "odf.js";
2
+ //#region src/edit/ods/column-row.d.ts
3
+ declare function writeColumnWidth(pkg: Package, tableElement: XmlElement, index: number, widthPt: number): void;
4
+ declare function writeRowHeight(pkg: Package, tableElement: XmlElement, index: number, heightPt: number): void;
5
+ //#endregion
6
+ export { writeColumnWidth, writeRowHeight };
@@ -0,0 +1,6 @@
1
+ import { Package, XmlElement } from "odf.js";
2
+ //#region src/edit/ods/column-row.d.ts
3
+ declare function writeColumnWidth(pkg: Package, tableElement: XmlElement, index: number, widthPt: number): void;
4
+ declare function writeRowHeight(pkg: Package, tableElement: XmlElement, index: number, heightPt: number): void;
5
+ //#endregion
6
+ export { writeColumnWidth, writeRowHeight };
@@ -0,0 +1,29 @@
1
+ import { el } from "../../xml/fragment.js";
2
+ import { setAttr } from "../../xml/edit.js";
3
+ import { ensureAutomaticStyles, nextStyleName } from "../odt/automatic-styles.js";
4
+ import { COLUMN_REPEAT_ATTR, COLUMN_TAG, ROW_REPEAT_ATTR, ROW_TAG, ensureColumnCoverage, isElementWithTag, replaceRun } from "./address.js";
5
+ import { formatOdfLength } from "odf.js";
6
+ //#region src/edit/ods/column-row.ts
7
+ function writeColumnWidth(pkg, tableElement, index, widthPt) {
8
+ ensureColumnCoverage(tableElement, index + 1);
9
+ const columnElement = replaceRun(tableElement.children, isElementWithTag(COLUMN_TAG), index, COLUMN_REPEAT_ATTR, () => el(COLUMN_TAG));
10
+ const automaticStyles = ensureAutomaticStyles(pkg);
11
+ const styleName = nextStyleName(automaticStyles, "style:style", "OdsColumn");
12
+ automaticStyles.children.push(el("style:style", {
13
+ "style:name": styleName,
14
+ "style:family": "table-column"
15
+ }, [el("style:table-column-properties", { "style:column-width": formatOdfLength(widthPt) })]));
16
+ setAttr(columnElement, "table:style-name", styleName);
17
+ }
18
+ function writeRowHeight(pkg, tableElement, index, heightPt) {
19
+ const rowElement = replaceRun(tableElement.children, isElementWithTag(ROW_TAG), index, ROW_REPEAT_ATTR, () => el(ROW_TAG));
20
+ const automaticStyles = ensureAutomaticStyles(pkg);
21
+ const styleName = nextStyleName(automaticStyles, "style:style", "OdsRow");
22
+ automaticStyles.children.push(el("style:style", {
23
+ "style:name": styleName,
24
+ "style:family": "table-row"
25
+ }, [el("style:table-row-properties", { "style:row-height": formatOdfLength(heightPt) })]));
26
+ setAttr(rowElement, "table:style-name", styleName);
27
+ }
28
+ //#endregion
29
+ export { writeColumnWidth, writeRowHeight };
@@ -9,6 +9,8 @@ function buildOdsPackage(content) {
9
9
  const odsSheet = editor.addSheet(sheet.name);
10
10
  odsSheet.printSettings = sheet.printSettings;
11
11
  for (const cell of sheet.cells) appendCell(odsSheet, cell);
12
+ for (const column of sheet.columns) odsSheet.setColumnWidth(column.index, column.widthPt);
13
+ for (const row of sheet.rows) odsSheet.setRowHeight(row.index, row.heightPt);
12
14
  }
13
15
  return editor.toPackage();
14
16
  }
@@ -8,6 +8,8 @@ function buildOdsPackage(content) {
8
8
  const odsSheet = editor.addSheet(sheet.name);
9
9
  odsSheet.printSettings = sheet.printSettings;
10
10
  for (const cell of sheet.cells) appendCell(odsSheet, cell);
11
+ for (const column of sheet.columns) odsSheet.setColumnWidth(column.index, column.widthPt);
12
+ for (const row of sheet.rows) odsSheet.setRowHeight(row.index, row.heightPt);
11
13
  }
12
14
  return editor.toPackage();
13
15
  }
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_xml_edit = require("../../xml/edit.cjs");
3
3
  const require_edit_ods_address = require("./address.cjs");
4
4
  const require_edit_ods_cell = require("./cell.cjs");
5
+ const require_edit_ods_column_row = require("./column-row.cjs");
5
6
  const require_edit_ods_print_settings = require("./print-settings.cjs");
6
7
  let ooxml_js = require("ooxml.js");
7
8
  let odf_js = require("odf.js");
@@ -35,6 +36,12 @@ var OdsSheet = class {
35
36
  set printSettings(value) {
36
37
  require_edit_ods_print_settings.writeSheetPrintSettings(this.pkg, this.live(), value);
37
38
  }
39
+ setColumnWidth(index, widthPt) {
40
+ require_edit_ods_column_row.writeColumnWidth(this.pkg, this.live(), index, widthPt);
41
+ }
42
+ setRowHeight(index, heightPt) {
43
+ require_edit_ods_column_row.writeRowHeight(this.pkg, this.live(), index, heightPt);
44
+ }
38
45
  cell(row, column) {
39
46
  const node = require_edit_ods_address.resolveCellNode(this.live(), row, column);
40
47
  if (node.tag === "table:covered-table-cell") throw new Error(`cell (${row}, ${column}) is covered by a merged range -- address the merge's own anchor cell instead`);
@@ -13,6 +13,8 @@ declare class OdsSheet {
13
13
  set name(value: string);
14
14
  get printSettings(): ContentSheetPrintSettings;
15
15
  set printSettings(value: ContentSheetPrintSettings);
16
+ setColumnWidth(index: number, widthPt: number): void;
17
+ setRowHeight(index: number, heightPt: number): void;
16
18
  cell(row: number, column: number): OdsCell;
17
19
  cellAt(reference: string): OdsCell;
18
20
  mergeCells(startRow: number, startColumn: number, rowSpan: number, colSpan: number): OdsCell;
@@ -13,6 +13,8 @@ declare class OdsSheet {
13
13
  set name(value: string);
14
14
  get printSettings(): ContentSheetPrintSettings;
15
15
  set printSettings(value: ContentSheetPrintSettings);
16
+ setColumnWidth(index: number, widthPt: number): void;
17
+ setRowHeight(index: number, heightPt: number): void;
16
18
  cell(row: number, column: number): OdsCell;
17
19
  cellAt(reference: string): OdsCell;
18
20
  mergeCells(startRow: number, startColumn: number, rowSpan: number, colSpan: number): OdsCell;
@@ -1,6 +1,7 @@
1
1
  import { removeChild, setAttr } from "../../xml/edit.js";
2
2
  import { COVERED_CELL_TAG, resolveCellNode } from "./address.js";
3
3
  import { OdsCell } from "./cell.js";
4
+ import { writeColumnWidth, writeRowHeight } from "./column-row.js";
4
5
  import { readSheetPrintSettings, writeSheetPrintSettings } from "./print-settings.js";
5
6
  import { attr } from "ooxml.js";
6
7
  import { parseCellReference } from "odf.js";
@@ -34,6 +35,12 @@ var OdsSheet = class {
34
35
  set printSettings(value) {
35
36
  writeSheetPrintSettings(this.pkg, this.live(), value);
36
37
  }
38
+ setColumnWidth(index, widthPt) {
39
+ writeColumnWidth(this.pkg, this.live(), index, widthPt);
40
+ }
41
+ setRowHeight(index, heightPt) {
42
+ writeRowHeight(this.pkg, this.live(), index, heightPt);
43
+ }
37
44
  cell(row, column) {
38
45
  const node = resolveCellNode(this.live(), row, column);
39
46
  if (node.tag === "table:covered-table-cell") throw new Error(`cell (${row}, ${column}) is covered by a merged range -- address the merge's own anchor cell instead`);
package/dist/index.cjs CHANGED
@@ -675,6 +675,7 @@ exports.pdfToOdp = require_convert_convert.pdfToOdp;
675
675
  exports.pdfToOds = require_convert_convert.pdfToOds;
676
676
  exports.pdfToOdt = require_convert_convert.pdfToOdt;
677
677
  exports.pdfToPptx = require_convert_convert.pdfToPptx;
678
+ exports.pdfToXlsx = require_convert_convert.pdfToXlsx;
678
679
  exports.pptxPdfCodec = require_convert_codec.pptxPdfCodec;
679
680
  exports.pptxToOdp = require_convert_convert.pptxToOdp;
680
681
  exports.pptxToPdf = require_convert_convert.pptxToPdf;
@@ -760,7 +761,9 @@ Object.defineProperty(exports, "writePdf", {
760
761
  return pdf_codec.writePdf;
761
762
  }
762
763
  });
764
+ exports.xlsxPdfCodec = require_convert_codec.xlsxPdfCodec;
763
765
  exports.xlsxToOds = require_convert_convert.xlsxToOds;
766
+ exports.xlsxToPdf = require_convert_convert.xlsxToPdf;
764
767
  Object.defineProperty(exports, "xmlCodec", {
765
768
  enumerable: true,
766
769
  get: function() {
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { docxPdfCodec, odgPdfCodec, odpPdfCodec, odpPptxCodec, odsPdfCodec, odsXlsxCodec, odtDocxCodec, odtPdfCodec, pptxPdfCodec } from "./convert/codec.cjs";
2
- import { DocumentBridgeOptions, DocumentToPdfOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToOdt, docxToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToPdf, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pptxToOdp, pptxToPdf, xlsxToOds } from "./convert/convert.cjs";
1
+ import { DocumentBridgeOptions, DocumentToPdfOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToOdt, docxToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToPdf, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf } from "./convert/convert.cjs";
3
2
  import { ConversionRequest, ConversionResult, Diagnostic, DocumentConverter, DocumentFormat, DocumentPayload } from "./convert/port.cjs";
3
+ import { docxPdfCodec, odgPdfCodec, odpPdfCodec, odpPptxCodec, odsPdfCodec, odsXlsxCodec, odtDocxCodec, odtPdfCodec, pptxPdfCodec, xlsxPdfCodec } from "./convert/codec.cjs";
4
4
  import { createLocalDocumentConverter } from "./convert/local.cjs";
5
5
  import { CONTENT_FORMAT_VERSION, ContentDocument, ContentDocumentSchema } from "./model/content.cjs";
6
6
  import { buildDocxPackage } from "./edit/docx/content.cjs";
@@ -69,4 +69,4 @@ import { throwIfAborted } from "./ports/abort.cjs";
69
69
  import { ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValueSchema, ContentDocumentJson, 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";
70
70
  import { LoadedMathFont, MathFont, MathFontDescriptorMetrics, NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfParseError, PositionedFormula, ReadPdfOptions, WinAnsiSubstitution, WritePdfOptions, loadMathFont, pdfCodec, readPdf, writePdf } from "pdf-codec";
71
71
  import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Package, PackageSchema, Part, PartSchema, Relationship, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElementSchema, XmlNode, XmlNodeSchema, XmlPart, XmlPartSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, attr, base64ToBytes, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, elementsWithTag, encodeCompactPackage, encodePackage, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, resolveRelationships, rootElement, serializePackage, textContent as textContent$1, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
72
- export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, COLOR_BLACK, CONTENT_FORMAT_VERSION, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFormat, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EmbeddedFormula, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, type HsqldbColumn, HsqldbRowFormatError, HsqldbScriptParseError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutDocumentJson, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type Margins, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, OdbNoEmbeddedDataSourceError, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, type OdpContentResult, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, type OdtContentResult, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type PresentationLayoutResult, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type StandaloneFormulaContent, 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, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodePackage, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToOdt, docxToPdf, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodePackage, firstChildByLocalName, fixedClock, flipY, fromCompact, displayTextFor as hsqldbCellDisplayText, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, mapMathVariant, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxToOds, xmlCodec, zipPackage };
72
+ export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, COLOR_BLACK, CONTENT_FORMAT_VERSION, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFormat, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EmbeddedFormula, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, type HsqldbColumn, HsqldbRowFormatError, HsqldbScriptParseError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutDocumentJson, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type Margins, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, OdbNoEmbeddedDataSourceError, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, type OdpContentResult, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, type OdtContentResult, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type PresentationLayoutResult, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type StandaloneFormulaContent, 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, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodePackage, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToOdt, docxToPdf, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodePackage, firstChildByLocalName, fixedClock, flipY, fromCompact, displayTextFor as hsqldbCellDisplayText, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, mapMathVariant, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };