Overview
This node integrates with the Gotenberg API to convert web content into PDF documents. Specifically, the "URL to PDF" operation converts a given web page URL into a PDF file. This is useful for automating the generation of PDFs from online pages, such as saving reports, invoices, or articles in PDF format directly from their URLs.
Common scenarios include:
- Archiving web pages as PDFs for offline access.
- Generating printable versions of dynamic web content.
- Automating document workflows that require PDF versions of web resources.
For example, you can input a URL like https://example.com/report and receive a PDF snapshot of that page, optionally customized with paper size, orientation, headers/footers, and advanced rendering options.
Properties
| Name | Meaning |
|---|---|
| URL | The web page URL to convert into a PDF document. Example: https://example.com. |
| Paper Size | The size of the PDF page. Options: A3, A4, A5, Legal, Letter. Determines the dimensions of the output PDF. |
| Landscape | Boolean flag to set the PDF orientation to landscape (true) or portrait (false). |
| Advanced Options | Collection of detailed PDF generation settings including: - Emulated Media Type: print or screen. - Flatten PDF: whether to flatten layers. - Generate Tagged PDF: create accessible PDF. - Margins: custom page margins in inches. - Metadata: JSON object for PDF metadata (e.g., author, title). - Page Ranges: specify which pages to print. - PDF/A Format: archival PDF standards. - PDF/UA Accessibility: enable universal accessibility. - Print Background: include background graphics. - Scale: scale factor for rendering (0.1 to 2.0). - Single Page: print all content on one page. - Wait Delay: seconds to wait before conversion (useful for JS-heavy pages). |
| Header & Footer | Collection to add custom HTML content for page headers and footers. Supports placeholders for current page number and total pages using <span class="pageNumber"></span> and <span class="totalPages"></span>. |
Output
The node outputs a binary PDF file representing the converted web page. The output data structure includes:
json: The original input JSON data passed through unchanged.binary.data: The generated PDF file binary data, ready for further use or storage.
The binary data is labeled as a PDF (application/pdf) and named document.pdf.
Dependencies
- Requires an active connection to a Gotenberg API instance, configured via an API key credential.
- The node uses HTTP POST requests to the Gotenberg service endpoints for PDF conversion.
- No additional external dependencies are required beyond the configured Gotenberg API credentials.
Troubleshooting
- No binary data found for field: If the node expects binary input (not applicable for URL to PDF), ensure the specified binary field exists and contains valid data.
- Unknown operation error: Occurs if an unsupported operation is selected; verify the operation parameter is correctly set to "urlToPdf".
- Conversion failures: May happen if the URL is unreachable, invalid, or the Gotenberg server is down. Check network connectivity and API endpoint configuration.
- Timeouts or incomplete PDFs: Use the "Wait Delay" advanced option to allow time for JavaScript-heavy pages to fully render before conversion.
- Invalid metadata JSON: Ensure the metadata property is valid JSON; otherwise, it will be ignored silently.