Actions6
- Generate PDF Actions
- Generate Image Actions
- Convert HTML to PDF Actions
Overview
This node integrates with the Pdforge API to generate PDF or PNG files based on predefined templates or HTML content. It supports synchronous and asynchronous generation modes, allowing users to create documents dynamically by providing template variables or raw HTML.
Common scenarios include:
- Automatically generating invoices, reports, or certificates in PDF format using stored templates.
- Creating images (PNG) from templates for thumbnails or previews.
- Converting custom HTML content directly into PDFs without relying on templates.
For example, a user can select a specific PDF template, supply variable data such as customer name and date, and receive a generated PDF document ready for download or further processing.
Properties
| Name | Meaning |
|---|---|
| Template Name or ID | Select a PDF or image template from a list loaded dynamically from Pdforge, or specify a template ID via expression. This defines the layout and structure of the generated document. |
| Variables | JSON object containing key-value pairs that correspond to variables defined in the selected template. These values populate the template fields during generation. |
| Options | Collection of optional settings: • S3 Bucket: Specify an active S3 connection ID to override the default storage location for the generated file. • S3 Key: Define the path and filename (without extension) inside the S3 bucket where the file will be saved. |
Output
The node outputs an array of JSON objects, each representing the response from the Pdforge API for each input item processed. The exact structure depends on the API response but generally includes metadata about the generated file such as URLs or IDs.
If binary data is returned (e.g., the actual PDF or image file), it would typically be included in the output for downstream nodes to consume, but this implementation focuses on JSON responses referencing the generated files.
Dependencies
- Requires an active Pdforge API key credential configured in n8n to authenticate requests.
- Uses Pdforge's REST API endpoints at
https://api.pdforge.com. - Optional integration with Amazon S3 for storing generated files requires pre-configured S3 connections within Pdforge.
Troubleshooting
- Invalid Template ID or Name: If the specified template does not exist or is misspelled, the API will return an error. Verify template availability via the Pdforge interface or use the dynamic options loader.
- Malformed Variables JSON: Providing invalid JSON in the Variables field will cause parsing errors. Ensure the JSON syntax is correct.
- Missing Credentials: The node requires a valid Pdforge API key; missing or incorrect credentials will result in authentication failures.
- S3 Storage Errors: If specifying S3 bucket or key options, ensure the referenced S3 connection is active and has proper permissions.
- API Rate Limits or Downtime: Pdforge API unavailability or rate limiting may cause request failures; retry later or check service status.