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, providing extensive capabilities around PDF documents and templates. Specifically, the Template - Validate operation allows users to validate a JSON configuration of a PDF template before using it for document generation.

Use cases include:

  • Ensuring that a complex PDF template configuration is correctly structured and valid before saving or generating documents.
  • Automating template validation in workflows where templates are dynamically created or updated.
  • Preventing errors downstream by catching invalid template configurations early.

For example, if you have a JSON object describing page layouts, components, data settings, and editor options for a PDF template, this node can verify its correctness via the API’s validation endpoint.

Properties

Name Meaning
Template Configuration JSON The full JSON object representing the template configuration to validate. Must include keys such as name, layout, pages (array), dataSettings, and editor. This JSON should be the template object itself, not wrapped inside another object. Example structure is provided in the property description.

Output

The output JSON contains the response from the API's template validation endpoint. Typically, this will indicate whether the template configuration is valid or provide details about validation errors.

Output fields may include:

  • success: Boolean indicating if validation passed.
  • Additional messages or error details returned by the API describing issues found in the template configuration.

No binary data output is expected for this operation.

Dependencies

  • Requires an API key credential for the PDF Generator API service.
  • The node makes authenticated HTTP requests to the API base URL (default: https://us1.pdfgeneratorapi.com/api/v4).
  • Proper network connectivity to the API endpoint is necessary.

Troubleshooting

  • Invalid JSON input: If the provided template configuration JSON is malformed or not a valid object, the node throws an error stating "Template configuration must be a valid JSON object."
  • Missing required fields: The API may return validation errors if mandatory fields like name, layout, pages, dataSettings, or editor are missing or incorrectly formatted.
  • API authentication errors: Ensure the API key credential is correctly configured and has permissions to access the template validation endpoint.
  • Network issues: Timeouts or connection errors may occur if the API service is unreachable; verify network access and API status.
  • Unexpected API responses: If the API returns unexpected data or errors, check the template JSON against the API documentation for compliance.

Links and References

  • PDF Generator API Documentation — Official API docs for template structure and validation rules.
  • n8n Documentation — General guidance on using credentials and HTTP request nodes.
  • Example template JSON structure is included in the node property description for reference.

Discussion