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, focusing on the Template resource with the Get operation. It retrieves detailed information about a specific PDF template by its ID. This is useful when you want to fetch the configuration, metadata, or details of an existing PDF template stored in the external service.

Common scenarios include:

  • Fetching a template's details before generating documents.
  • Verifying template existence or properties in workflows.
  • Using template data for conditional logic or reporting.

Example: You have a template ID from a previous step or user input, and you want to retrieve all its details to display or use in subsequent steps.

Properties

Name Meaning
Template Select the template to work with. You can either pick from a searchable list of templates or enter the template ID directly (must be a numeric string).

The "Template" property supports two modes:

  • From List: Search and select a template from available templates.
  • By ID: Enter the numeric template ID manually.

Output

The output JSON contains the full details of the requested template as returned by the API. This typically includes fields such as the template name, layout configuration, pages, data settings, editor options, tags, draft status, and other metadata describing the template structure and settings.

The output format is JSON only; there is no binary data output for this operation.

Example output structure (simplified):

{
  "id": "12345",
  "name": "My Template",
  "tags": [],
  "isDraft": true,
  "layout": { ... },
  "pages": [ ... ],
  "dataSettings": { ... },
  "editor": { ... },
  "fontSubsetting": false,
  "barcodeAsImage": false
}

Dependencies

  • Requires an API key credential configured in n8n for authenticating requests to the PDF Generator API.
  • The node makes HTTP requests to the API endpoint (default base URL: https://us1.pdfgeneratorapi.com/api/v4).
  • No additional environment variables are required beyond the API credential.

Troubleshooting

  • Invalid Template ID: If the template ID is not numeric or does not exist, the API will return an error. Ensure the ID is correct and exists in your account.
  • Authentication Errors: If the API key credential is missing or invalid, requests will fail. Verify that the API key is correctly set up in n8n credentials.
  • Network Issues: Connectivity problems may cause request failures. Check network access and API availability.
  • Empty or Missing Template Parameter: The "Template" property is required. Omitting it or providing an empty value will cause errors.

Common error messages:

  • "Template ID must be a number" — occurs if the entered ID is not numeric.
  • "The operation 'get' is not supported for resource 'template'" — indicates a misconfiguration or unsupported operation/resource combination.
  • API response errors indicating template not found or permission denied.

To resolve errors:

  • Double-check the template ID format and existence.
  • Confirm API credentials are valid.
  • Review node configuration for correct resource and operation selection.

Links and References


This summary covers the static analysis of the node’s execute method for the Template resource with the Get operation, based on the provided source code and property definitions.

Discussion