Pdforge icon

Pdforge

Generate PDF or PNG with pdforge

Overview

This node integrates with the Pdforge API to generate PDF or PNG files and convert HTML content into PDFs. It supports three main resource types: generating PDFs from templates, generating images (PNG) from templates, and converting raw HTML into PDF documents. This node is useful in scenarios where automated document generation is needed, such as creating invoices, reports, certificates, or any templated documents dynamically within an n8n workflow.

Practical examples:

  • Automatically generate a PDF invoice from a predefined template using customer data.
  • Convert an HTML email template into a PDF for archival purposes.
  • Generate a PNG image of a report chart based on dynamic data.

Properties

Name Meaning
Options Collection of optional settings:
S3 Bucket: ID of an active S3 connection to override default storage location.
S3 Key: Path inside the S3 bucket (folders and filename without extension) where the file will be saved.

Note: Other properties like templateId, variables, html, pdfParams, and webhook are used internally depending on the selected resource and operation but are not explicitly listed here since only "Default" resource and operation were requested.

Output

The node outputs an array of JSON objects corresponding to each input item processed. Each output object contains the response from the Pdforge API after generating the PDF or image or converting HTML to PDF. The exact structure depends on the API response but generally includes metadata about the generated file and possibly URLs or identifiers for accessing the generated documents.

If configured to save files to S3, the output may include references to the stored location.

Binary data is not directly output by this node; instead, it handles file generation via API and returns metadata.

Dependencies

  • Requires an active Pdforge API key credential configured in n8n.
  • Access to the Pdforge API endpoint at https://api.pdforge.com.
  • Optional: An active S3 connection configured in Pdforge if using the S3 bucket and key options to store generated files.

Troubleshooting

  • Invalid Template ID or Variables: If the template ID is incorrect or variables do not match the template fields, the API may return errors. Verify template IDs and ensure variables are correctly formatted JSON.
  • Authentication Errors: Ensure the Pdforge API key credential is valid and has necessary permissions.
  • S3 Storage Issues: If specifying S3 bucket/key, confirm that the S3 connection is active and the bucket/key path is correct.
  • Malformed HTML: When converting HTML to PDF, invalid or incomplete HTML can cause conversion failures.
  • Webhook URL Issues: For asynchronous operations, ensure the webhook URL is reachable and correctly configured.

Common error messages typically originate from the Pdforge API and should be interpreted according to their descriptions, often indicating issues with input parameters or authentication.

Links and References

Discussion