How SuperDoc works

Understand how SuperDoc keeps OOXML as the document source across browser and headless workflows.

SuperDoc reads, renders, edits, and writes DOCX files through their OOXML parts. It does not convert a DOCX to HTML and reconstruct the file after editing. The browser Editor and supported headless clients use the same document engine and Document API contract.

Try the browser Editor

Select the tracked change, then accept or reject it.

Try SuperDoc in the browserLoads the sample DOCX in suggesting mode.
Loading…

The sample editor loads as this demo enters view. The rest of the article stays lightweight.

Follow the document through the engine

  1. Open. The engine parses content, styles, relationships, media, headers, footers, and the other OOXML parts into editable document state.
  2. Render. The layout engine paginates that state. The browser painter projects the resolved pages into DOM. The DOM is an output, not the document format.
  3. Edit. Editor input and headless operations update document state. The Document API defines queries, targets, mutations, and receipts.
  4. Write. Save and export write the changes back into the OOXML package instead of rebuilding a DOCX from HTML.

This is the no-conversion boundary: OOXML remains the source of document meaning from open through export.

Choose an execution surface

People, services, CI, and agents use different SuperDoc surfaces that share the Document API and DOCX engine.

CallerSurfaceWhat the surface ownsStart with
PersonBrowser EditorRendering, input, selection, navigation, and review UIEditor overview
Service or CINode.js, Python, CLISessions, files, batches, retries, and process failuresAgents & automation
AgentSDK agent toolsTool definitions, prompts, dispatch, and review handoffBuild an agent
Any codeDocument APIStructured reads, mutations, receipts, and errorsDocument API mental model

Headless code does not have a toolbar, viewport, DOM selection, or visual review surface. Choose the surface by who or what drives the document.

Use one operation contract

The Document API is an operation contract, not another runtime. The Editor and supported headless clients expose the same operation names and data shapes.

NeedOperation families
Read and discoverQueries, extraction, document info, Markdown, and HTML views
Edit and reviewInsert, replace, delete, format, comments, tracked changes, history, and diffing
Structure and mediaSections, tables, headers, footers, page setup, images, and alternative text
Word data and controlsContent controls, bookmarks, fields, footnotes, custom XML, and protection
Produce outputDOCX export and template application

Support can vary by runtime, document state, and mutation mode. Check doc.capabilities() before presenting an operation, then inspect its receipt or error. Use the generated reference for the complete operation and field inventory.

On this page