Markdown to PDF
ai_markdown_to_pdfConvert GitHub-flavoured Markdown into paginated A4, Letter, or A5 PDFs with headings, lists, tables, code blocks, page numbers, and clickable links.
Instructions
Turn Markdown (GitHub-flavoured) into a clean, paginated A4/Letter/A5 PDF: headings, paragraphs with word wrap, bold/italic/strikethrough, inline code, links (clickable), bullet / numbered / task lists (nested), tables (wrapped cells, header repeated on new pages), blockquotes, code blocks, horizontal rules, local images (relative to the Markdown file; remote images are never fetched and show as alt text), page breaks (\pagebreak, \newpage or ), page numbers, margins and title metadata. Text uses the built-in PDF fonts: Latin text only (English and Western European). Arabic, CJK and other scripts are not supported yet: such characters are replaced with "?" (or rejected with onUnsupportedChar: "error"); emoji are dropped; arrows and common symbols are transliterated. Give "markdown" inline or "path" to a .md file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| font | No | Body font: sans (Helvetica) or serif (Times). Code is always Courier. | sans |
| path | No | A .md file: local path or base64. Relative image links resolve against its folder. | |
| paper | No | A4 | |
| title | No | PDF title metadata. Default: the first # / ## heading. | |
| author | No | ||
| margin | No | Page margin in mm. Default 20. | |
| output | No | Where to write the result: a file path, or a folder ending in "/". Default: the server output folder (a temp folder unless --out-dir is set). | |
| fontSize | No | Body font size in pt. Default 10.5. | |
| markdown | No | Markdown text. Use this or "path". | |
| landscape | No | ||
| pageNumbers | No | Print "n / total" at the bottom of each page. Default true. | |
| returnBase64 | No | Also return the output as base64 in the result (only for small files). Default false. | |
| onUnsupportedChar | No | What to do with characters the PDF fonts can't show: replace with "?" (default) or fail. | replace |