@cj-tech-master/excelts 6.2.0 → 7.0.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 +45 -17
- package/README_zh.md +43 -15
- package/dist/browser/index.browser.d.ts +1 -1
- package/dist/browser/index.browser.js +1 -1
- package/dist/browser/index.d.ts +2 -2
- package/dist/browser/index.js +1 -1
- package/dist/browser/modules/excel/stream/workbook-writer.browser.d.ts +0 -2
- package/dist/browser/modules/excel/stream/workbook-writer.d.ts +2 -2
- package/dist/browser/modules/excel/types.d.ts +0 -2
- package/dist/browser/modules/pdf/excel-bridge.d.ts +29 -0
- package/dist/browser/modules/pdf/excel-bridge.js +423 -0
- package/dist/browser/modules/pdf/index.d.ts +22 -24
- package/dist/browser/modules/pdf/index.js +22 -25
- package/dist/browser/modules/pdf/pdf.d.ts +121 -0
- package/dist/browser/modules/pdf/pdf.js +255 -0
- package/dist/browser/modules/pdf/render/layout-engine.d.ts +10 -8
- package/dist/browser/modules/pdf/render/layout-engine.js +115 -209
- package/dist/browser/modules/pdf/render/pdf-exporter.d.ts +9 -62
- package/dist/browser/modules/pdf/render/pdf-exporter.js +38 -78
- package/dist/browser/modules/pdf/render/style-converter.d.ts +20 -18
- package/dist/browser/modules/pdf/render/style-converter.js +24 -23
- package/dist/browser/modules/pdf/types.d.ts +193 -11
- package/dist/browser/modules/pdf/types.js +22 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/modules/pdf/excel-bridge.js +426 -0
- package/dist/cjs/modules/pdf/index.js +25 -28
- package/dist/cjs/modules/pdf/pdf.js +258 -0
- package/dist/cjs/modules/pdf/render/layout-engine.js +116 -210
- package/dist/cjs/modules/pdf/render/pdf-exporter.js +37 -79
- package/dist/cjs/modules/pdf/render/style-converter.js +24 -23
- package/dist/cjs/modules/pdf/types.js +23 -2
- package/dist/esm/index.browser.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/modules/pdf/excel-bridge.js +423 -0
- package/dist/esm/modules/pdf/index.js +22 -25
- package/dist/esm/modules/pdf/pdf.js +255 -0
- package/dist/esm/modules/pdf/render/layout-engine.js +115 -209
- package/dist/esm/modules/pdf/render/pdf-exporter.js +38 -78
- package/dist/esm/modules/pdf/render/style-converter.js +24 -23
- package/dist/esm/modules/pdf/types.js +22 -1
- package/dist/iife/excelts.iife.js +728 -251
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +34 -34
- package/dist/types/index.browser.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/modules/excel/stream/workbook-writer.browser.d.ts +0 -2
- package/dist/types/modules/excel/stream/workbook-writer.d.ts +2 -2
- package/dist/types/modules/excel/types.d.ts +0 -2
- package/dist/types/modules/pdf/excel-bridge.d.ts +29 -0
- package/dist/types/modules/pdf/index.d.ts +22 -24
- package/dist/types/modules/pdf/pdf.d.ts +121 -0
- package/dist/types/modules/pdf/render/layout-engine.d.ts +10 -8
- package/dist/types/modules/pdf/render/pdf-exporter.d.ts +9 -62
- package/dist/types/modules/pdf/render/style-converter.d.ts +20 -18
- package/dist/types/modules/pdf/types.d.ts +193 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,15 +6,12 @@ Modern TypeScript Excel Workbook Manager - Read, manipulate and write spreadshee
|
|
|
6
6
|
|
|
7
7
|
## About This Project
|
|
8
8
|
|
|
9
|
-
ExcelTS is a
|
|
9
|
+
ExcelTS is a zero-dependency TypeScript toolkit for spreadsheets and documents:
|
|
10
10
|
|
|
11
|
-
- 🚀 **Zero Runtime Dependencies**
|
|
12
|
-
-
|
|
13
|
-
- ✅ **
|
|
14
|
-
- ✅ **
|
|
15
|
-
- ✅ **Enhanced Testing** - Migrated to Vitest with browser testing support
|
|
16
|
-
- ✅ **ESM First** - Native ES Module support with CommonJS compatibility
|
|
17
|
-
- ✅ **Named Exports** - All exports are named for better tree-shaking
|
|
11
|
+
- 🚀 **Zero Runtime Dependencies** — Pure TypeScript, no external packages
|
|
12
|
+
- 📦 **Five Modules** — Excel (XLSX/JSON), PDF (standalone engine + Excel bridge), CSV (RFC 4180), Archive (ZIP/TAR), Stream (cross-platform)
|
|
13
|
+
- ✅ **Cross-Platform** — Node.js 22+, Bun, Chrome 89+, Firefox 102+, Safari 14.1+
|
|
14
|
+
- ✅ **ESM First** — Native ES Modules with CommonJS compatibility and full tree-shaking
|
|
18
15
|
|
|
19
16
|
## Translations
|
|
20
17
|
|
|
@@ -104,7 +101,7 @@ cell.fill = {
|
|
|
104
101
|
- Pivot tables
|
|
105
102
|
|
|
106
103
|
- **PDF Export**
|
|
107
|
-
-
|
|
104
|
+
- Full-featured, zero-dependency PDF engine (standalone or with Excel)
|
|
108
105
|
- Full cell styling (fonts, colors, borders, fills, alignment)
|
|
109
106
|
- Automatic pagination with repeat header rows
|
|
110
107
|
- TrueType font embedding for Unicode/CJK text
|
|
@@ -141,7 +138,7 @@ import { Readable, pipeline, createTransform } from "@cj-tech-master/excelts/str
|
|
|
141
138
|
|
|
142
139
|
Each subpath supports `browser`, `import` (ESM), and `require` (CJS) conditions. See the module READMEs for details:
|
|
143
140
|
|
|
144
|
-
- [PDF Module](src/modules/pdf/README.md) -
|
|
141
|
+
- [PDF Module](src/modules/pdf/README.md) - Full-featured zero-dependency PDF engine with encryption and font embedding
|
|
145
142
|
- [CSV Module](src/modules/csv/README.md) - RFC 4180 parser/formatter, streaming, data generation
|
|
146
143
|
- [Archive Module](src/modules/archive/README.md) - ZIP/TAR create/read/edit, compression, encryption
|
|
147
144
|
- [Stream Module](src/modules/stream/README.md) - Cross-platform Readable/Writable/Transform/Duplex
|
|
@@ -151,7 +148,7 @@ Each subpath supports `browser`, `import` (ESM), and `require` (CJS) conditions.
|
|
|
151
148
|
Export any workbook to PDF with zero external dependencies:
|
|
152
149
|
|
|
153
150
|
```javascript
|
|
154
|
-
import { Workbook,
|
|
151
|
+
import { Workbook, excelToPdf } from "@cj-tech-master/excelts";
|
|
155
152
|
|
|
156
153
|
const workbook = new Workbook();
|
|
157
154
|
const sheet = workbook.addWorksheet("Report");
|
|
@@ -163,7 +160,7 @@ sheet.addRow({ product: "Widget", revenue: 1000 });
|
|
|
163
160
|
sheet.getColumn("revenue").numFmt = "$#,##0.00";
|
|
164
161
|
|
|
165
162
|
// One-line export
|
|
166
|
-
const pdf =
|
|
163
|
+
const pdf = excelToPdf(workbook, {
|
|
167
164
|
showGridLines: true,
|
|
168
165
|
showPageNumbers: true,
|
|
169
166
|
title: "Sales Report"
|
|
@@ -184,13 +181,13 @@ window.open(url);
|
|
|
184
181
|
```javascript
|
|
185
182
|
const workbook = new Workbook();
|
|
186
183
|
await workbook.xlsx.readFile("input.xlsx");
|
|
187
|
-
const pdf =
|
|
184
|
+
const pdf = excelToPdf(workbook);
|
|
188
185
|
```
|
|
189
186
|
|
|
190
187
|
### Encryption
|
|
191
188
|
|
|
192
189
|
```javascript
|
|
193
|
-
const pdf =
|
|
190
|
+
const pdf = excelToPdf(workbook, {
|
|
194
191
|
encryption: {
|
|
195
192
|
ownerPassword: "admin",
|
|
196
193
|
userPassword: "reader",
|
|
@@ -204,11 +201,42 @@ const pdf = exportPdf(workbook, {
|
|
|
204
201
|
```javascript
|
|
205
202
|
import { readFileSync } from "fs";
|
|
206
203
|
|
|
207
|
-
const pdf =
|
|
204
|
+
const pdf = excelToPdf(workbook, {
|
|
208
205
|
font: readFileSync("NotoSansSC-Regular.ttf") // TrueType font for CJK text
|
|
209
206
|
});
|
|
210
207
|
```
|
|
211
208
|
|
|
209
|
+
### Standalone PDF (No Excel)
|
|
210
|
+
|
|
211
|
+
Generate PDFs from plain data — no workbook, no Map objects, no boilerplate:
|
|
212
|
+
|
|
213
|
+
```javascript
|
|
214
|
+
import { pdf } from "@cj-tech-master/excelts/pdf";
|
|
215
|
+
|
|
216
|
+
// Simplest — pass a 2D array
|
|
217
|
+
const bytes = pdf([
|
|
218
|
+
["Product", "Revenue"],
|
|
219
|
+
["Widget", 1000],
|
|
220
|
+
["Gadget", 2500]
|
|
221
|
+
]);
|
|
222
|
+
|
|
223
|
+
// With column widths and styled cells
|
|
224
|
+
const bytes = pdf(
|
|
225
|
+
{
|
|
226
|
+
name: "Report",
|
|
227
|
+
columns: [
|
|
228
|
+
{ width: 25, header: "Product" },
|
|
229
|
+
{ width: 15, header: "Revenue" }
|
|
230
|
+
],
|
|
231
|
+
data: [
|
|
232
|
+
["Widget", 1000],
|
|
233
|
+
["Gadget", 2500]
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
{ showGridLines: true }
|
|
237
|
+
);
|
|
238
|
+
```
|
|
239
|
+
|
|
212
240
|
For the full API reference and all options, see the [PDF Module documentation](src/modules/pdf/README.md).
|
|
213
241
|
|
|
214
242
|
## Archive Utilities (ZIP/TAR)
|
|
@@ -506,8 +534,8 @@ import {
|
|
|
506
534
|
xmlDecode,
|
|
507
535
|
|
|
508
536
|
// PDF export
|
|
509
|
-
|
|
510
|
-
|
|
537
|
+
pdf, // Simplest: pdf([["A", 1], ["B", 2]]) → Uint8Array
|
|
538
|
+
excelToPdf, // Workbook -> Uint8Array (Excel-to-PDF)
|
|
511
539
|
PageSizes, // Built-in page size definitions
|
|
512
540
|
PdfError, // Base PDF error
|
|
513
541
|
PdfRenderError, // Layout/rendering failures
|
package/README_zh.md
CHANGED
|
@@ -6,15 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
## 关于本项目
|
|
8
8
|
|
|
9
|
-
ExcelTS
|
|
9
|
+
ExcelTS 是零依赖的 TypeScript 电子表格与文档工具包:
|
|
10
10
|
|
|
11
|
-
- 🚀 **零运行时依赖**
|
|
12
|
-
-
|
|
13
|
-
- ✅
|
|
14
|
-
- ✅
|
|
15
|
-
- ✅ **增强的测试** - 迁移到 Vitest 并支持浏览器测试
|
|
16
|
-
- ✅ **ESM 优先** - 原生 ES Module 支持,兼容 CommonJS
|
|
17
|
-
- ✅ **命名导出** - 所有导出都是命名导出,更好的 tree-shaking
|
|
11
|
+
- 🚀 **零运行时依赖** — 纯 TypeScript 实现,无任何外部包依赖
|
|
12
|
+
- 📦 **五大模块** — Excel(XLSX/JSON)、PDF(独立引擎 + Excel 桥接)、CSV(RFC 4180)、Archive(ZIP/TAR)、Stream(跨平台)
|
|
13
|
+
- ✅ **跨平台** — Node.js 22+、Bun、Chrome 89+、Firefox 102+、Safari 14.1+
|
|
14
|
+
- ✅ **ESM 优先** — 原生 ES Modules,兼容 CommonJS,完整 tree-shaking 支持
|
|
18
15
|
|
|
19
16
|
## 翻译
|
|
20
17
|
|
|
@@ -151,7 +148,7 @@ import { Readable, pipeline, createTransform } from "@cj-tech-master/excelts/str
|
|
|
151
148
|
零依赖将任意工作簿导出为 PDF:
|
|
152
149
|
|
|
153
150
|
```javascript
|
|
154
|
-
import { Workbook,
|
|
151
|
+
import { Workbook, excelToPdf } from "@cj-tech-master/excelts";
|
|
155
152
|
|
|
156
153
|
const workbook = new Workbook();
|
|
157
154
|
const sheet = workbook.addWorksheet("报告");
|
|
@@ -163,7 +160,7 @@ sheet.addRow({ product: "组件A", revenue: 1000 });
|
|
|
163
160
|
sheet.getColumn("revenue").numFmt = "¥#,##0.00";
|
|
164
161
|
|
|
165
162
|
// 一行导出
|
|
166
|
-
const pdf =
|
|
163
|
+
const pdf = excelToPdf(workbook, {
|
|
167
164
|
showGridLines: true,
|
|
168
165
|
showPageNumbers: true,
|
|
169
166
|
title: "销售报告"
|
|
@@ -184,13 +181,13 @@ window.open(url);
|
|
|
184
181
|
```javascript
|
|
185
182
|
const workbook = new Workbook();
|
|
186
183
|
await workbook.xlsx.readFile("input.xlsx");
|
|
187
|
-
const pdf =
|
|
184
|
+
const pdf = excelToPdf(workbook);
|
|
188
185
|
```
|
|
189
186
|
|
|
190
187
|
### 加密
|
|
191
188
|
|
|
192
189
|
```javascript
|
|
193
|
-
const pdf =
|
|
190
|
+
const pdf = excelToPdf(workbook, {
|
|
194
191
|
encryption: {
|
|
195
192
|
ownerPassword: "admin",
|
|
196
193
|
userPassword: "reader",
|
|
@@ -204,11 +201,42 @@ const pdf = exportPdf(workbook, {
|
|
|
204
201
|
```javascript
|
|
205
202
|
import { readFileSync } from "fs";
|
|
206
203
|
|
|
207
|
-
const pdf =
|
|
204
|
+
const pdf = excelToPdf(workbook, {
|
|
208
205
|
font: readFileSync("NotoSansSC-Regular.ttf") // 嵌入 TrueType 字体以支持中文
|
|
209
206
|
});
|
|
210
207
|
```
|
|
211
208
|
|
|
209
|
+
### 独立 PDF 生成(无需 Excel)
|
|
210
|
+
|
|
211
|
+
无需工作簿,直接从数组数据生成 PDF:
|
|
212
|
+
|
|
213
|
+
```javascript
|
|
214
|
+
import { pdf } from "@cj-tech-master/excelts/pdf";
|
|
215
|
+
|
|
216
|
+
// 最简方式 — 传入二维数组
|
|
217
|
+
const bytes = pdf([
|
|
218
|
+
["产品", "收入"],
|
|
219
|
+
["组件A", 1000],
|
|
220
|
+
["组件B", 2500]
|
|
221
|
+
]);
|
|
222
|
+
|
|
223
|
+
// 带列宽和样式
|
|
224
|
+
const bytes = pdf(
|
|
225
|
+
{
|
|
226
|
+
name: "报告",
|
|
227
|
+
columns: [
|
|
228
|
+
{ width: 25, header: "产品" },
|
|
229
|
+
{ width: 15, header: "收入" }
|
|
230
|
+
],
|
|
231
|
+
data: [
|
|
232
|
+
["组件A", 1000],
|
|
233
|
+
["组件B", 2500]
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
{ showGridLines: true }
|
|
237
|
+
);
|
|
238
|
+
```
|
|
239
|
+
|
|
212
240
|
完整 API 参考和所有选项请查看 [PDF 模块文档](src/modules/pdf/README.md)。
|
|
213
241
|
|
|
214
242
|
## 归档工具(ZIP/TAR)
|
|
@@ -504,8 +532,8 @@ import {
|
|
|
504
532
|
xmlDecode,
|
|
505
533
|
|
|
506
534
|
// PDF 导出
|
|
507
|
-
|
|
508
|
-
|
|
535
|
+
pdf, // 最简单:pdf([["A", 1], ["B", 2]]) → Uint8Array
|
|
536
|
+
excelToPdf, // Workbook -> Uint8Array(Excel 转 PDF)
|
|
509
537
|
PageSizes, // 内置页面尺寸定义
|
|
510
538
|
PdfError, // PDF 基础错误
|
|
511
539
|
PdfRenderError, // 布局/渲染错误
|
|
@@ -37,6 +37,6 @@ export { xmlEncode, xmlDecode } from "./utils/utils.base.js";
|
|
|
37
37
|
export { DateParser, DateFormatter, getSupportedFormats, type DateFormat } from "./utils/datetime.js";
|
|
38
38
|
export { BaseError, type BaseErrorOptions, toError, errorToJSON, getErrorChain, getRootCause } from "./utils/errors.js";
|
|
39
39
|
export { concatUint8Arrays, toUint8Array, stringToUint8Array, uint8ArrayToString } from "./utils/binary.js";
|
|
40
|
-
export {
|
|
40
|
+
export { pdf, excelToPdf, PageSizes, PdfError, PdfRenderError, PdfFontError, PdfStructureError, isPdfError } from "./modules/pdf/index.js";
|
|
41
41
|
export type { PdfExportOptions, PdfPageSize, PdfOrientation, PdfMargins, PageSizeName, PdfColor } from "./modules/pdf/index.js";
|
|
42
42
|
export { ExcelError, isExcelError, ExcelFileError, ExcelDownloadError, ExcelNotSupportedError, ExcelStreamStateError, InvalidAddressError, ColumnOutOfBoundsError, RowOutOfBoundsError, MergeConflictError, InvalidValueTypeError, XmlParseError, WorksheetNameError, PivotTableError, TableError, ImageError, MaxItemsExceededError } from "./modules/excel/errors.js";
|
|
@@ -58,7 +58,7 @@ export { concatUint8Arrays, toUint8Array, stringToUint8Array, uint8ArrayToString
|
|
|
58
58
|
// =============================================================================
|
|
59
59
|
// PDF Export (Browser-compatible, zero external dependencies)
|
|
60
60
|
// =============================================================================
|
|
61
|
-
export {
|
|
61
|
+
export { pdf, excelToPdf, PageSizes, PdfError, PdfRenderError, PdfFontError, PdfStructureError, isPdfError } from "./modules/pdf/index.js";
|
|
62
62
|
// =============================================================================
|
|
63
63
|
// Errors
|
|
64
64
|
// =============================================================================
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type { PivotTable, PivotTableModel, PivotTableValue, PivotTableSource, Ca
|
|
|
19
19
|
export type { FormCheckboxModel, FormCheckboxOptions, FormControlRange, FormControlAnchor } from "./modules/excel/form-control.js";
|
|
20
20
|
export type { WorkbookReaderOptions, ParseEvent, SharedStringEvent, WorksheetReadyEvent, HyperlinksEvent } from "./modules/excel/stream/workbook-reader.js";
|
|
21
21
|
export type { WorksheetReaderOptions, WorksheetEvent, RowEvent, HyperlinkEvent, WorksheetHyperlink } from "./modules/excel/stream/worksheet-reader.js";
|
|
22
|
-
export type { WorkbookWriterOptions, WorkbookZipOptions,
|
|
22
|
+
export type { WorkbookWriterOptions, WorkbookZipOptions, ZlibOptions } from "./modules/excel/stream/workbook-writer.js";
|
|
23
23
|
export type { CsvOptions, CsvInput } from "./modules/excel/workbook.js";
|
|
24
24
|
export { CsvParserStream, CsvFormatterStream, createCsvParserStream, createCsvFormatterStream } from "./modules/csv/stream/index.js";
|
|
25
25
|
export { DefinedNames, type DefinedNameModel } from "./modules/excel/defined-names.js";
|
|
@@ -37,6 +37,6 @@ export { xmlEncode, xmlDecode } from "./utils/utils.base.js";
|
|
|
37
37
|
export { DateParser, DateFormatter, getSupportedFormats, type DateFormat } from "./utils/datetime.js";
|
|
38
38
|
export { BaseError, type BaseErrorOptions, toError, errorToJSON, getErrorChain, getRootCause } from "./utils/errors.js";
|
|
39
39
|
export { concatUint8Arrays, toUint8Array, stringToUint8Array, uint8ArrayToString } from "./utils/binary.js";
|
|
40
|
-
export {
|
|
40
|
+
export { pdf, excelToPdf, PageSizes, PdfError, PdfRenderError, PdfFontError, PdfStructureError, isPdfError } from "./modules/pdf/index.js";
|
|
41
41
|
export type { PdfExportOptions, PdfPageSize, PdfOrientation, PdfMargins, PageSizeName, PdfColor } from "./modules/pdf/index.js";
|
|
42
42
|
export { ExcelError, isExcelError, ExcelFileError, ExcelDownloadError, ExcelNotSupportedError, ExcelStreamStateError, InvalidAddressError, ColumnOutOfBoundsError, RowOutOfBoundsError, MergeConflictError, InvalidValueTypeError, XmlParseError, WorksheetNameError, PivotTableError, TableError, ImageError, MaxItemsExceededError } from "./modules/excel/errors.js";
|
package/dist/browser/index.js
CHANGED
|
@@ -54,7 +54,7 @@ export { concatUint8Arrays, toUint8Array, stringToUint8Array, uint8ArrayToString
|
|
|
54
54
|
// =============================================================================
|
|
55
55
|
// PDF Export
|
|
56
56
|
// =============================================================================
|
|
57
|
-
export {
|
|
57
|
+
export { pdf, excelToPdf, PageSizes, PdfError, PdfRenderError, PdfFontError, PdfStructureError, isPdfError } from "./modules/pdf/index.js";
|
|
58
58
|
// =============================================================================
|
|
59
59
|
// Errors
|
|
60
60
|
// =============================================================================
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Extends base with file path support and file system image loading.
|
|
5
5
|
*/
|
|
6
6
|
import { WorksheetWriter } from "./worksheet-writer.js";
|
|
7
|
-
import { WorkbookWriterBase, type WorkbookWriterOptions as BaseOptions, type WorkbookZipOptions, type
|
|
8
|
-
export type { WorkbookZipOptions,
|
|
7
|
+
import { WorkbookWriterBase, type WorkbookWriterOptions as BaseOptions, type WorkbookZipOptions, type ZlibOptions } from "./workbook-writer.browser.js";
|
|
8
|
+
export type { WorkbookZipOptions, ZlibOptions };
|
|
9
9
|
export interface WorkbookWriterOptions extends BaseOptions {
|
|
10
10
|
/** If stream not specified, this field specifies the path to a file to write the XLSX workbook to */
|
|
11
11
|
filename?: string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Excel-to-PDF Bridge
|
|
3
|
+
*
|
|
4
|
+
* Converts Excel Workbook data into the PDF module's independent data model.
|
|
5
|
+
* This is the ONLY file in the PDF module that imports from @excel.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { Workbook } from "excelts";
|
|
10
|
+
* import { excelToPdf } from "excelts/pdf";
|
|
11
|
+
*
|
|
12
|
+
* const workbook = new Workbook();
|
|
13
|
+
* // ... build workbook ...
|
|
14
|
+
* const pdf = excelToPdf(workbook);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import type { Workbook } from "../excel/workbook.js";
|
|
18
|
+
import { type PdfExportOptions } from "./types.js";
|
|
19
|
+
/**
|
|
20
|
+
* Export an Excel Workbook directly to PDF.
|
|
21
|
+
*
|
|
22
|
+
* This is a convenience function that converts the Workbook to the PDF module's
|
|
23
|
+
* data model and then generates the PDF.
|
|
24
|
+
*
|
|
25
|
+
* @param workbook - An Excel Workbook instance
|
|
26
|
+
* @param options - PDF export options
|
|
27
|
+
* @returns PDF file as a Uint8Array
|
|
28
|
+
*/
|
|
29
|
+
export declare function excelToPdf(workbook: Workbook, options?: PdfExportOptions): Uint8Array;
|