Import and export

The APIs below need a conversion backend. Follow file exchange integration to connect uploads, conversion, task queries, and downloads, then configure the browser plugins. Snapshot APIs also need that backend, but do not require a collaborative document. The collaboration Exchange example demonstrates Sheets; check that your target release supports the file types you need.

Plugins Info

Supported formats

The table describes the browser APIs on this page. Office file conversion requires a backend that supports the same document type and format.

ImportExport
.pdf.pdf

These APIs import and export PDF files. They do not convert PDF content to DOCX, XLSX, or PPTX. Browser printing is a separate workflow.

Choose a data path

PathPersists a server unitRequires collaborationConversion server
Unit IDYesYesRequired
SnapshotNoNoRequired

Import to a persisted unit

The input can be a browser File or a URL. Load the returned unit through the configured collaboration client.

TypeScript
const unitId = await univerAPI.importPdfToUnitIdAsync(file)if (unitId) {  const pdf = await univerAPI.getCollaboration().loadPdfAsync(unitId)  console.log(pdf?.getName())}

Import to a snapshot

Use snapshot import for a local PDF unit that should not be persisted as part of the conversion task:

TypeScript
const snapshot = await univerAPI.importPdfToSnapshotAsync(file)if (snapshot) {  univerAPI.createPdf(snapshot)}

Export and download

Export a persisted unit by ID:

TypeScript
const file = await univerAPI.exportPdfByUnitIdAsync(unitId)if (file) {  univerAPI.downloadFile(file, 'project-brief', 'pdf')}

Export the current local snapshot without persisting it first:

TypeScript
const pdf = univerAPI.getActivePdf()if (pdf) {  const file = await univerAPI.exportPdfBySnapshotAsync(pdf.save())  if (file) {    univerAPI.downloadFile(file, pdf.getName(), 'pdf')  }}

These APIs return a File. Browser printing is a separate workflow that opens the system print dialog; see Print.

How is this guide?

© 2026 DreamNum Co., Ltd.