Actions19
- AI Invoice Parser
- URL/HTML to PDF
- Merge PDF
- Split PDF
- Convert To PDF
- Convert From PDF
- Add Text/Images to PDF
- Fill a PDF Form
- PDF Information & Form Fields
- Compress PDF
- PDF Security
- Rotate PDF Pages
- Delete PDF Pages
- Search in PDF
- Search & Replace Text or Delete
- Barcode Reader
- Barcode Generator
- Make PDF Searchable or Unsearchable
- Upload File
Overview
This node converts web content into PDF documents using three main methods: converting a URL to PDF, converting raw HTML code to PDF, or converting an HTML template with data to PDF. It is useful for automating the generation of PDF reports, invoices, brochures, or any printable document from dynamic web content or templates.
Practical examples include:
- Automatically generating a PDF version of a webpage by providing its URL.
- Creating a PDF from custom HTML content entered directly in the node.
- Producing personalized PDFs by merging JSON/CSV data with predefined HTML templates.
Properties
| Name | Meaning |
|---|---|
| Convert Type | The method of conversion. Options: "URL to PDF", "HTML to PDF", or "HTML Template to PDF". |
| Url | The web page URL to convert to PDF (required if Convert Type is "URL to PDF"). |
| Input HTML Code | Raw HTML code to convert to PDF (required if Convert Type is "HTML to PDF"). |
| HTML Template ID | Identifier of the HTML template to use (required if Convert Type is "HTML Template to PDF"). |
| Template Data (JSON/CSV) | Data in JSON or CSV format to populate the HTML template (required if Convert Type is "HTML Template to PDF"). |
| Advanced Options | Collection of optional settings to customize the PDF output: |
| - File Name | Desired name of the output PDF file. |
| - Orientation | Page orientation: "Portrait" or "Landscape". |
| - Paper Size | Standard paper sizes like A0-A6, Legal, Letter, Tabloid, or "Custom". |
| - Custom Paper Size | Custom dimensions for the PDF page size, e.g., 200 300, 20cm 30cm. |
| - Render Page Background | Whether to include the page background in the PDF (default true). |
| - Do Not Wait For Full Load | If true, the conversion does not wait for the full page load before starting. |
| - Margins | Margins around the PDF content, e.g., 10px, 5mm, or four values like 5px 5px 5px 5px. |
| - Media Type | CSS media type to emulate during rendering: "Print", "Screen", or "None". |
| - Header | HTML content to include as a header on each PDF page. |
| - Footer | HTML content to include as a footer on each PDF page. |
| - Webhook URL | URL to send the output data asynchronously via callback/webhook. |
| - Output Links Expiration (In Minutes) | Time in minutes after which the output link expires (default 60). |
| - Custom Profiles | JSON string to specify advanced API options and profiles for PDF generation. See external documentation for details. |
Output
The node outputs the generated PDF data in the json field of the execution result. This typically includes metadata about the PDF and a link or base64-encoded content of the PDF file depending on configuration. If binary data output is supported, it represents the actual PDF file content ready for download or further processing.
Dependencies
- Requires access to an external PDF conversion API service that handles URL, HTML, and template-based PDF generation.
- Needs an API key or authentication token configured in n8n credentials to authorize requests to the PDF conversion service.
- Optional webhook URL support requires a publicly accessible endpoint to receive asynchronous callbacks.
Troubleshooting
- Common issues:
- Invalid URLs or unreachable web pages will cause conversion failures.
- Malformed HTML or incorrect template IDs/data can lead to errors or empty PDFs.
- Network or authentication errors when connecting to the external PDF service.
- Error messages:
- "Invalid URL" or "Page not found": Check the URL correctness and accessibility.
- "Template not found" or "Invalid template data": Verify template ID and ensure data matches expected format.
- "Authentication failed": Confirm API credentials are correctly set up in n8n.
- To resolve, verify inputs, test connectivity to the PDF service, and review API usage limits or permissions.
Links and References
- PDF.co API Profiles Documentation: https://developer.pdf.co/api/profiles/index.html
- General PDF Generation Concepts: https://en.wikipedia.org/wiki/PDF_generation