Skip to main content
Glama

generate_pdf

Convert web pages or HTML content into PDF files with customizable margins, headers, footers, page ranges, and scaling options.

Instructions

Generate a PDF from a URL or HTML content. Supports custom margins, headers/footers, page ranges, and scaling. Saves the PDF to disk and returns the file path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL to render as PDF (required if no html)
htmlNoRaw HTML to render as PDF (required if no url)
formatNoPaper format: A4, Letter, Legal, Tabloid, A3, A5 (default: A4)
landscapeNoLandscape orientation (default: false)
printBackgroundNoInclude CSS backgrounds (default: true)
marginNoCSS margin — string for all sides (e.g. "1cm") or object { top, right, bottom, left }
scaleNoRendering scale 0.1-2 (default: 1)
widthNoPage width (overrides format) — CSS value like "8.5in"
pageRangesNoPage ranges to include, e.g. "1-5, 8"
headerTemplateNoHTML template for page header (uses Chromium templating)
footerTemplateNoHTML template for page footer
displayHeaderFooterNoShow header and footer (default: false)
delayNoMilliseconds to wait before rendering (default: 0)
saveToNoOutput file path (default: ./output.pdf)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Custodia-Admin/pagebolt-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server