# Text to PDF

Convert text to PDF

- **Category:** documents
- **Auth:** NO_AUTH
- **Composio Managed App Available?** N/A
- **Tools:** 6
- **Triggers:** 0
- **Slug:** `TEXT_TO_PDF`
- **Version:** 20260316_00

## Tools

### Convert Text to PDF

**Slug:** `TEXT_TO_PDF_CONVERT_TEXT_TO_PDF`

Convert plain text or Markdown content into a downloadable PDF document. Supports Unicode characters, special symbols, and Markdown formatting including headers, lists, code blocks, links, and emphasis. Images require publicly accessible URLs to render. Response PDF URL is at `data.file.s3url`; also returns `data.file.name` and `data.file.mimetype`.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `text` | string | Yes | The text content to convert to PDF. For 'txt' format, text is rendered as-is. For 'markdown' format, Markdown syntax will be parsed and styled. Must contain the complete, final content inline — document IDs, URLs, or external references are not accepted. Empty or placeholder text produces a nearly blank PDF. Malformed Markdown (unclosed lists, improperly nested headings, mixed HTML) degrades PDF structure; normalize before conversion. |
| `file_type` | string ("txt" | "markdown") | Yes | The format of the input text. Use 'txt' for plain text (preserves whitespace and formatting) or 'markdown' for Markdown-formatted text (supports headers, lists, bold, links, etc.) Only `'txt'` and `'markdown'` are accepted; any other value causes failure. Mismatching format to content (e.g., passing Markdown as `'txt'`) degrades headings, lists, and tables in output. |

#### 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 Async Job

**Slug:** `TEXT_TO_PDF_DELETE_ASYNC_JOB`

Tool to delete an asynchronous conversion job. Use when a job is no longer required to free up server resources. Jobs are automatically deleted after 3 hours if not manually removed.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `job_id` | string | Yes | The unique identifier of the asynchronous conversion job to delete. This ID is returned when creating an async conversion job. |

#### 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 File

**Slug:** `TEXT_TO_PDF_DELETE_FILE`

Tool to delete a file from ConvertAPI server. Use when a file is no longer needed and should be removed from temporary storage.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file_id` | string | Yes | The unique identifier of the file to delete from ConvertAPI server. Files are automatically deleted after 3 hours if not manually deleted. |

#### 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 |

### Download File

**Slug:** `TEXT_TO_PDF_DOWNLOAD_FILE`

Download a file from ConvertAPI server using its unique File ID. Use this after converting or uploading files to retrieve the result. The file must exist on the server and not be expired.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file_id` | string | Yes | The unique identifier of the file to download from ConvertAPI server. Obtained from a previous file upload or conversion response. |
| `download` | string ("attachment" | "inline") | No | Download behavior: 'attachment' to download the file, 'inline' to view it in browser. Defaults to 'attachment' if not specified. |

#### 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 |

### Start Async Conversion

**Slug:** `TEXT_TO_PDF_START_ASYNC_CONVERSION`

Start an asynchronous file conversion job using ConvertAPI. Returns a JobId that can be used to poll for conversion results. Optionally supports WebHook callback for push notification when conversion completes.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | string | Yes | File to be converted. Value can be a public URL pointing to the file or the file content itself. |
| `job_id` | string | No | Custom job ID for tracking the conversion. Must be exactly 32 characters long, lowercase alphanumeric only. If not provided, the API will generate one automatically. |
| `webhook` | string | No | URL to receive POST notification when conversion completes. The API will send the conversion results to this webhook URL upon completion. |
| `to_format` | string | Yes | Target file format (e.g., 'pdf'). This is the desired output format for the converted file. |
| `from_format` | string | Yes | Source file format (e.g., 'txt', 'docx', 'html'). This is the format of the input file to be converted. |

#### 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 |

### Upload File to ConvertAPI

**Slug:** `TEXT_TO_PDF_UPLOAD_FILE`

Upload a file to ConvertAPI server for subsequent conversions. Supports direct file upload or remote URL upload. Files are stored securely for up to 3 hours and can be referenced by File ID in conversion requests.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | No | Remote file URL to upload to ConvertAPI server. The file will be downloaded from this URL and stored on ConvertAPI. Either 'file' or 'url' must be provided, not both. |
| `file` | object | No | The file to upload to ConvertAPI server. Either 'file' or 'url' must be provided, not both. |
| `file_id` | string | No | Custom ID for the file. Must be a lowercase alphanumeric character string. If not provided, ConvertAPI will generate a random ID. This ID can be used to reference the file in subsequent conversion requests. |
| `filename` | string | No | Custom filename for the uploaded file. If not provided, the original filename will be used. For direct file uploads, this overrides the original filename. For URL uploads, this is required if the URL doesn't contain a clear filename. |
| `header_name` | string | No | Remote file request header field name. Only used with 'url' parameter to provide custom headers when downloading the remote file. |
| `header_value` | string | No | Remote file request header field value. Only used with 'url' and 'header_name' parameters. |

#### 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 |
