@richhtmleditor/export
v1.1.1
Published
Markdown, plain-text, and PDF export plugin for Rich HTML Editor.
Maintainers
Readme
@richhtmleditor/export
Export plugin for Rich HTML Editor. Adds toolbar tools for exporting documents to DOCX, PDF, Markdown, and plain text formats. Built on @richhtmleditor/core.
Current release: 1.1.1 — Depends on @richhtmleditor/core ^1.1.1.
Repository: github.com/rajkishorsahu89/richhtmleditor
Demo: richhtmleditor.vercel.app — demo · guide · API
What's in 1.1.1
createExportPlugin— registers export toolbar tools (DOCX, PDF, Markdown, text)- DOCX export — full document export with headings, tables, images, shapes, and diagrams (SVG rasterization to PNG)
- PDF export — opens print dialog with full preview CSS including shapes and diagrams
- Markdown export — converts document HTML to clean Markdown
- Plain text export — strips all formatting for text-only output
- Configurable callbacks —
onExporthook to handle exports in your own pipeline
Community feature — no enterprise licence required.
Keywords: richhtmleditor export docx pdf markdown wysiwyg
Install
npm install @richhtmleditor/export
# Requires @richhtmleditor/core (via framework wrapper or direct install).Usage
import { createEditor } from "@richhtmleditor/core";
import { createExportPlugin } from "@richhtmleditor/export";
const editor = createEditor({
element: host,
toolbar: { preset: "full" },
plugins: [
createExportPlugin({
filename: "my-document",
pdfTitle: "My Document"
})
]
});Angular
import { createExportPlugin } from "@richhtmleditor/export";
plugins = [createExportPlugin({ filename: "report" })];<richhtmleditor [plugins]="plugins" [toolbar]="{ preset: 'full' }" />Custom export handler
createExportPlugin({
onExport: (format, content) => {
// format: "docx" | "pdf" | "markdown" | "text"
// content: string (HTML for pdf, markdown string, plain text, or HTML for docx)
uploadToServer(format, content);
}
})API
createExportPlugin(options?)
Returns an EditorPlugin that registers export toolbar tools.
| Option | Type | Description |
| --- | --- | --- |
| filename | string? | Base filename for downloaded files (default: "document"). |
| pdfTitle | string? | Title shown in the PDF print window (default: "Document"). |
| onExport | (format, content) => void | Custom export handler; bypasses default download/print behavior. |
Related packages
@richhtmleditor/core— editor engine and plugins API.@richhtmleditor/themes— shared CSS.@richhtmleditor/diagrams— Mermaid diagrams plugin.@richhtmleditor/math— LaTeX/MathML equation plugin.@richhtmleditor/angular— Angular wrapper.@richhtmleditor/react— React wrapper.
