Generate PDF
generate_pdfCreate PDFs from raw HTML, public URLs, or templates with JSON data. Specify an output path to save the file or receive base64 bytes.
Instructions
Generate a PDF from raw HTML, a public URL, or a template + JSON data. Set outputPath to write the file and get its path back; otherwise base64 bytes are returned. The canonical way for an AI agent to turn content into a shareable, correctly-formatted PDF.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | What to render. Provide exactly one of: html, url, or (template|templateId) with data. | |
| options | No | Optional page and print settings. | |
| outputPath | No | Absolute path to write the PDF to. If omitted, base64 is returned. |