Create a PDF from Markdown, plain text or CSV
pdf_text_to_pdfCreate a new PDF from Markdown, plain text, or CSV content, with no template or input PDF required. Use it to turn structured text or tables into a printable PDF.
Instructions
Create a new PDF from Markdown, plain text or a CSV table, with no template and no input PDF. This is NOT HTML-to-PDF: it does not render HTML or CSS, and it has no custom fonts or images (images in Markdown stay literal text). Text is set in the standard Helvetica family, code and monospace text in Courier, on Letter or A4 pages. Markdown supports headings 1-6, bold, italic, inline code, links (printed as text plus the URL; http(s) and mailto links are also clickable), fenced code blocks, bullet and numbered lists, one-level blockquotes, horizontal rules, pipe tables (header shaded and repeated per page; column alignment ignored) and \pagebreak; anything else prints as typed. format text keeps spaces and line breaks exactly. format csv draws a table whose first row is the header (up to 20 columns, 10,000 rows, 100,000 cells). content is capped at 512 KiB and the output at 200 pages. WinAnsi characters only (English and Western European letters and common punctuation): emoji, Cyrillic, Greek and CJK fail with unsupported_characters, naming the character and its line and column. Very large tables or heavy inline formatting fail with content_too_complex. Deterministic: the same input gives byte-identical output, and the PDF carries no PDFops footer. To add text to an existing PDF use pdf_edit; to build an invoice from data use pdf_invoice. Returns the result written to output_path, or inline as an application/pdf resource when output_path is omitted (results over 7 MB are never returned inline: pass output_path); an existing file at output_path is overwritten. The source is never modified.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"content": "<content>"
},
"name": "pdf_text_to_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | PDF Title metadata (not printed on the page), up to 200 characters. | |
| format | No | How to read content. Default markdown. | |
| margin | No | Page margin in points, 18-144. Default 54. | |
| content | Yes | The document: Markdown (default), plain text or CSV, up to 512 KiB of UTF-8. | |
| font_size | No | Body text size in points, 6-36. Default 11. | |
| monospace | No | Set the text in Courier. Only used with format text. Default false. | |
| page_size | No | Default letter. | |
| output_path | No | Path of a .pdf file to write the result to, inside the allowed directories (PDFOPS_ROOT, default the working directory); an existing file there is overwritten. Omit when running remotely: the PDF is then returned inline as an application/pdf resource for the client to save. | |
| page_numbers | No | Print "Page n of N" at the bottom of every page. Default false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bytes | Yes | Size of the produced PDF in bytes | |
| output_path | No | Absolute path written, when output_path was supplied | |
| resource_uri | No | pdfops:// uri of the inline application/pdf resource, when output_path was omitted |