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 multiple PDF-related functionalities such as converting HTML or URLs to PDFs, generating documents from templates, managing templates, processing existing PDFs (watermarking, encryption, form filling), and workspace management.

Specifically, the Template - Validate operation allows users to validate a JSON configuration of a PDF template before using it for document generation. This ensures that the template configuration is structurally correct and meets the API's requirements.

Common scenarios:

  • Before creating or updating a PDF template, validate its JSON configuration to catch errors early.
  • Automate template validation in workflows where templates are dynamically generated or modified.
  • Ensure compliance with required fields and structure in template configurations.

Practical example:
You have a JSON object describing a label layout with pages, components, and data settings. Before saving or using this template, you pass it through this node’s validate operation to confirm it is valid and ready for use in PDF generation.


Properties

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

Output

The output is a JSON object returned by the API indicating the result of the validation:

  • If the template configuration is valid, the response typically contains success confirmation and possibly details about the validated template.
  • If invalid, the API returns error messages describing what is wrong with the configuration.

The node outputs this response in the json field of the item. There is no binary output for this operation.

Example output snippet (conceptual):

{
  "success": true,
  "message": "Template configuration is valid."
}

or on error:

{
  "success": false,
  "errors": [
    "Missing required field 'pages'",
    "Invalid value for 'layout.format'"
  ]
}

Dependencies

  • Requires an API key credential for authenticating with the external PDF Generator API service.
  • The node uses the base URL of the API, defaulting to https://us1.pdfgeneratorapi.com/api/v4 if not configured otherwise.
  • Network access to the PDF Generator API endpoint is necessary.

Troubleshooting

  • Invalid JSON input: The template configuration must be a valid JSON object. Passing malformed JSON or a string that cannot be parsed will cause errors.
  • Missing required fields: The API expects certain fields (name, layout, pages, dataSettings, editor) in the template configuration. Omitting these will cause validation to fail.
  • API authentication errors: Ensure the API key credential is correctly set up and has permissions to perform template validations.
  • Unexpected API responses: If the API changes or is temporarily unavailable, validation may fail or return unexpected errors.
  • Error messages: The node throws errors with messages from the API or internal checks, e.g., "Template configuration must be a valid JSON object" or "The operation 'validate' is not supported for resource 'template'" if misconfigured.

To resolve issues:

  • Double-check the JSON structure against the expected template schema.
  • Verify API credentials and connectivity.
  • Use the example JSON provided as a starting point for valid configurations.

Links and References


If you need further details on other operations or resources, feel free to ask!

Discussion