Actions6
- Generate PDF Actions
- Generate Image Actions
- Convert HTML to PDF Actions
Overview
This node integrates with the Pdforge API to convert HTML content into PDF files synchronously. It is designed for scenarios where users need to generate PDF documents directly from raw HTML strings, such as creating reports, invoices, or formatted documents on-the-fly within an automation workflow.
Practical examples include:
- Converting dynamically generated HTML email templates into downloadable PDF attachments.
- Generating printable versions of web pages or forms submitted through a web app.
- Automating document creation workflows where HTML content is the source format.
Properties
| Name | Meaning |
|---|---|
| HTML String | The full HTML string to convert into a PDF file. This should include the entire <html> tag and all its contents. |
| Print Parameters | JSON object specifying parameters for PDF printing, such as page size, width, height, margins, etc. These parameters follow the options documented at Pdforge PDF Params. |
| Options | Collection of additional options: - S3 Bucket: ID of an active S3 connection configured in Pdforge to override the default storage location. - S3 Key: Path (folders and filename without extension) inside the S3 bucket where the PDF will be saved. |
Output
The node outputs an array of JSON objects representing the response from the Pdforge API after converting the HTML to PDF. Each output item corresponds to one input item processed.
The json output typically contains metadata about the generated PDF file, such as URLs or identifiers referencing the stored PDF, depending on the Pdforge API response.
If configured to save to an S3 bucket, the output will reflect the storage location details accordingly.
No binary data output is produced directly by this node; instead, it provides references or links to the generated PDF files.
Dependencies
- Requires an active Pdforge API key credential for authentication.
- Relies on the Pdforge cloud service endpoint at
https://api.pdforge.com. - Optional integration with Amazon S3 for storing generated PDFs, which requires pre-configured S3 connections within Pdforge.
Troubleshooting
- Invalid HTML Input: If the provided HTML string is malformed or incomplete, the conversion may fail or produce unexpected results. Ensure the HTML includes the full
<html>structure. - Incorrect Print Parameters: Using unsupported or incorrectly formatted print parameters can cause errors. Validate parameters against the official Pdforge documentation.
- API Authentication Errors: Missing or invalid API credentials will prevent successful requests. Verify that the API key is correctly configured in n8n.
- S3 Storage Issues: If specifying S3 bucket or key options, ensure the referenced S3 connection exists and has proper permissions. Incorrect bucket IDs or keys may lead to storage failures.
- Network or Service Downtime: As the node depends on Pdforge's external API, network issues or service outages can cause request failures.
Common error messages usually originate from the Pdforge API and indicate issues like unauthorized access, invalid parameters, or resource not found. Reviewing the API response message helps identify the root cause.