Overview
This node converts a web page URL into a PDF document. It is useful when you want to capture the visual representation of any publicly accessible or authenticated webpage as a PDF file for archiving, sharing, or further processing. Common scenarios include generating reports from dashboards, saving receipts or invoices displayed on web pages, or creating offline snapshots of online content.
For example, you can input a URL like https://example.com and get a PDF version of that page with customized page layout, format, margins, and optional authentication if the page requires login.
Properties
| Name | Meaning |
|---|---|
| Web URL | The URL of the web page to convert to PDF. |
| File Name | The desired output PDF file name including extension (e.g., my-webpage.pdf). |
| Authentication Type | Method of authentication for accessing the target website: either no authentication or basic auth. |
| Username | Username for basic authentication if required by the target website. |
| Password | Password for basic authentication if required by the target website. |
| Page Layout | Orientation of the PDF page: Portrait or Landscape. |
| Page Format | Paper size format for the PDF, e.g., A4, A3, Legal, Tabloid, etc. |
| Advanced Options | Collection of additional settings: |
| - Bottom Margin | Bottom margin of the PDF page (e.g., 20px, 1cm, 0.5in). |
| - Custom Profiles | JSON string to specify custom API options for advanced PDF generation features. |
| - Display Header Footer | Boolean to show or hide header and footer in the PDF. |
| - Left Margin | Left margin of the PDF page. |
| - Print Background | Boolean to include background colors and images in the PDF. |
| - Right Margin | Right margin of the PDF page. |
| - Scale | Scale factor for rendering the web page (from 0.1 to 2). |
| - Top Margin | Top margin of the PDF page. |
Output
The node outputs a binary PDF file representing the converted web page. The output contains:
json: Metadata about the conversion (usually minimal or empty).binary: The actual PDF file data under a binary property named according to the configured file name (e.g.,converted_page.pdf).
This binary data can be used downstream in workflows to save the file, send it via email, or upload it to cloud storage.
Dependencies
- Requires access to an external PDF conversion service or API capable of rendering web pages to PDF.
- Needs an API key or authentication token configured in n8n credentials to authorize requests to the PDF conversion service.
- If the target web page requires authentication, supports Basic Authentication with username and password.
Troubleshooting
- Authentication errors: If the target URL requires authentication but incorrect or missing credentials are provided, the conversion will fail. Ensure correct username and password are set when using Basic Authentication.
- Invalid URL: Providing an invalid or unreachable URL will cause the node to error out. Verify the URL is correct and accessible from the environment where n8n runs.
- API quota limits: If the external PDF service has usage limits, exceeding them may result in errors. Monitor your API usage and upgrade plans if necessary.
- Incorrect advanced options JSON: Malformed JSON in the "Custom Profiles" field can cause the API call to fail. Validate JSON syntax before use.
- Large pages or complex layouts: Very large or dynamic web pages might take longer to convert or cause timeouts. Adjust scale and margins or split content if possible.