Create a Word document
create_documentCreate a new document with headings, lists, tables, images, headers, footers, and page numbers; export it to DOCX, PDF, HTML, Markdown, or other formats.
Instructions
Write a new document with WordCraft (a Word-class word processor): headings, paragraphs with styles and formatting, bullet / numbered lists, tables, images with captions, page breaks, a table of contents and footnotes, plus page size, margins, headers, footers and page numbers. Starts blank or from a built-in template (letter, resume, report). Saves docx, pdf, odt, rtf, html, md, tex, txt or png pages in one go, and returns a preview of page 1.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | File name without extension. | document |
| scale | No | png only: pixels per point (default 2 ≈ 144 dpi). | |
| title | No | Document title (properties). | |
| author | No | Document author; also who tracked changes and comments are by. | |
| blocks | No | Content in order. | |
| footer | No | Footer text on every page. | |
| header | No | Header text on every page. | |
| markup | No | Print Markup: tracked changes marked up and comments beside each page (pdf / png), a comment list (html / md / txt). | |
| formats | No | Outputs: docx (Word, editable), pdf, odt (OpenDocument), rtf, html, md (Markdown), tex (LaTeX), txt, json (WordCraft document model) and png (one image per page: <name>_p1.png...). | |
| margins | No | ||
| preview | No | Return an image of page 1. | |
| subject | No | ||
| keywords | No | ||
| password | No | docx only: encrypt the saved document with this password. | |
| template | No | blank, letter, resume, report or sample (blocks are added after the template text). | blank |
| overwrite | No | Replace existing outputs. | |
| page_size | No | Letter (default), Legal, A4, A5, Executive... | |
| output_dir | No | Absolute output folder (default: next to the input; required for new documents). | |
| orientation | No | ||
| output_path | No | Absolute output file for the first format (its extension must match). | |
| export_pages | No | png only: pages to render, 1-based: "1-3,5" (default all). | |
| page_numbers | No | Page numbers in the footer (bottom) or header (top). |