Actions4
- Generate PDF Actions
- Generate Image Actions
Overview
This node integrates with the Pdforge API to generate PDF or PNG files based on predefined templates. It supports both synchronous and asynchronous generation modes. In asynchronous mode, the node can send a webhook notification upon completion of the file rendering.
Common scenarios for this node include:
- Automating document creation such as invoices, reports, or certificates using customizable templates.
- Generating images or PDFs dynamically from data inputs in workflows.
- Using asynchronous generation to handle large or time-consuming documents, receiving a callback when ready.
For example, you might use this node to generate a PDF invoice from order data, specifying a template and variables, then either wait for the result or provide a webhook URL to be notified when the PDF is ready.
Properties
| Name | Meaning |
|---|---|
| Template Name or ID | The ID of the template to use for generating the PDF or image. Choose from a list loaded from Pdforge or specify an ID directly. |
| Webhook URL | (Only for asynchronous operation) A URL where Pdforge will POST the rendered file once generation completes. |
| Variables | JSON object containing variables to populate the template. These correspond to placeholders defined in the selected template. |
Output
The node outputs a JSON array where each element corresponds to one input item processed. Each element contains the response from the Pdforge API after requesting PDF or image generation.
- For synchronous operations, the output includes the generated file data or metadata returned by Pdforge.
- For asynchronous operations, the output typically contains information about the job submission; the actual file is delivered later via the webhook URL provided.
If binary data is involved (e.g., the generated PDF or image), it would be included in the API response, but this node's code does not explicitly handle binary data conversion or attachment.
Dependencies
- Requires access to the Pdforge API.
- Needs an API key credential configured in n8n for authenticating requests to Pdforge.
- The node uses the Pdforge API base URL
https://api.pdforge.com. - The "Template Name or ID" options are dynamically loaded from the Pdforge integration endpoint.
Troubleshooting
- Invalid Template ID: If the specified template ID does not exist or is incorrect, the API will likely return an error. Verify the template ID by loading available templates.
- Malformed Variables JSON: Variables must be valid JSON. If a string is provided, it is parsed internally; invalid JSON will cause parsing errors.
- Webhook URL Issues: For asynchronous operations, ensure the webhook URL is reachable and correctly configured to receive POST requests.
- API Authentication Errors: Ensure the API key credential is properly set up and has sufficient permissions.
- Network or API Downtime: Network issues or Pdforge service outages will cause request failures.
Links and References
- Pdforge API Documentation (hypothetical link)
- n8n Expressions Documentation - for using expressions in property values
- Pdforge interface for managing templates and viewing variable definitions