---
canonical_url: "https://docs.composio.dev/toolkits/pdfgen"
markdown_url: "https://docs.composio.dev/toolkits/pdfgen.md"
product: "platform"
version: null
last_updated: null
---

# PDFgen

PDFgen creates PDFs from reusable templates, HTML, Markdown, or natural-language prompts and manages account templates and usage logs.

- **Category:** documents
- **Auth:** API_KEY
- **Composio-managed OAuth available?** N/A
- **Tools:** 8
- **Triggers:** 0
- **Slug:** `PDFGEN`
- **Version:** 00000000_00

## Tools

### Create Template

**Slug:** `PDFGEN_CREATE_TEMPLATE`

Create a reusable HTML template for later PDF generation.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Human-readable template name. |
| `engine` | string ("handlebars" | "legacy") | No | Template rendering engine. |
| `content` | string | Yes | HTML template content, optionally containing Handlebars tokens. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Template

**Slug:** `PDFGEN_DELETE_TEMPLATE`

Permanently delete one saved template owned by the connected account.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `template_id` | string | Yes | ID of the template to permanently delete. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Generate PDF

**Slug:** `PDFGEN_GENERATE_PDF`

Generate a PDF from exactly one saved template, HTML document, Markdown document, or AI prompt and return a temporary download URL.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | object | No | Values to merge into a saved template or raw HTML. Valid only with template_id or html. |
| `html` | string | No | Raw HTML to render, optionally with Handlebars tokens. Provide exactly one PDF source field. |
| `engine` | string ("handlebars" | "legacy") | No | Template engine for raw HTML only. Omit to use PDFgen's handlebars default. |
| `format` | string ("A4" | "Letter" | "Legal" | "A3" | "A5" | "Tabloid") | No | PDF page size. |
| `prompt` | string | No | Plain-English document description for AI-generated HTML. Provide exactly one PDF source field; prompt generation costs twice the normal page rate. |
| `markdown` | string | No | Markdown to render with PDFgen typography. Provide exactly one PDF source field. |
| `password` | string | No | Password for the generated PDF; required when protect_pdf is true and otherwise omitted. |
| `file_name` | string | No | Output filename without the .pdf extension. |
| `expiry_time` | number | No | Download URL lifetime in minutes, from 1 to 10080. |
| `orientation` | string ("portrait" | "landscape") | No | PDF page orientation. |
| `protect_pdf` | boolean | No | Whether to password-protect the generated PDF. |
| `template_id` | string | No | Saved template ID to render. Provide exactly one PDF source field. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Account

**Slug:** `PDFGEN_GET_ACCOUNT`

Return the connected PDFgen account, organization, plan, and current credit usage.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Template

**Slug:** `PDFGEN_GET_TEMPLATE`

Get one saved PDFgen template, including its complete HTML content.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `template_id` | string | Yes | ID of the template to retrieve. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Templates

**Slug:** `PDFGEN_LIST_TEMPLATES`

List saved PDF templates owned by the connected account and return one page with a continuation cursor.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum templates to return in this page. |
| `next_cursor` | string | No | Continuation cursor from a previous response; omit for the first page and pass it back unchanged to fetch the next page. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Usage Logs

**Slug:** `PDFGEN_LIST_USAGE_LOGS`

List recent PDFgen API calls for auditing, billing inspection, and generation troubleshooting. Returns one page with a continuation cursor. Usage logs are eventually consistent, so a just-completed call may be absent; retry after a short delay before concluding that it was not recorded.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum usage log records to return in this page. |
| `next_cursor` | string | No | Continuation cursor from a previous response; omit for the first page and pass it back unchanged to fetch the next page. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Template

**Slug:** `PDFGEN_UPDATE_TEMPLATE`

Partially update a saved template's name, HTML content, or rendering engine without replacing omitted fields.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | New human-readable name; omit to retain the current name. |
| `engine` | string ("handlebars" | "legacy") | No | New rendering engine; omit to retain the current engine. |
| `content` | string | No | New HTML template content; omit to retain the current content. |
| `template_id` | string | Yes | ID of the saved template to update. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
