docx-editor

Features

What the editor edits, what it preserves untouched, and its current limitations.

@portone/docx-editor edits common DOCX body content and preserves what lies outside its editing surface. API details live in Editor API and Core API.

Support summary

AreaWhat you can do
Text formattingEdit bold, italic, strikethrough, underline, palette or custom HEX colors, highlight, fonts, and font size. Document defaults and paragraph or character styles are reflected in the text and the controls. A highlighted blank with no text is drawn and filled by typing.
ParagraphsApply paragraph styles, alignment, indentation, line spacing, line breaks, and page breaks. Keep with next is reflected within the page layout's limits.
TabsInsert, paste, format, navigate, select, and align document tabs. Tab leaders and bar tabs are kept in the file but not drawn.
ListsCreate and edit bullet and numbered lists, including nested levels, with the number format, restarts, and number formatting the document's own list definition asks for. A list counting in an unsupported format is shown with decimal numbers.
TablesInsert and remove rows, columns, and tables; merge, split, resize, format, align, and pad cells; table styles and repeating header rows are drawn. A table the editor cannot model is shown as a placeholder.
ImagesInsert, paste, drop, select, and resize inline images.
HyperlinksCreate, change, remove, and open external links.
CommentsView anchored threads and create, edit, reply to, resolve, reopen, and delete comments, each recorded with its author. Deleting commented text never deletes the comment.
Footnotes and endnotesEdit footnotes and endnotes in place, insert one at the caret, and delete one by deleting its reference. Footnotes are drawn at the foot of their page and endnotes after the last paragraph, numbered in the document's format.
Headers and footersPreview each section's first, even, and default headers and footers, page numbers included. Editing a header or footer is not offered yet.
Content controlsEdit the content of controls around text, table cells, table rows, and whole paragraphs or tables, including nested ones, and lock text. A control the editor cannot take apart is shown as a box.
ClipboardCopy and paste within the document, in from another application, and out to other applications, with formatting. Comment markers and bookmarks are dropped where the copy is pasted; a note reference is pasted with a copy of its note.
ModesOpen a document read-only, for commenting only, or for editing, and switch modes on an open document. A lock the document carries holds in every mode.
EditorBuilt-in controls, selectable zoom, undo and redo, keyboard navigation, and IME composition.

Documents the editor opens

The editor reads and writes ECMA-376 Transitional, the format Word saves; Strict packages are refused. A refused file reports why, under one of the import codes.

Preservation

Untouched parts and blocks go back out unchanged, except a file that spelled the namespaces under other prefixes, which goes back out respelled; content the editor has no model for stands as a placeholder. The area guides describe known preservation limits. Import and export report detected failures with stable error codes. Preserved content covers what is kept, and what a document loses how to list it.

Guides

On this page