Document Authoring opens XLSX spreadsheets in a browser editor, where users can edit cells, formatting, formulas, and sheets in a grid. Your app can save the result in SheetJSON or export it as XLSX or PDF. The same API runs in Node.js for server-side conversion without an editor.
Your license must include the Spreadsheet Editing component. XLSX import and export also require the XLSX Support component. Contact Sales to add these components to your license.
What you can build
- An XLSX viewer and editor inside your web app.
- A conversion step on your server that turns XLSX files into PDF.
- Spreadsheet storage in your own backend, using the native SheetJSON format.
- One upload box that opens both documents and spreadsheets.
How it works
The spreadsheet API uses three objects:
System
Create a DocAuthSystem with createDocAuthSystem(). One system handles documents and spreadsheets and loads the engine and fonts once. If your app already uses Document Authoring for documents, reuse that system.
Spreadsheet
A DocAuthSpreadsheet represents an open spreadsheet. The system returns one when it imports, loads, or creates a spreadsheet, and you use it to save or export that spreadsheet. It doesn’t expose individual cells.
Spreadsheet editor
A DocAuthSpreadsheetEditor displays a spreadsheet in a page element and enables users to edit it. The editor runs only in a browser.
A spreadsheet is the complete file. A sheet is one tab in the spreadsheet.
The method names indicate which formats they handle:
loadandsaveread and write SheetJSON, the native format. Saving and then loading preserves everything Document Authoring supports.importandexportread and write XLSX.exportalso supports PDF, andimportSpreadsheet()accepts SheetJSON.
import DocAuth from '@nutrient-sdk/document-authoring';
const system = await DocAuth.createDocAuthSystem();
const spreadsheet = await system.createSpreadsheetFromPlaintext('Hello!');
const editor = await system.createSpreadsheetEditor(document.getElementById('editor'), { spreadsheet,});Guides
Refer to these guides to work with spreadsheets:
- Getting started — Put a spreadsheet editor on a page.
- Import and load — Open XLSX files and saved spreadsheets, with progress and cancellation.
- Save and export — Store SheetJSON, and export XLSX and PDF.
- Editor — What the editor includes, and how to switch spreadsheets or remove the editor.
- Formulas — Which functions calculate and how other formulas behave.
- Node.js — Convert spreadsheets on a server.
- SheetJSON — The native spreadsheet format, with a minimal example.
For a runnable example, refer to the examples repository(opens in a new tab) on GitHub.