File import and export

Convert Office files into product snapshots, and serialize edited snapshots back to files.

File import and export connects external file formats with the content models used by Univer. Import parses a file into the corresponding product snapshot; export serializes that product’s snapshot into the chosen output format.

From files to snapshots

For Office files, .xlsx, .docx, and .pptx are OOXML packages containing XML and resources such as images; .xls, .doc, and .ppt use legacy binary structures. CSV and TSV are text formats. Submit the original supported file: the conversion module handles decoding, package parsing, and resource mapping.

A snapshot is a product’s content state that can be saved and restored. View the six product snapshot schemas

Import: file → snapshot

Parse content, styles, and resources into the corresponding Sheet, Doc, Slide, Relational Table, or other product model.

100%

Export: snapshot → file

Read the current product snapshot and write the target format’s structure and resources. A snapshot is the runtime content model, commonly transferred or stored as JSON.

100%

Sheet example: calculate formulas, pivots, and number formats according to the selected policy, then update the snapshot. See server-side calculation.

Snapshot data structures

Each product has its own snapshot contract for persisting content and resource references, usually as JSON. Follow the interface links for field definitions, types, and examples.

ProductSnapshot interfaceMain contents
SheetsIWorkbookDataWorksheets, cells, shared styles, and plugin resources.
DocsIDocumentDataBody, paragraphs, styles, headers, footers, and resources.
SlidesISlideDataSlides, elements, masters, themes, and resources.
Relational TableIBaseSnapshotTables, fields, records, views, and their order.
Canvas (Canvases)IBoardDataPages, elements, themes, and resources.
PDFIPdfUnitDataSource document, durable edit state, and resource bindings.

Use the product Facade’s save() to obtain the current snapshot and its creation API to restore it. Use Facade APIs to edit running content. For PDF, pdf.save() preserves both the source baseline and editState.

Formats by product

The Office and table formats below follow the direct Rust Exchange routes. PDF uses its own conversion module and is listed separately in the same table.

ProductImport / compileExportScope
Sheets.xls, .xlsx, .csv, .tsv.xlsx, .csv, .tsvCSV/TSV represents one worksheet.
Docs.doc, .docx.docxLegacy DOC imports into the Docs model; output uses DOCX.
Slides.ppt, .pptx.pptxLegacy PPT imports into the Slides model; output uses PPTX.
Relational Table.xls, .xlsx, .csv, .tsv.xlsx, .csv, .tsvCSV/TSV represents one table; XLSX supports table and field mapping.
Canvas (Canvases)Mermaid (.mmd / source text).pptxMermaid produces an import draft, applied through the Canvases Facade before saving a snapshot; PPTX exports the active page.
PDF.pdf.pdfRequires the PDF conversion service; this is separate from the Rust Exchange CLI.
  • Legacy .xls, .doc, and .ppt are import formats; their output formats are .xlsx, .docx, and .pptx respectively.
  • CSV/TSV exports select one worksheet or Relational Table table. Keep the product snapshot when retaining the complete content model and its resources.
  • SDK entry points can accept different extensions. Formats such as .xlsm, .pptm, .ppsx, .ppsm, and .potx require checking the deployed backend and browser API; they are not additional direct Rust CLI format names.

Calculation during conversion

Supported spreadsheet conversion workflows can combine file conversion with server-side calculation:

  • Formula calculation: fill missing cached results on import, or recalculate before export according to the selected policy.
  • Pivot calculation: calculate grouping and aggregation from source data and pivot configuration, then materialize the results for the snapshot or exported workbook.
  • Number-format calculation: turn values into date, percentage, currency, and other formatted display text. CSV/TSV exports can choose display values or raw values.

Continue with Headless and server-side calculation for the related content-processing workflow.

Integration

File conversion belongs to the Server SDK. Your application provides upload, task handling, storage, and download endpoints. Snapshot conversion can run without collaboration; shared-document export reads a confirmed revision after pending edits have synchronized.

Start with File conversion integration and Node.js file conversion.

Format support and preservation of individual features are separate. Use each product’s feature list and real business files to verify formulas, images, styles, and layout through import, editing, and export.

Back to all features

How is this guide?

© 2026 DreamNum Co., Ltd.