---
title: "Additional import and export formats in Document Authoring"
canonical_url: "https://www.nutrient.io/guides/document-authoring/working-with-documents/additional-import-and-export-formats/"
md_url: "https://www.nutrient.io/guides/document-authoring/working-with-documents/additional-import-and-export-formats.md"
last_updated: "2026-06-08T17:11:05.445Z"
description: "Learn how to import and export RTF, ODT, Markdown, and plain text documents in Document Authoring using the generic import and export APIs."
---

# Use additional import and export formats

Before you start, ensure the Document Authoring library is installed and running. Refer to the [getting started](https://www.nutrient.io/sdk/document-authoring/getting-started.md) guide.

Document Authoring provides generic import and export APIs that work across DOCX, PDF, DocJSON, and additional formats such as RTF, ODT, Markdown, plain text, and supported image types.

## Supported formats

Use [`DocAuthSystem.import()`](https://www.nutrient.io/api/document-authoring/types/docauthsystem/#import) to import these formats:

- `docx`

- `dotx`

- `docm`

- `rtf`

- `odt`

- `markdown`

- `txt`

- `docjson`

- `png`

- `jpeg`

- `bmp`

- `gif`

- `webp`

Use [`DocAuthDocument.export()`](https://www.nutrient.io/api/document-authoring/types/docauthdocument/#export) to export these formats:

- `pdf`

- `docx`

- `markdown`

- `rtf`

- `odt`

The example code omits error handling. Add it before using this code in production.

## Import a document with automatic format detection

Use [`DocAuthSystem.import()`](https://www.nutrient.io/api/document-authoring/types/docauthsystem/#import) to import a document and let Document Authoring detect the format from the file content and optional file name:

```js

const fileInput = document.querySelector('input[type="file"]');

fileInput.addEventListener('change', async () => {
  const file = fileInput.files?.[0];
  if (!file) {
    return;
  }

  const importedDocument = await docAuthSystem.import(file, {
    fileName: file.name,
  });

  const editor = await docAuthSystem.createEditor(
    document.getElementById('editor'),
    { document: importedDocument },
  );
});

```

## Import a document with an explicit format

If you already know the format, pass it in the import configuration to skip auto-detection:

```js

const response = await fetch('/content/guide.md');

const document = await docAuthSystem.import(response, {
  format: 'markdown',
});

```

This is useful when you import data from a source where the extension or MIME type isn’t reliable.

## Export to Markdown, RTF, or ODT

Use [`DocAuthDocument.export()`](https://www.nutrient.io/api/document-authoring/types/docauthdocument/#export) with a format-specific configuration:

```js

const currentDoc = editor.currentDocument();

const markdown = await currentDoc.export({ format: 'markdown' });
const rtf = await currentDoc.export({ format: 'rtf' });
const odt = await currentDoc.export({ format: 'odt' });

```

Each call returns an `ArrayBuffer` containing the exported file data.

## Create a document from plain text

If your source content is plain text rather than an existing file, use [`DocAuthSystem.createDocumentFromPlaintext()`](https://www.nutrient.io/api/document-authoring/types/docauthsystem/#createdocumentfromplaintext):

```js

const text = `First paragraph

Second paragraph with a line break\nand continuation.`;

const textDocument = await docAuthSystem.createDocumentFromPlaintext(text, {
  pageSize: 'A4',
});

const editor = await docAuthSystem.createEditor(
  document.getElementById('editor'),
  { document: textDocument },
);

```

This method interprets:

- `\n` as a line break inside a paragraph

- `\n\n` as a paragraph break

- `\t` as spaces

## Use abort signals for long-running imports or exports

The generic import and export APIs accept an optional `AbortSignal`:

```js

const controller = new AbortController();

const document = await docAuthSystem.import(fetch('/documents/template.odt'), {
  fileName: 'template.odt',
  abortSignal: controller.signal,
});

const exported = await editor.currentDocument().export({
  format: 'markdown',
  abortSignal: controller.signal,
});

```

## Learn more

- [Document Authoring API reference](https://www.nutrient.io/api/document-authoring/)

- [DOCX support](https://www.nutrient.io/guides/document-authoring/working-with-documents/docx.md)

- [PDF support](https://www.nutrient.io/guides/document-authoring/working-with-documents/pdf.md)

- [DocJSON](https://www.nutrient.io/guides/document-authoring/working-with-documents/docjson.md)
---

## Related pages

- [Import and export DOCX files effectively](/guides/document-authoring/working-with-documents/docx.md)
- [First-class JSON support with DocJSON](/guides/document-authoring/working-with-documents/docjson.md)
- [Working with documents](/guides/document-authoring/working-with-documents/overview.md)
- [Seamlessly export PDF files in Document Authoring](/guides/document-authoring/working-with-documents/pdf.md)
- [Edit documents programmatically](/guides/document-authoring/working-with-documents/programmatic-editing.md)

