Export

Export documents to PDF, Markdown, HTML, RTF, plain text and JSON.

Toolbar button

import { Export, Markdown } from 'vue-echo-editor'

const extensions = [
  BaseKit,
  // …
  Markdown, // enables the Markdown option
  Export.configure({
    formats: ['pdf', 'markdown', 'html', 'text', 'rtf', 'json'],
    filename: () => `notes-${new Date().toISOString().slice(0, 10)}`,
  }),
]
OptionTypeDefaultDescription
formatsExportFormat[]allFormats shown in the dropdown, in order.
filenamestring | () => string'document'File name without extension.

Formats

FormatHow it works
pdfOpens the browser print dialog with a clean, styled copy of the document — choose Save as PDF. No extra dependencies.
markdowneditor.getMarkdown() — requires the Markdown extension.
htmlA standalone HTML file that embeds the editor's content styles.
textPlain text with blank lines between blocks.
rtfRich Text Format (headings, bold/italic/underline/strike, sub/superscript, lists, task lists, quotes, code, tables). Opens in Word, Pages and LibreOffice.
jsonThe Tiptap/ProseMirror JSON document — lossless.

Programmatic export

// Through the command (downloads a file)
editor.commands.exportDocument('markdown', 'my-notes')

// Or get the content without downloading
import { serialize, jsonToRTF, toPlainText, downloadFile } from 'vue-echo-editor'

const { content, mimeType, extension } = serialize(editor, 'rtf', 'report')
await fetch('/api/documents', { method: 'POST', body: content, headers: { 'content-type': mimeType } })

Word (.docx)

DOCX export needs a heavier converter, so it's not built in. The examples app contains a complete ExportWord plugin built with prosemirror-docx that you can copy.