PDF Generator API icon

PDF Generator API

Generate PDFs, manage templates, convert HTML/URLs to PDF, and perform PDF operations like watermarking, encryption, and optimization

Overview

This node integrates with a PDF generation API to create PDF or HTML documents from templates in batch mode, either synchronously or asynchronously. It is designed for scenarios where multiple documents need to be generated at once, such as bulk invoice creation, mass report generation, or batch processing of personalized letters.

  • Generate (Batch): Generates multiple documents in one request and returns the results immediately.
  • Generate (Batch + Async): Initiates asynchronous generation of multiple documents, allowing the process to run in the background. Optionally supports callback URLs to notify when generation completes.

Practical examples:

  • A company generating monthly statements for hundreds of customers using predefined templates and customer-specific data.
  • An HR department creating employment contracts for multiple new hires simultaneously.
  • Marketing teams producing personalized brochures or offers in bulk.

Properties

Name Meaning
Templates A collection of templates to generate documents from. Each template includes:
- Template: Select by list or enter template ID.
- Data: JSON object with data to merge into the template.
Callback Options (Only for async batch) Options for callback after generation:
- Callback URL: URL to receive notification when generation finishes.
- Custom Headers: JSON object with headers to include in callback request.
Format Document output format:
- PDF
- HTML
Output Response format for async batch:
- Base64: Document content encoded in base64.
- URL: Link to stored document valid for 30 days.
Additional Fields Optional extra settings:
- Output Name: Custom name for generated documents.
- Testing: Boolean flag to enable testing mode (adds a large PREVIEW stamp and does not count towards usage).

Output

The node outputs an array of JSON objects, each representing the result of a document generation request within the batch. The structure includes:

  • success: Boolean indicating if generation succeeded.
  • filename: Name of the generated document file (based on output name and format).
  • format: Output format (pdf or html).
  • Depending on the selected output option:
    • For base64: Contains base64-encoded document content.
    • For url: Contains a URL string pointing to the stored document (valid for 30 days).
    • For file (only synchronous batch): Binary data of the generated document is included in the binary property keyed by filename.

If the output is binary (file), the binary data represents the actual PDF or HTML file ready for download or further processing.

Dependencies

  • Requires an API key credential for the PDF Generator API service.
  • The node makes authenticated HTTP requests to the PDF Generator API endpoint (default base URL: https://us1.pdfgeneratorapi.com/api/v4).
  • For asynchronous operations with callbacks, a publicly accessible callback URL must be provided to receive notifications.

Troubleshooting

  • Invalid Template ID: Ensure template IDs are numeric strings or selected from the list. Non-numeric IDs will cause validation errors.
  • Malformed JSON Data: The data field for each template must be valid JSON. Invalid JSON will throw an error indicating the problem.
  • Missing Required Fields: Omitting required fields like templates or data will cause the node to fail.
  • Callback URL Issues: If using async batch with callbacks, ensure the callback URL is reachable and correctly configured to accept POST requests with optional custom headers.
  • API Authentication Errors: Verify that the API key credential is correctly set up and has sufficient permissions.
  • Output Format Mismatch: Selecting file output format in async operations is not supported; use base64 or url instead.
  • Testing Mode Confusion: When testing mode is enabled, generated documents include a large "PREVIEW" watermark and do not count against usage limits.

Links and References


This summary covers the batch asynchronous and synchronous document generation operations for the Document resource, focusing on input properties, output structure, dependencies, and common troubleshooting points.

Discussion