PaperType
v0.1.0Render Markdown, HTML or invoice/certificate/report templates to PDF files via the PaperType API.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
render_pdf Render a PDF with PaperType
Render a PDF from Markdown, HTML, or a hosted template (invoice, certificate, report) using the PaperType API, and save it to disk. Returns the absolute file path, page count and remaining quota; the PDF bytes are never returned inline. Provide exactly one source: `markdown`, `html`, or `template` + `data`. Each call uses one document of the account's monthly quota.
| Parameter | Type | Description |
|---|---|---|
author | string | Author shown on the cover page and in PDF metadata. |
cover | boolean | Add a cover page with title, author and date (markdown/html). Default false. |
css | string | Extra CSS appended after the theme (markdown/html). May include @page rules, e.g. '@page { margin: 2cm }'. |
data | object | JSON object of fields for the chosen template (required when template is set). Shape per template is shown by list_templates. |
date | string | Date text shown on the cover page, e.g. '2026-10-18' or 'October 2026'. |
filename | string | Suggested file name (e.g. 'invoice-014.pdf'). Used for the saved file's name when output_path is not given. |
footer | string | Footer text printed bottom-left on every page (e.g. a confidentiality note). |
header | string | Running header text printed top-right on every page. |
html | string | HTML document or fragment to render. A theme wraps it in page styles unless theme is 'none'. Provide exactly one of markdown, html, or template+data. |
markdown | string | Markdown source for the document (GitHub-flavoured: headings, lists, tables, fenced code, footnotes, admonitions). Provide exactly one of markdown, html, or template+data. |
output_path | string | Where to save the PDF. Omit to get a unique file named after the title under the server's output directory (PAPERTYPE_OUTPUT_DIR, default <tmp>/papertype). An existing directory (or a path ending in '… |
page_numbers | boolean | Print page numbers in the footer. Default true. |
page_size | string | Paper size. Default A4. Use 'Letter' for US documents. |
template | string | Name of a hosted template to fill with `data` instead of writing markdown/html: 'invoice', 'certificate' or 'report'. Call list_templates to see each template's fields and sample data. |
theme | string | Page style for markdown/html input. 'clean' (default, general documents), 'report' (formal, good with cover+toc), 'minimal' (plain), 'letter' (correspondence), 'none' (HTML only: no theme, just your o… |
title | string | Document title: used for the PDF metadata, the cover page, and the default output filename. |
toc | boolean | Add a table of contents built from headings. Markdown input only. Default false. |
list_templates List PaperType templates
List the hosted PDF templates available to render_pdf (invoice, certificate, report) with a description, the fields each accepts (name, type, required) and a complete sample `data` object you can adapt. No network call; uses no quota.
account PaperType account status
Show the PaperType account behind the configured API key: email, plan, monthly document quota, documents used this month, and whether output carries the free-plan mark. Uses no quota.