# Import and export

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

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

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

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

---

The APIs below need a conversion backend. Follow [file exchange integration](https://docs.univer.ai/server/import-export.md) 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.

#### 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/slides-exchange-client",
      "locale": "@univerjs-pro/slides-exchange-client/locale/en-US",
      "facade": "@univerjs-pro/slides-exchange-client/facade"
    }
  ],
  "server": true
}
```

## 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  |
| --------------- | ------- |
| `.ppt`, `.pptx` | `.pptx` |

Both `.ppt` and `.pptx` use the import APIs below. Export produces `.pptx`. The browser API does not accept `.pptm`, `.ppsx`, `.ppsm`, or `.potx`; backend format support alone does not enable them in the browser.

## Facade API

Import the facade package once in plugin mode:

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

Import a PPTX into a server-side unit:

```ts
const unitId = await univerAPI.importSlideToUnitIdAsync(file)
```

Import a PPTX as local slide data:

```ts
const slideData = await univerAPI.importSlideToSnapshotAsync(file)

if (slideData) {
  univerAPI.createPresentation(slideData)
}
```

Export the current slide deck:

```ts
const presentation = univerAPI.getActivePresentation()
const file = await univerAPI.exportSlideBySnapshotAsync(presentation.save())
```

Export a server-side slide unit:

```ts
const file = await univerAPI.exportSlideByUnitIdAsync(unitId)
```
