Skip to main content
The Markdown route needs an index.html (template/layout) and a Markdown file. Gotenberg supports MathJax for math in Markdown. Your index.html must include the Go template action where the content should appear: {{ toHTML "file.md" }} (use the actual Markdown filename). See Gotenberg’s Markdown conversion for template details. Gotenberg renders the Markdown into the HTML and then converts or captures.

Convert Markdown to PDF

Both html and markdown can be a file path string, Buffer, or ReadStream. Add conversion options (e.g. properties, header, footer) to the same object. markdown also accepts an array of distinctly-named files, all referenced from the same index.html template:
Both the convert and screenshot routes also accept an optional assets field for images, stylesheets, or other files referenced from the HTML/Markdown content:

Capture Markdown as screenshot

Use properties for image format and dimensions. See Options.