Provider Hub
Pontus
converters
Create Pdf

L2 Construct: create_pdf

converters markdown

Description

CreatePDF converts a HTML template string to a base64-encoded PDF. It takes a HTML template text and variables to inject as input and returns the PDF file encoded as a base64 string. Supports headings, paragraphs, tables, lists, and basic formatting.

L2 Data

  1. Provider: pontus
  2. Module: converters
  3. Action: create_pdf

Example Step

{
  "name": "insert-your-step-name",
  "type": "l2",
  "l2_data": {
    "provider": "pontus",
    "module": "converters",
    "action": "create_pdf",
    "metadata": {}
  }
}
 

Input

Example

{
  "template_type": "",
  "template": "\u003c!DOCTYPE html\u003e\\n\u003chtml/\u003e",
  "variables": null
}
 

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pontus.bpa/pkgs/l2/pontus/converters/create-pdf-input",
  "$ref": "#/$defs/CreatePDFInput",
  "$defs": {
    "CreatePDFInput": {
      "properties": {
        "template_type": {
          "type": "string"
        },
        "template": {
          "type": "string"
        },
        "variables": {
          "items": {
            "$ref": "#/$defs/Variable"
          },
          "type": "array"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["template_type", "template", "variables"]
    },
    "Variable": {
      "properties": {
        "name": {
          "type": "string"
        },
        "value_type": {
          "type": "string"
        },
        "value": true
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["name", "value_type", "value"]
    }
  }
}
 

Output

Example

{
  "pdf_data": "JVBERi0xLjQKJeLjz9MKNCAwIG9iago8PC9GaWx0Z...",
  "error": {
    "is_error": false
  }
}
 

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pontus.bpa/pkgs/l2/pontus/converters/create-pdf-output",
  "$ref": "#/$defs/CreatePDFOutput",
  "$defs": {
    "CreatePDFOutput": {
      "properties": {
        "pdf_data": {
          "type": "string"
        },
        "error": {
          "$ref": "#/$defs/HandlerError"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["pdf_data", "error"]
    },
    "HandlerError": {
      "properties": {
        "is_error": {
          "type": "boolean"
        },
        "errors": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["is_error"]
    }
  }
}