Skip to main content
The SDK accepts four input formats. Whichever you hand it, you get the same editor and the same document model; the difference is how much of the original survives the trip in.
The field is called docx for backwards compatibility with hosts that predate the text formats. It accepts any supported source.

How the format is detected

In order:
  1. An explicit format on the document input.
  2. The filename extension, when the source is a File.
  3. The MIME type, when the source is a Blob that carries one.
  4. DOCX, as the fallback.

Declaring the format explicitly

A Blob or ArrayBuffer assembled in memory has no filename, and its MIME type may be missing or wrong. Say what it is:
Without a filename or MIME type, an undeclared source is treated as DOCX and will fail to parse if it is really text. Pass format whenever you build the source yourself.

What each format brings

The high-fidelity path. Styles, fonts, tables, images, sections, page setup, running headers and footers, footnotes and endnotes, comments, and tracked changes all survive, and all of them come back out on export.
Parsed into real blocks — headings become headings, tables become tables. Since Markdown has no concept of pagination or revision marks, the document opens with default page setup and no tracked changes.
Blank-line-separated paragraphs. Useful for pasted content and transcripts.
Structural markup is mapped to document blocks. Scripts, styles, and layout CSS are ignored: this is a document importer, not a browser.

Titles

When you do not pass a title, the SDK derives one from the filename, minus the extension. Master Agreement.docx becomes “Master Agreement”.

Export

Export is DOCX:
A document imported from Markdown or HTML exports as a well-formed .docx, so the SDK doubles as a conversion step in a pipeline that ends in Word.