Convert a website or HTML to PDF
render_pdfConvert a URL or HTML to PDF with page size, orientation, margins, headers and footers. Returns the PDF URL. One render can also save the page's markdown, HTML and metadata: set save_markdown, save_html or save_metadata instead of making a second call. The markdown and metadata come back with the result. Any other Urlbox option (proxies, cookies, headers, user agent and many more) goes in options: look it up with describe_options.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"intent": "<intent>"
},
"name": "render_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | The URL or domain of the website you want to screenshot. We will automatically prepend http:// if it is missing. | |
| html | No | HTML to render instead of a URL (HTML to PDF, HTML to image). | |
| delay | No | The amount of time to wait before Urlbox captures a render in milliseconds. | |
| media | No | By default, when generating a PDF, the print CSS media query is used. To generate a PDF using the screen CSS, set this option to screen. When generating an image, the screen CSS media query is used by default. To generate an image using the print CSS, set this option to print. | |
| width | No | The viewport width of the browser, in pixels. | |
| intent | Yes | Required. In one or two sentences, what you are trying to achieve for the user with this call and why (for example: 'Screenshot the pricing page so the user can compare plans'). Recorded for analytics and audit; do not include secrets. | |
| options | No | Any other Urlbox render option by name, e.g. { "gpu": true }. For an option this tool doesn't list, look it up with describe_options first (it covers every option); don't search the web. Validated by the Urlbox API. | |
| project | No | Project id (proj_…) or exact name to render with. Defaults to your default project. | |
| readable | No | Make the pdf into a readable document by removing unnecessary elements such as navigation bars, ads, etc. | |
| wait_for | No | Waits for the element specified by this selector to be present in the DOM before taking a screenshot or PDF. By default, Urlbox will take a screenshot or PDF if the wait_for element is not found after waiting for the time specified by the wait_timeout option. If you prefer Urlbox to fail the request when the wait_for element is not found, pass fail_if_selector_missing=true | |
| block_ads | No | Blocks requests from popular advertising networks from loading. | |
| pdf_scale | No | Sets the scale factor of the website content in the PDF. Valid values are numbers between 0.1 and 2. Range: 0.1 - 2. | |
| save_html | No | Also save the page's rendered HTML. | |
| pdf_footer | No | Change the default pdf footer that is shown on each page of the pdf when pdf_show_footer option is set. You have the option to show the following variables in the footer (or header) of the pdf: current date; title of the page; url of the page; current pageNumber; the totalPages in the pdf document; You can display these variables by creating empty divs or spans, with special css class names relating to the variable you want to show. For example, if you want to show the date followed by the url, you could use the following pdf footer template: <div class="date"></div><div class="url"></div>. The pdf footer template you set are inserted as the innerHTML of a parent div which is a flex container, and has align-items set to flex-end. There are also some helper classes for aligning the divs or spans. The following classes are available: left - adds some left padding to the element and sets flex: none.; center - aligns the element and text to the center.; right - adds some right padding to the element and sets flex: none.; text - sets the text to 8pt.; grow - sets flex: auto on the element, allowing it to grow to fill the available space.; The default pdf footer is: <div class='url text left grow'></div><div class='text right'><span class='pageNumber'></span>/<span class='totalPages'></span></div>. You can see exactly how the pdf page is constructed by looking at the chromium pdf template in the chromium source repository. | |
| pdf_header | No | Change the default pdf header that is shown on each page of the pdf when pdf_show_header option is set. You have the option to show the following variables in the header (or footer) of the pdf: current date; title of the page; url of the page; current pageNumber; the totalPages in the pdf document; You can display these variables by creating empty divs or spans, with special css class names relating to the variable you want to show. For example, if you want to show the date followed by the url, you could use the following pdf header template: <div class="date"></div><div class="url"></div>. The pdf header template you set are inserted as the innerHTML of a parent div which is a flex container, and has align-items set to flex-start. There are also some helper classes for aligning the divs or spans. The following classes are available: left - adds some left padding to the element and sets flex: none.; center - aligns the element and text to the center.; right - adds some right padding to the element and sets flex: none.; text - sets the text to 8pt.; grow - sets flex: auto on the element, allowing it to grow to fill the available space.; The default pdf header is: <div class='date text left'></div><div class='title text center'></div>. You can see exactly how the pdf page is constructed by looking at the chromium pdf template in the chromium source repository. | |
| pdf_margin | No | Sets the margin of the PDF document. One of: none, default, minimum. | |
| wait_until | No | Waits until the specified DOM event has fired before capturing a render. The available options are: domloaded (the DOMContentLoaded event is fired); mostrequestsfinished (consider navigation to be finished when there are no more than 2 network connections for at least 500 ms); requestsfinished (there are no more than 0 network connections for at least 500 ms); loaded (the load event is fired); One of: domloaded, mostrequestsfinished, requestsfinished, loaded. | |
| click_accept | No | Similar to the hide_cookie_banners option, but instead of hiding the banners, this option attempts to click on the 'Accept' button, in order to accept cookies. | |
| wait_seconds | No | How long to wait for the render before returning. 0 queues it and returns a render id at once. If the wait runs out the render keeps going; fetch it with get_render. | |
| hide_selector | No | Hide specific HTML elements on the page before rendering. This option accepts a comma-delimited string of CSS element selectors that will be hidden by setting their style to visibility: hidden !important; pointer-events: none !important;. This preserves the page layout while making elements invisible. This is particularly useful for: Hiding pop-ups, banners, or cookie notices; Removing advertisements or promotional overlays; Excluding navigation menus or sidebars; Hiding specific content sections; Selector types supported: Element selectors (e.g., h1, div, img) - Hide all elements of that type; Class selectors (e.g., .popup, .banner) - Hide elements with specific CSS classes; ID selectors (e.g., #header, #sidebar) - Hide elements with specific IDs; Complex selectors (e.g., .nav ul li, div.content > p) - Use any valid CSS selector; Multiple selectors - Combine multiple selectors with commas; Tip: To find the selector for any element, open your browser's DevTools, right-click the element in the Elements tab, and select "Copy > Copy selector". | |
| pdf_page_size | No | Sets the PDF page size. Setting this option will take precedence over pdf_page_width and pdf_page_height. One of: A0, A1, A2, A3, A4, A5, A6, Legal, Letter, Ledger, Tabloid. | |
| save_markdown | No | Also extract and save the page as Markdown alongside the render. | |
| save_metadata | No | Also extract and save page metadata (title, description, OpenGraph, etc.). | |
| pdf_background | No | Sets whether to print background images in the PDF | |
| pdf_orientation | No | Sets the orientation of the PDF. One of: portrait, landscape. | |
| pdf_show_footer | No | Whether to show the default pdf footer on each page of the pdf. The template of the footer can be changed by setting the pdf_footer option. | |
| pdf_show_header | No | Whether to show the default pdf header on each page of the pdf. The template of the header can be changed by setting the pdf_header option. | |
| hide_cookie_banners | No | Automatically hides cookie banners from most websites, by setting their style to display: none !important; |