Actions4
- Generate PDF Actions
- Generate Image Actions
Overview
This node integrates with the Pdforge API to generate PDF or image files based on predefined templates. It is useful for automating document creation workflows where you need to produce customized PDFs or images dynamically, such as generating invoices, reports, certificates, or marketing materials.
The "Generate Syncronously" operation allows users to synchronously create a PDF (or image) by specifying a template and providing variables to fill in the template placeholders. This means the node waits for the generation process to complete and returns the generated data immediately, enabling subsequent workflow steps to use the output directly.
Practical examples:
- Automatically generate a PDF invoice from an order template by passing order details as variables.
- Create personalized certificates in PDF format by supplying recipient names and dates.
- Produce marketing flyers as images by filling templates with campaign-specific content.
Properties
| Name | Meaning |
|---|---|
| Template Name or ID | The identifier of the template to use for generating the PDF. Choose from a list loaded dynamically or specify an ID manually. |
| Variables | JSON object containing key-value pairs that correspond to the variables defined in the selected template. These values populate the template fields during generation. |
Output
The node outputs an array of JSON objects, each representing the result of a single PDF or image generation request. Each object contains the response data returned by the Pdforge API after processing the template with the provided variables.
If the resource is set to generate an image, the output corresponds to the generated image data; otherwise, it corresponds to the generated PDF data.
The exact structure of the output JSON depends on the Pdforge API response but typically includes metadata about the generated file and possibly a URL or base64-encoded content for download or further processing.
Dependencies
- Requires access to the Pdforge API service.
- Needs an API authentication token configured in n8n credentials to authorize requests to Pdforge.
- The node uses the Pdforge API endpoint
https://api.pdforge.com/pdffor synchronous generation. - The "Template Name or ID" options are dynamically loaded from the Pdforge integration endpoint
/integration/templates.
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 using the dropdown or checking the Pdforge interface.
- Malformed Variables JSON: Providing invalid JSON in the "Variables" field will cause parsing errors. Ensure the JSON syntax is correct.
- API Authentication Errors: Missing or invalid API credentials will prevent successful requests. Confirm that the API key/token is correctly configured in n8n.
- Network Issues: Connectivity problems with the Pdforge API endpoint can cause timeouts or failures. Check network settings and Pdforge service status.
- Unsupported Resource/Operation Combinations: Using unsupported combinations may lead to unexpected errors. Stick to the documented "Generate PDF" resource and "Generate Syncronously" operation.
Links and References
- Pdforge API Documentation (for detailed API usage and template management)
- n8n Expressions Documentation (for using expressions in property fields)