# Import and export

- Human documentation: [https://docs.univer.ai/guides/boards/features/import-export](https://docs.univer.ai/guides/boards/features/import-export)

- Agent Markdown: [https://docs.univer.ai/guides/boards/features/import-export.md](https://docs.univer.ai/guides/boards/features/import-export.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [boards/features/import-export.mdx](https://github.com/dream-num/documentation/blob/dev/content/guides/boards/features/import-export.mdx)

---

#### Package metadata

```json
{
  "preset": [],
  "plugins": [
    {
      "client": "@univerjs-pro/exchange-client",
      "locale": "@univerjs-pro/exchange-client/locale/en-US",
      "style": "@univerjs-pro/exchange-client/lib/index.css",
      "facade": "@univerjs-pro/exchange-client/facade"
    },
    {
      "client": "@univerjs-pro/boards-exchange-client",
      "locale": "@univerjs-pro/boards-exchange-client/locale/en-US",
      "style": "@univerjs-pro/boards-exchange-client/lib/index.css",
      "facade": "@univerjs-pro/boards-exchange-client/facade"
    }
  ],
  "server": true
}
```

Boards supports Mermaid source import and PPTX export through `@univerjs-pro/boards-exchange-client`.

## 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.

| Import              | Export  |
| ------------------- | ------- |
| Mermaid source text | `.pptx` |

Mermaid import inserts source text as Board elements through `insertMermaidAsync`; it is not an Office file importer. The export APIs produce `.pptx` and require a conversion backend. They do not provide PPTX import or image/PDF export. Any additional targets registered by the host application are separate capabilities.

## Register the Board runtime first

```ts
univer.registerPlugin(UniverBoardsPlugin)
univer.registerPlugin(UniverBoardsUIPlugin)
univer.registerPlugin(UniverBoardsExchangeClientPlugin)
```

Register optional element plugins before importing data that may contain those elements:

```ts
univer.registerPlugin(UniverBoardsTablePlugin)
univer.registerPlugin(UniverBoardsTableUIPlugin)
univer.registerPlugin(UniverBoardsMindPlugin)
univer.registerPlugin(UniverBoardsMindUIPlugin)
```

## Snapshot handoff

For application-level persistence, save and restore the Board snapshot:

```ts
const board = univerAPI.getActiveBoard()
const snapshot = board.getData()

univer.createUnit(UniverInstanceType.UNIVER_BOARD, snapshot)
```

## Interactive exchange

`@univerjs-pro/boards-exchange-client` registers Board export and Mermaid import APIs.

```ts
import '@univerjs-pro/exchange-client/facade'
import '@univerjs-pro/boards-exchange-client/facade'

const file = await univerAPI.exportBoardByUnitIdAsync(board.getId())
if (file) univerAPI.downloadFile(file, 'board', 'pptx')

await board.insertMermaidAsync('flowchart LR\n  A[Draft] --> B[Review]')
```

Use `exportBoardBySnapshotAsync(snapshot)` for detached data. `transformSnapshotJsonToBoardDataAsync` and `transformBoardDataToSnapshotJsonAsync` convert exchange-service snapshot blocks.

For license and deployment requirements, see [Web SDK](https://docs.univer.ai/server.md).
