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, manage, and manipulate PDF documents and templates. Specifically, the Document - Generate (Batch) operation allows users to generate multiple PDF documents in a single batch request by merging different templates with their respective JSON data.

Common scenarios where this node is beneficial include:

  • Generating personalized invoices, reports, or certificates for multiple recipients at once.
  • Automating bulk document creation workflows where each document uses a different template or dataset.
  • Producing batches of marketing materials or contracts customized per client or case.

For example, you can provide a list of templates along with corresponding data objects, and the node will generate all PDFs in one API call, returning them either as base64 strings, downloadable files, or URLs for later access.

Properties

Name Meaning
Templates A collection of one or more templates to use for batch generation. Each entry requires:
Template: Select a template by choosing from a searchable list or entering its numeric ID.
Data: JSON object with data to merge into the template.
Format The output document format. Options:
• PDF
• HTML
Output The response format for generated documents. Options:
• Base64: Returns the document content encoded as a base64 string.
• File: Returns the document inline as a binary file.
• URL: Provides a temporary URL valid for 30 days.
Additional Fields Optional extra settings:
• Output Name: Custom name for the generated document(s).
• Testing: Boolean flag to enable testing mode, which adds a large "PREVIEW" watermark and does not count towards usage limits.

Output

The node outputs an array of results corresponding to each input item processed. For the Generate (Batch) operation, the output JSON includes:

  • success: Boolean indicating if the generation succeeded.
  • filename: The name of the generated document file (based on the output name and format).
  • format: The document format (pdf or html).
  • Other fields depend on the selected output type:
    • If Base64, the JSON contains the base64-encoded document content.
    • If File, the document is available as binary data attached under the filename key.
    • If URL, the JSON contains a URL string pointing to the stored document accessible for 30 days.
  • fileSize: Size of the generated document in bytes (for file output).

If binary file output is selected, the node attaches the generated PDF/HTML as binary data for downstream nodes to consume or save.

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).
  • No additional environment variables are needed beyond the API credential configuration.

Troubleshooting

  • Invalid Template ID: Ensure that template IDs are numeric strings when entered manually; otherwise, select from the provided list.
  • Malformed JSON Data: The data property must be valid JSON. Errors like "data must be valid JSON" indicate parsing issues—verify JSON syntax.
  • Empty Templates List: The batch must contain at least one template with associated data.
  • Output Type Mismatch: Selecting "File" output returns binary data; ensure downstream nodes can handle binary inputs.
  • API Authentication Errors: Confirm the API key credential is correctly configured and has sufficient permissions.
  • Testing Mode Confusion: When enabled, generated documents have a visible "PREVIEW" watermark and do not count against usage quotas.

Links and References


This summary covers the static logic and configuration relevant to the Document resource's Generate (Batch) operation based on the provided source code and properties.

Discussion