Convert Markdown to PDF
convert_markdownRender Markdown content to a PDF document with optional custom CSS and layout settings. Supports page orientation, margins, scale, and more.
Instructions
Render a raw Markdown string to a PDF, with optional CSS and layout options. A sensible default stylesheet is applied when no CSS is given. Costs 1 credit on success. Returns the PDF as an embedded resource.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| markdown | Yes | The Markdown content to render. | |
| css | No | Optional CSS to style the rendered Markdown (overrides the default stylesheet). | |
| landscape | No | Render in landscape orientation. (Pro/Scale/trial only.) | |
| paperWidth | No | Paper width in inches, or with a unit e.g. "210mm". | |
| paperHeight | No | Paper height in inches. | |
| marginTop | No | Top margin in inches. | |
| marginBottom | No | Bottom margin in inches. | |
| marginLeft | No | Left margin in inches. | |
| marginRight | No | Right margin in inches. | |
| scale | No | Render scale, 0.1–2.0. | |
| printBackground | No | Print background graphics/colors. | |
| preferCssPageSize | No | Use the page size declared in CSS @page rules. | |
| nativePageRanges | No | Page ranges to include, e.g. "1-3,5". | |
| pdfa | No | PDF/A conformance level, e.g. "PDF/A-2b". (Pro/Scale/trial only.) | |
| pdfua | No | Produce an accessible PDF/UA document. | |
| userPassword | No | Password required to open the resulting PDF. | |
| ownerPassword | No | Owner password controlling permissions on the resulting PDF. | |
| save_path | No | Optional absolute path to also write the PDF to on disk. |