DOCX Export
The editor exports its HTML to a genuine Microsoft Word .docx package through a server endpoint you control. This live Next.js demo uses the MIT-licensed docx library for headings, paragraphs, block quotes, nested lists, tables, inline CSS, page setup and breaks, headers and footers, merged tables, notes, review markup, safe external links, and embedded images. No external conversion service, cloud API, or DOCX SaaS subscription is involved.
This is a server-driven feature.The button below calls this site’s working Next.js endpoint. Remote image URLs are deliberately not fetched; use PNG, JPEG, GIF, or BMP data URIs, or pass a server-resolved imageMap. See the fidelity and security matrix for supported HTML conventions and intentional limits.
Quarterly update
Summary. Revenue grew 15% year-over-year. Read the integration notes.
- Two new enterprise customers in March.
- Streaming AI shipped in preview 10.
| Region | Growth |
|---|---|
| North America | 18% |
| Europe | 12% |
Our buyers want one perpetual license, not three subscription SKUs.
Example code
<div id="docx_editor">
<h3>Quarterly update</h3>
<p><strong>Summary.</strong> Revenue grew <em>15%</em> year-over-year. Read the <a href="https://richtexteditor.com/docs">integration notes</a>.</p>
<ol><li>Two new enterprise customers in March.</li><li>Streaming AI shipped in preview 10.</li></ol>
<table><thead><tr><th>Region</th><th>Growth</th></tr></thead><tbody><tr><td>North America</td><td>18%</td></tr><tr><td>Europe</td><td>12%</td></tr></tbody></table>
<blockquote>Our buyers want one perpetual license, not three subscription SKUs.</blockquote>
</div>
<button type="button" onclick="exportToDocx()">Export to .docx</button>
<span id="docxStatus"></span>
<script>
var docxEditor = new RichTextEditor("#docx_editor", { toolbar: "default" });
function exportToDocx() {
var status = document.getElementById("docxStatus");
status.textContent = "Calling server endpoint...";
if (!docxEditor.aiToolkit || typeof docxEditor.aiToolkit.exportDocx !== "function") {
status.textContent = "exportDocx helper not available (make sure aitoolkit.js is loaded).";
return;
}
docxEditor.aiToolkit.exportDocx({
url: "/api/export/docx",
fileName: "quarterly-update.docx",
title: "Quarterly update",
onError: function (err) { status.textContent = "Failed: " + err.message; }
}).then(function (name) {
status.textContent = "Downloaded " + name;
}).catch(function () { /* handled in onError */ });
}
</script>