← DocConvert

Formats & options

Supported conversion paths and optional parameters for PDF and document output.

Supported conversions

FromTo
markdownhtml, pdf, docx
htmlmarkdown, pdf, docx
docxhtml, markdown, pdf
pdfdocx
urlpdf

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):

OptionDefaultValues
themedefaultTheme name matching a CSS file in the API themes/ directory
page_sizeA4Playwright PDF format (e.g. A4, Letter)
marginsnormalnone, narrow, normal, wide
watermarkText overlay on PDF pages
filenameautoBase name for Content-Disposition (extension added automatically)
titleDocument title metadata where applicable

URL → PDF options

OptionDefaultDescription
modevisualvisual — full-page screenshot-style PDF; text — extract article content then render
timeoutMs30000Page load timeout in milliseconds
page_sizeA4PDF page size (text mode)

Other options

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"
  }
}