The File class (exported as Document) is the main entry point for creating DOCX documents.
It manages all document components including content, styles, numbering, headers/footers,
and media. Documents are organized into sections, each of which can have its own page
settings, headers, and footers.
This class handles the assembly of all OOXML parts required for a valid .docx file,
including relationships, content types, and document properties.
Public Api
Example
// Simple document with one section constdoc = newDocument({ sections: [{ children: [ newParagraph("Hello World"), ], }], });
Represents a Word document file.
The File class (exported as
Document) is the main entry point for creating DOCX documents. It manages all document components including content, styles, numbering, headers/footers, and media. Documents are organized into sections, each of which can have its own page settings, headers, and footers.This class handles the assembly of all OOXML parts required for a valid .docx file, including relationships, content types, and document properties.
Public Api
Example