page_pdf
Generate a PDF from a web page tab, saving to a file or receiving base64 data. Customize paper format, orientation, margins, headers, and scale.
Instructions
Generate PDF from page. Saves to path or returns base64.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tabId | Yes | Tab ID to generate PDF from | |
| path | No | Save path. Omit for base64 | |
| format | No | Paper format. Default: A4 | |
| landscape | No | Landscape mode. Default: false | |
| printBackground | No | Print backgrounds. Default: true | |
| scale | No | Render scale (0.1-2.0). Default: 1 | |
| marginTop | No | Top margin, e.g. "1cm" | |
| marginRight | No | Right margin, e.g. "1cm" | |
| marginBottom | No | Bottom margin, e.g. "1cm" | |
| marginLeft | No | Left margin, e.g. "1cm" | |
| pageRanges | No | Page ranges, e.g. "1-5, 8, 11-13" | |
| displayHeaderFooter | No | Show header/footer. Default: false | |
| headerTemplate | No | Header HTML template (needs displayHeaderFooter) | |
| footerTemplate | No | Footer HTML template (needs displayHeaderFooter) |