Content is loading…
Convert HTML content to a styled PDF (headings, tables, code, lists).
html_to_pdf#html to pdf#pdf generator#document export#content to pdfConverts HTML content into a structured PDF document by normalizing HTML to Markdown before rendering. Accepts an html string along with optional styling parameters like pageSize, orientation, and headingColor. Returns a temporary URL to the generated PDF file that remains valid for 24 hours.
| Name | Type | Required | Description |
|---|---|---|---|
html | string | required | The HTML to convert. Full document or fragment both work. |
pageSize | enum ("A4" | "LETTER" | "A3" | "LEGAL") | optional | Page size. Default A4. |
orientation | enum ("portrait" | "landscape") | optional | Page orientation. Default portrait. |
fontSize | number | optional | Body font size in points (8-24). Default 11. |
direction | enum ("auto" | "ltr" | "rtl") | optional | Text direction: auto, ltr, or rtl. Default auto. |
headingColor | string | optional | Hex color for headings. Default "#1e3a5f". |
textColor | string | optional | Hex color for body text. Default "#111111". |
docTitle | string | optional | PDF title metadata. |
docAuthor | string | optional | PDF author metadata. |
{
"html": "<h1>Title</h1><p>Body</p>",
"pageSize": "Letter"
}curl -X POST https://toolsy.my/api/mcp \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "html_to_pdf",
"arguments": {
"html": "<h1>Title</h1><p>Body</p>",
"pageSize": "Letter"
}
}
}'Generate a free API key or set up an OAuth connector for Claude.ai.