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's Update operation. It allows users to update an existing PDF template by providing a complete JSON configuration of the template. This is useful for workflows that need to programmatically modify PDF templates used for generating documents, such as updating layout, pages, data settings, or other template properties.

Practical scenarios include:

  • Automating updates to invoice or report templates when branding or layout changes.
  • Dynamically modifying templates based on external data or user input before generating PDFs.
  • Maintaining versioned templates in an automated document generation pipeline.

Properties

Name Meaning
Template Select the template to update. You can choose from a list of existing templates or specify the template ID directly (must be a numeric string).
Template Configuration JSON The full JSON object representing the updated template configuration. This must include all required fields such as name, layout, pages array, dataSettings, and editor. The JSON should represent the entire template structure, not wrapped inside another object.

Details on "Template" property options:

  • From List: Pick a template from a searchable list of available templates.
  • By ID: Enter the numeric template ID manually.

Template Configuration JSON example snippet:

{
  "name": "My Template",
  "tags": [],
  "isDraft": true,
  "layout": {
    "format": "A4",
    "unit": "cm",
    "orientation": "portrait",
    "rotation": 0,
    "margins": {
      "top": 0,
      "left": 0,
      "right": 0,
      "bottom": 0
    },
    "emptyLabels": 0,
    "width": 21,
    "height": 29.7,
    "repeatLayout": null
  },
  "pages": [
    {
      "width": 21,
      "height": 29.7,
      "conditionalFormats": [],
      "backgroundImage": null,
      "layout": [],
      "components": [],
      "margins": {
        "right": 0,
        "bottom": 0
      },
      "border": false
    }
  ],
  "dataSettings": {
    "sortBy": [],
    "filterBy": [],
    "transform": []
  },
  "editor": {
    "heightMultiplier": 1
  },
  "fontSubsetting": false,
  "barcodeAsImage": false
}

Output

The node outputs a JSON object representing the updated template as returned by the API. The output includes at least a success indicator and the updated template details.

Typical output structure:

{
  "success": true,
  "id": "12345",
  "name": "My Template",
  "tags": [...],
  "isDraft": true,
  "layout": {...},
  "pages": [...],
  "dataSettings": {...},
  "editor": {...},
  ...
}
  • The exact fields depend on the API response but generally reflect the updated template state.
  • No binary data output is involved in this operation.

Dependencies

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

Troubleshooting

  • Invalid Template ID: If the template ID is not a number or does not exist, the API will return an error. Ensure the ID is correct and accessible.
  • Malformed JSON: The template configuration must be valid JSON and include all required fields (name, layout, pages, dataSettings, editor). Invalid or incomplete JSON will cause validation errors.
  • API Authentication Errors: Missing or invalid API credentials will prevent successful requests.
  • Permission Issues: The API user must have permission to update the specified template.
  • Network Issues: Connectivity problems to the API endpoint will cause request failures.

To resolve errors:

  • Validate the template JSON before sending.
  • Confirm the template ID exists and is accessible.
  • Check API credentials and permissions.
  • Review error messages returned by the node for specific API error details.

Links and References

Discussion