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 and management API, enabling users to create, update, and manage PDF templates programmatically. Specifically, the Template - Create operation allows users to create new PDF templates by providing a complete template configuration in JSON format.

Use cases include:

  • Automating the creation of reusable PDF templates for invoices, reports, labels, or certificates.
  • Managing document layouts and data bindings centrally via API.
  • Integrating dynamic PDF template creation into workflows where templates need to be generated or updated on-the-fly.

Example scenario: A business automates invoice generation by creating a custom invoice template with company branding and layout settings, which can then be used repeatedly to generate invoices populated with customer data.

Properties

Name Meaning
Template Configuration JSON The full JSON object defining the template configuration. This must include keys such as name, layout, pages (an array), dataSettings, and editor. It represents the entire template structure including page size, orientation, margins, components, and data transformation rules.

The property expects a JSON object directly representing the template, not wrapped inside another object. Example structure includes fields like:

  • name: Template name.
  • tags: Array of tags.
  • isDraft: Boolean indicating draft status.
  • layout: Object describing page format, unit, orientation, rotation, margins, width, height, etc.
  • pages: Array of page objects with dimensions, components, background images, margins, borders.
  • dataSettings: Sorting, filtering, and transformation rules for data.
  • editor: Editor UI settings like height multiplier.
  • Other flags like fontSubsetting and barcodeAsImage.

Output

The output JSON contains the response from the API after creating the template. Typically, it will include:

  • Confirmation of success.
  • Details of the created template such as its ID, name, and other metadata returned by the API.

No binary data is output for this operation since it deals with template metadata rather than actual PDF files.

Dependencies

  • Requires an API key credential for authenticating with the external PDF Generator API service.
  • The node uses the base URL from the credential or defaults to https://us1.pdfgeneratorapi.com/api/v4.
  • Network access to the PDF Generator API endpoint is necessary.

Troubleshooting

  • Invalid JSON: If the provided template configuration JSON is malformed or missing required fields (name, layout, pages, dataSettings, editor), the API may reject the request. Ensure the JSON is valid and complete.
  • Authentication errors: Missing or invalid API credentials will cause authentication failures. Verify that the API key credential is correctly configured.
  • API errors: The API might return errors if the template configuration violates constraints (e.g., unsupported page sizes or invalid component definitions). Review error messages for details.
  • Empty or missing required properties: The node expects the template configuration JSON to be provided and non-empty; omitting it will cause errors.
  • Network issues: Connectivity problems to the API endpoint will result in request failures.

Links and References

Discussion