PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

Overview

This node converts a web page URL into a PDF document. It is useful when you want to capture the content 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 product page URL and get a PDF catalog page, or convert an internal company dashboard (with basic authentication) into a PDF report automatically.

Properties

Name Meaning
Web URL The URL of the web page to be converted into a PDF.
File Name The desired output PDF file name including the extension (e.g., "my-webpage.pdf").
Authentication Type The type of authentication required to access the target website: "No Authentication" or "Basic Authentication".
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.
Binary Data Output Name Custom name for the binary data field in the node's output where the generated PDF will be stored.
Advanced Options Collection of optional settings to customize the PDF generation:
- Bottom Margin Bottom margin of the PDF page (e.g., "20px", "1cm", "0.5in").
- Custom Profiles JSON string to specify custom API profiles for advanced PDF options.
- 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 the generated PDF as binary data under the specified binary data output name (default is "data"). This binary data represents the complete PDF file that can be saved, sent, or further processed in subsequent workflow steps.

The JSON output contains metadata about the operation and references to the binary data but primarily the PDF content is available as binary.

Dependencies

  • Requires access to the internet or intranet to fetch the target web page.
  • If the target page requires authentication, a username and password must be provided for Basic Authentication.
  • Uses an external PDF conversion service or library (implied by the bundled source code referencing a PDF4me API wrapper).
  • Requires proper API credentials configured in n8n to authenticate with the PDF conversion service.

Troubleshooting

  • Invalid URL or unreachable web page: Ensure the URL is correct and accessible from the environment where n8n runs.
  • Authentication failures: Verify username and password are correct if Basic Authentication is used.
  • PDF generation errors: Check advanced options for invalid margin or scale values; use defaults if unsure.
  • Empty or corrupted PDF output: Confirm the target page loads correctly and does not block automated requests.
  • API quota or credential issues: Make sure the API key or credentials for the PDF conversion service are valid and have sufficient quota.

Links and References

Discussion