Formats & options
Supported conversion paths and optional parameters for PDF and document output.
Supported conversions
| From | To |
|---|---|
| markdown | html, pdf, docx |
| html | markdown, pdf, docx |
| docx | html, markdown, pdf |
| docx | |
| url |
Any pair not listed above returns 400 INVALID_FORMAT.
PDF output options
Apply to conversions that render HTML to PDF (markdown→pdf, html→pdf, docx→pdf, url→pdf):
| Option | Default | Values |
|---|---|---|
theme | default | Theme name matching a CSS file in the API themes/ directory |
page_size | A4 | Playwright PDF format (e.g. A4, Letter) |
margins | normal | none, narrow, normal, wide |
watermark | — | Text overlay on PDF pages |
filename | auto | Base name for Content-Disposition (extension added automatically) |
title | — | Document title metadata where applicable |
URL → PDF options
| Option | Default | Description |
|---|---|---|
mode | visual | visual — full-page screenshot-style PDF; text — extract article content then render |
timeoutMs | 30000 | Page load timeout in milliseconds |
page_size | A4 | PDF page size (text mode) |
Other options
fullDocument— whenfalse, HTML converters return fragment only (no wrapper document)timeoutMs— LibreOffice subprocess timeout for heavy conversions (default ~35s)turndown— passed to HTML→Markdown converterstyleMap— DOCX→HTML style mapping
Example with options
{
"input_format": "markdown",
"output_format": "pdf",
"content": "# Quarterly report\n\nSummary here.",
"options": {
"theme": "default",
"page_size": "Letter",
"margins": "wide",
"watermark": "DRAFT",
"filename": "q1-report"
}
}