# Craftmypdf

CraftMyPDF is a web-based platform that enables users to design and generate customizable PDF documents using pre-designed templates and dynamic data.

- **Category:** documents
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 12
- **Triggers:** 0
- **Slug:** `CRAFTMYPDF`
- **Version:** 20260312_00

## Tools

### Add Text to PDF

**Slug:** `CRAFTMYPDF_ADD_TEXT_TO_PDF`

Tool to add text annotations to a PDF including page numbers, watermarks, and custom text at specified positions. Supports dynamic variables like {{pageNumber}} and {{totalPages}} for automatic page numbering. Use when you need to add watermarks, headers, footers, or any text overlay to existing PDF documents.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | Yes | The URL of the PDF file to annotate. Must be a publicly accessible URL. |
| `expiration` | integer | No | Expiration time in minutes for the generated PDF link. Range: 1-10080 minutes (7 days). Defaults to 5 minutes if not specified. |
| `output_file` | string | No | Desired filename for the output PDF. Defaults to 'output.pdf' if not specified. |
| `textSettings` | array | Yes | Array of text annotation settings. Each item defines text to add with its position, styling, and target pages. Multiple settings can be applied to add different text elements to various pages. |
| `cloud_storage` | integer | No | Whether to upload the generated PDF to CraftMyPDF's CDN. Set to 1 (upload to CDN) or 0 (skip upload). If you have configured Post Actions to upload to your own S3, set to 0. Defaults to 1. |

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

### Add Watermark to PDF

**Slug:** `CRAFTMYPDF_ADD_WATERMARK`

