Documents

A document editor inside your web app.

Pages, headers and footers, Word files in and out, and PDF export, in an editor you host yourself.

Details

Some content is a document, not a web page: a contract, a report, a letter. Writers expect pages, page numbers, and a file they can open in Word. RichTextEditor adds a page view, document tools, and Word and PDF export to the editor your app already embeds.

What is included

Pages, files and review.

Paginated page viewA4, Letter and Legal pages with headers, footers, page numbers and 1.1.1 legal numbering.
Word and PDFImport .docx, export .docx, and download a tagged PDF with selectable text.
Document toolsFootnotes, watermarks, line numbers, a format painter, and track changes with comments.

Pages on screen

The page view lays the document out on A4, Letter or Legal pages while the writer types, with headers, footers and page numbers. Multi-level numbering covers the 1, 1.1, 1.1.1 clause style that contracts use. The page layout documentation lists the settings.

Word files in and out

Writers can open a .docx, Markdown, HTML or text file in the editor, and export the document back to .docx. Pasting from Word keeps lists, tables and images and removes Office markup.

// Open a .docx, Markdown, HTML or text file the user picked.
editor.importFile(fileInput.files[0]);

PDF export

The PDF export produces a tagged PDF with selectable text, or a print-style copy. Try it in the PDF export demo.

Limits to know before you choose it

  • Word and the browser lay text out differently. Word is paginated; browser HTML flows. Floats, CSS grid, filters, forms and arbitrary styles are not translated to Word. The Word fidelity documentation lists the tested mappings and the intentional limits.
  • Headers and footers are the default section only. First-page and even-page variants need a template of your own.
  • Check branded templates in Word. The automated tests inspect the generated file; visual sign-off in Microsoft Word or LibreOffice is still a step for you.
  • Review is included: see the track changes and comments page. Licenses are one-time, from $129; see pricing.