boxpdf-html
v1.7.0Render HTML to PDF (html_to_pdf) plus boxpdf library docs and templates, for AI agents.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
html_to_pdf
Render an HTML string (optionally with extra CSS) to a PDF using boxpdf-html. Supports a practical subset of CSS — flex, grid, tables, borders, colors, typography, and compiled Tailwind. No browser or JS execution. Returns the PDF (written to outputPath, or inline as a base64 resource) plus any warnings and unsupported-CSS diagnostics so you can fix the input.
| Parameter | Type | Description |
|---|---|---|
html * | string | HTML markup. May include <style> blocks and inline styles. |
allowRemote | boolean | Allow fetching http(s) images. Off by default to prevent SSRF. |
baseUrl | string | Directory or URL for resolving relative <img> and background-image URLs. Defaults to the working directory. |
css | string | Extra stylesheet injected before render (e.g. compiled Tailwind output). |
debug | boolean | Draw boxpdf debug overlays. |
fonts | object | Optional TTF/OTF file paths to embed instead of the built-in Helvetica family. |
margin | number | Page margin in PDF points. |
outputPath | string | Where to write the PDF (cwd-relative ok). If omitted, the PDF is returned inline as a base64 resource. |
size | string | Page size. |
boxpdf_docs
Get focused guidance on using the boxpdf / boxpdf-html libraries directly when html_to_pdf is not enough — custom layout, pagination, tables, fonts, themes, streaming, the HTML API, or Cloudflare Workers.
| Parameter | Type | Description |
|---|---|---|
topic | string | Documentation topic. Defaults to quickstart. |