Tool to add a text watermark to a PDF with customizable font, size, color, opacity, and rotation. Use when you need to overlay watermark text (e.g., CONFIDENTIAL, DRAFT) on PDF documents. For more advanced text placement and formatting options, consider using the add-text-to-pdf endpoint instead.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | Yes | URL of the source PDF document to add watermark to. Must be a publicly accessible URL. |
| `text` | string | Yes | The watermark text to overlay on the PDF. This text will appear on all pages. |
| `opacity` | number | No | Opacity/transparency of the watermark, ranging from 0 (fully transparent) to 1 (fully opaque). Default is 0.5. |
| `rotation` | integer | No | Rotation angle of the watermark text in degrees. Positive values rotate clockwise. Default is 45 degrees. |
| `font_size` | integer | No | Font size of the watermark text in points. Default is 40 if not specified. |
| `hex_color` | string | No | Hex color code for the watermark text (must start with # followed by 6 hex digits). Default is '#c7c7c7' (light gray). |
| `expiration` | integer | No | Expiration time in minutes for the generated PDF link. Must be between 1 minute and 10080 minutes (7 days). Default is 5 minutes. |
| `font_family` | string ("Courier" | "Courier-Bold" | "Courier-Oblique" | "Courier-BoldOblique" | "Helvetica" | "Helvetica-Bold" | "Helvetica-Oblique" | "Helvetica-BoldOblique" | "Times-Roman" | "Times-Bold" | "Times-Italic" | "Times-BoldItalic" | "Symbol" | "ZapfDingbats") | No | Available font families for watermark text. |
| `output_file` | string | No | Name for the output PDF file. Default is 'output.pdf' if not specified. |
| `cloud_storage` | integer | No | Whether to upload the generated PDF to CDN storage. Set to 1 (default) to upload to CDN, or 0 if you have configured Post Actions to upload to your own S3 bucket. |
| `postaction_s3_bucket` | string | No | AWS S3 bucket name to override for Post Action (S3 Storage). Only used if you have Post Actions configured. |
| `postaction_s3_filekey` | string | No | File name/key for Post Action (S3 Storage). Do not include file extension. Use slash (/) as folder delimiter. Must be unique. |

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

### Create Editor Session

**Slug:** `CRAFTMYPDF_CREATE_EDITOR_SESSION`

Tool to create an embeddable editor session URL for a template. Use when you need to embed the PDF editor for a specific template.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `backURL` | string | No | URL to navigate to when the user clicks the back button. |
| `canSave` | boolean | No | Allow saving changes in the editor. |
| `jsonMode` | integer | No | Mode for JSON: 1 = editor, 2 = viewer. |
| `canPreview` | boolean | No | Allow previewing document within the editor. |
| `expiration` | integer | No | Session lifetime in minutes (e.g., 1440 for 24 hours). |
| `canEditJSON` | boolean | No | Allow direct JSON editing of the template. |
| `canShowData` | boolean | No | Show or hide data tab in the editor. |
| `canShowHelp` | boolean | No | Show or hide help/documentation panel. |
| `template_id` | string | Yes | The PDF template ID to open in the editor. Get template IDs from the List Templates action. |
| `canCreatePDF` | boolean | No | Allow generating PDF from the editor. |
| `canShowHeader` | boolean | No | Show CraftMyPDF header in the editor UI. |
| `canShowLayers` | boolean | No | Show layers panel in the editor. |
| `canViewSettings` | boolean | No | Allow viewing editor settings. |
| `canShowExpressionDoc` | boolean | No | Show or hide expression documentation pane. |
| `canShowPropertyPanel` | boolean | No | Show property panel for elements in the editor. |
| `canShowPropertyBinding` | boolean | No | Show or hide property binding options. |

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

### Create PDF Asynchronously (Extended)

**Slug:** `CRAFTMYPDF_CREATE_PDF_ASYNC2`

Tool to create a PDF file asynchronously with JSON data and template. Returns immediately with a transaction reference and makes an HTTP/HTTPS GET callback to webhook_url when the PDF is generated. Use when you need non-blocking PDF creation with advanced options like image optimization, resizing, and custom storage configuration.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | JSON data to populate template fields. Accepts either a JSON object or a stringified JSON string. Keys should match the template's data bindings. |
| `version` | string | No | Template version to use. If not specified, uses the latest version of the template. |
| `expiration` | integer | No | Expiration time of the generated PDF in minutes. Default is 5 minutes, range is between 1 minute and 10080 minutes (7 days). |
| `template_id` | string | Yes | Template ID to use for PDF generation. Obtain valid template IDs from the list-templates endpoint. |
| `webhook_url` | string | No | Callback URL to your server for receiving the PDF result. Must start with http:// or https:// and should be URL-encoded. When PDF is generated, a GET request is made to: webhook_url?file=[file_url]&transaction_ref=[transaction_ref]&status=[status]&message=[message]&details=[details] |
| `cloud_storage` | integer | No | Upload the generated PDFs/images to storage CDN. Default is 1. Set to 0 if you have configured Post Actions to upload to your own S3. |
| `resize_format` | string | No | If resize_images is enabled, specify the format of resized images. Either 'jpeg' or 'png'. |
| `resize_images` | boolean | No | Resize all images in the PDF to help reduce file size, especially if the template contains multiple or large images. Set to true to enable. Only works with JPEG/JPG/PNG images. |
| `resize_max_width` | integer | No | If resize_images is enabled, specify the maximum width in pixels for images. Default is 1000. |
| `resize_max_height` | integer | No | If resize_images is enabled, specify the maximum height in pixels for images. Default is 1000. |
| `image_resample_res` | integer | No | Optimize/downsample images in the PDF to a specified resolution in DPI. Helps reduce PDF file size. Suggested values are 1200, 600, 300, 150, or 72. |
| `postaction_s3_bucket` | string | No | Override the AWS Bucket for Post Action (S3 Storage) if configured. |
| `postaction_s3_filekey` | string | No | Specify the file name for Post Action (S3 Storage). Do not include file extension. Ensure the file name is unique. You can use slash (/) as folder delimiter. |

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

### Create PDFs in Parallel

**Slug:** `CRAFTMYPDF_CREATE_PDF_PARALLEL`

Tool to create multiple PDF files in parallel from templates with JSON data. Processes multiple PDF generation requests concurrently for improved performance. Optionally merges all generated PDFs into a single file when merge parameter is enabled. Use when you need to generate multiple PDFs at once from different templates or data.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `merge` | boolean | No | Whether to merge all generated PDFs into a single PDF file. Defaults to false if not specified. |
| `requests` | array | Yes | Array of PDF generation requests to process in parallel. Each request contains template_id, data, and optional meta field. |
| `merge_expiration` | integer | No | Expiration time in minutes for the merged PDF file. Only applicable when merge is true. Valid range: 1-10080 minutes (7 days). Defaults to 5 minutes. |

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

**Slug:** `CRAFTMYPDF_GET_ACCOUNT_INFO`

Tool to retrieve account information including subscription and usage details. Use when you need to check quota limits, template usage, or account creation date.

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

**Slug:** `CRAFTMYPDF_GET_PDF_INFO`

Tool to retrieve information about a PDF file including metadata, page count, and other properties. Use when you need to analyze PDF file structure or extract metadata without downloading the entire file.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | Yes | URL to a PDF file to retrieve information from |

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

**Slug:** `CRAFTMYPDF_LIST_TEMPLATES`

Tool to retrieve a paginated list of PDF templates. Use when you need to browse available templates before generating a PDF.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum number of templates to return, must be at least 1 |
| `offset` | integer | No | Number of templates to skip before returning results, must be non-negative |
| `group_name` | string | No | Filter templates by group name |

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

**Slug:** `CRAFTMYPDF_LIST_TRANSACTIONS`

Tool to retrieve a paginated list of API transactions. Use when you need to view transaction history with pagination support.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum number of transactions to return. Default is 300 |
| `offset` | integer | No | Number of transactions to skip before returning results. Default is 0 |

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

### Merge PDF Files

**Slug:** `CRAFTMYPDF_MERGE_PDFS`

Tool to merge multiple PDF files from URLs into a single PDF document. Use when you need to combine multiple PDF files into one consolidated document. The API fetches PDFs from the provided URLs and merges them in the order specified.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `urls` | array | Yes | Array of PDF URLs to merge. Each URL should be publicly accessible and point to a valid PDF file. |
| `expiration` | integer | No | Expiration time in minutes for the generated PDF link. Default is 5 minutes, range between 1 minute and 10080 minutes (7 days). |
| `output_file` | string | No | Output filename for the merged PDF. Default is 'output.pdf'. |
| `cloud_storage` | integer | No | Upload the generated PDF to storage CDN. Default is 1 (enabled). Set to 0 if you have configured Post Actions to upload to your own S3. |
| `postaction_s3_bucket` | string | No | AWS bucket name to overwrite for Post Action S3 Storage. |
| `postaction_s3_filekey` | string | No | File name for Post Action S3 Storage. Do not specify the file extension. Make sure the file name is unique. You can use slash (/) as folder delimiter. |

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

### Query Template Usage Statistics

**Slug:** `CRAFTMYPDF_QUERY_TEMPLATE_USAGE`

Tool to retrieve usage statistics for specified templates within a date range. Use when you need to track PDF generation counts and credit consumption for specific templates.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `end_date` | string | No | End date for the usage query in ISO 8601 format (UTC time). Example: '2025-01-30T23:59:59Z'. If not provided, uses default date range. |
| `start_date` | string | No | Start date for the usage query in ISO 8601 format (UTC time). Example: '2025-01-30T00:00:00Z'. If not provided, uses default date range. |
| `template_ids` | string | Yes | Comma-separated list of template IDs to query usage statistics for. Example: 'bba77b234e84443e,02077b2b1aa8b938' |

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

**Slug:** `CRAFTMYPDF_UPDATE_PDF_FIELDS`

Tool to update fillable fields in a PDF document such as text fields, checkboxes, and dropdowns. Use when you need to programmatically fill out PDF forms by updating field values. The PDF must contain fillable form fields with identifiable names that match the field IDs you provide.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | Yes | The publicly accessible URL of the PDF file to update. The PDF must contain fillable form fields with identifiable names. |
| `fields` | array | Yes | Array of field updates to apply to the PDF. Each field object specifies which field to update and its new value. The field IDs must match existing field names in the PDF. |
| `expiration` | integer | No | Expiration time in minutes for the generated PDF URL. Valid range: 1 to 10080 minutes (7 days). Defaults to 5 minutes if not specified. |
| `output_file` | string | No | The filename for the generated PDF. Defaults to 'output.pdf' if not specified. |
| `cloud_storage` | integer | No | Whether to upload the generated PDF to the CraftMyPDF CDN. Set to 1 (default) to upload to CDN, or 0 if you have configured Post Actions to upload to your own S3 storage. |

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