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

# PDF Blocks

PDF Blocks provides synchronous API operations for merging, splitting, watermarking, securing, and reorganizing PDF documents.

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

## Tools

### Add Image Watermark

**Slug:** `PDF_BLOCKS_ADD_IMAGE_WATERMARK`

Add a PNG or JPEG image as a watermark on all or selected PDF pages.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file to watermark. |
| `image` | object | Yes | PNG or JPEG image to use as the watermark. |
| `pages` | string | No | One-based pages and ranges to watermark, such as '1,3..5'; omit to watermark every page. |
| `margin` | number | No | Margin from the page border in inches. |
| `transparency` | integer | No | Watermark transparency percentage, where 0 is opaque and 100 is fully transparent. |

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

**Slug:** `PDF_BLOCKS_ADD_PASSWORD`

Create an encrypted copy of a PDF that requires a password to open.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file to encrypt. |
| `password` | string | Yes | Printable ASCII password required to open the output PDF. This secret is sent only to PDF Blocks and is never returned. |
| `encryption_algorithm` | string ("AES-128" | "AES-256") | No | Encryption algorithm for the output PDF. |

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

**Slug:** `PDF_BLOCKS_ADD_RESTRICTIONS`

Create an encrypted PDF copy with explicit permissions for copying, editing, printing, forms, assembly, and accessibility. Permissions are allowed by default; set an allow_* parameter to false to restrict that capability.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file to protect with permission restrictions. |
| `allow_print` | boolean | No | Allow printing the PDF. |
| `user_password` | string | No | Optional printable ASCII password required to open the PDF. Omit it to allow opening without a password. This secret is never returned. |
| `owner_password` | string | Yes | Printable ASCII owner password that controls future permission changes. This secret is never returned. |
| `allow_fill_form` | boolean | No | Allow filling interactive form fields. |
| `allow_copy_content` | boolean | No | Allow copying content from the PDF. |
| `allow_accessibility` | boolean | No | Allow accessibility tools to extract content. |
| `allow_change_content` | boolean | No | Allow changing PDF content. |
| `encryption_algorithm` | string ("AES-128" | "AES-256") | No | Encryption algorithm for the restricted PDF. |
| `allow_assemble_document` | boolean | No | Allow document assembly operations such as inserting or rotating pages. |
| `allow_comment_and_fill_form` | boolean | No | Allow comments and interactive form filling. |
| `allow_print_high_resolution` | boolean | No | Allow high-resolution printing when printing is allowed. |

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

**Slug:** `PDF_BLOCKS_ADD_TEXT_WATERMARK`

Add up to three styled text lines as a watermark on all or selected PDF pages.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file to watermark. |
| `color` | string ("Red" | "Blue" | "Gray" | "Black") | No | Watermark text color. |
| `pages` | string | No | One-based pages and ranges to watermark, such as '1,3..5'; omit to watermark every page. |
| `line_1` | string | Yes | First watermark line using standard Latin characters. |
| `line_2` | string | No | Optional second watermark line. |
| `line_3` | string | No | Optional third watermark line. |
| `margin` | number | No | Margin from the page border in inches. |
| `template` | integer ("1001" | "1002" | "1003" | "1004" | "1005" | "1017" | "1018" | "1019" | "1020" | "1021") | No | Watermark layout template. IDs 1001-1005 are filled and 1017-1021 are outline; within each set, the layouts are diagonal bottom-left to top-right, diagonal top-left to bottom-right, horizontal, vertical reading upward, and vertical reading downward, respectively. |
| `transparency` | integer | No | Watermark transparency percentage, where 0 is opaque and 100 is fully transparent. |

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

### Extract PDF Pages

**Slug:** `PDF_BLOCKS_EXTRACT_PAGES`

Create a PDF containing selected source pages in their original order.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file from which to extract pages. |
| `pages` | string | No | Set of one-based pages and inclusive '..' ranges, such as '1,3..5'; order and duplicates are ignored. Omit to include all pages. |

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

**Slug:** `PDF_BLOCKS_MERGE_PDFS`

Merge PDF files into one PDF in the exact order provided.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `files` | array | Yes | PDF files to merge, in output order; repeated files are allowed. |

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

### Remove PDF Pages

**Slug:** `PDF_BLOCKS_REMOVE_PAGES`

Create a PDF with selected pages removed while preserving the remaining page order.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file from which to remove pages. |
| `pages` | string | Yes | Set of one-based pages and inclusive '..' ranges to remove, such as '2,4..6'; at least one page must remain. |

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

### Remove PDF Password

**Slug:** `PDF_BLOCKS_REMOVE_PASSWORD`

Create an unencrypted copy of a password-protected PDF using its current password.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | Encrypted PDF file to decrypt. |
| `password` | string | Yes | Current PDF password. This secret is sent only to PDF Blocks and is never returned. |

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

### Remove PDF Restrictions

**Slug:** `PDF_BLOCKS_REMOVE_RESTRICTIONS`

Create a PDF copy with permission restrictions cleared.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file whose permission restrictions should be cleared. |

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

### Remove PDF Signatures

**Slug:** `PDF_BLOCKS_REMOVE_SIGNATURES`

Create a PDF copy with all digital signatures and timestamps removed.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | Signed PDF file from which to remove digital signatures and timestamps. |

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

### Reorder PDF Pages

**Slug:** `PDF_BLOCKS_REORDER_PAGES`

Create a PDF in an exact page order, optionally dropping or repeating source pages.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file whose pages should be reordered. |
| `page_order` | string | Yes | Exact output order using comma-separated one-based pages and inclusive '..' ranges. Omitted pages are dropped, duplicates repeat pages, negative indexes count from the end, and ranges may run backward; for example '3,1..2,-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 |

### Reverse PDF Pages

**Slug:** `PDF_BLOCKS_REVERSE_PAGES`

Create a PDF with the complete page order reversed.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file whose page order should be reversed. |

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

### Rotate PDF Pages

**Slug:** `PDF_BLOCKS_ROTATE_PAGES`

Rotate all or selected PDF pages by a supported multiple of 90 degrees.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file whose pages should be rotated. |
| `angle` | integer ("0" | "90" | "180" | "270" | "-90" | "-180" | "-270") | Yes | Rotation angle in degrees; positive values rotate clockwise and negative values rotate counter-clockwise. |
| `pages` | string | No | One-based pages and ranges to rotate, such as '1,3..5'; omit to rotate every 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 |

### Split PDF at Page

**Slug:** `PDF_BLOCKS_SPLIT_PDF_AT_PAGE`

Split a PDF into exactly two downloadable PDFs at a page boundary; the selected page starts the second PDF.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file to split. |
| `page` | integer | Yes | One-based page number that begins the second output PDF; it cannot exceed the input page count. |

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

### Split PDF by Page Count

**Slug:** `PDF_BLOCKS_SPLIT_PDF_BY_PAGE_COUNT`

Split a PDF into consecutive downloadable PDFs containing up to a fixed number of pages each.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file to split. |
| `page_count` | integer | Yes | Maximum number of consecutive pages in each output PDF. |

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

### Split PDF by Page Groups

**Slug:** `PDF_BLOCKS_SPLIT_PDF_BY_PAGE_GROUPS`

Create one downloadable PDF for each caller-defined ordered group of source pages.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file to split. |
| `groups` | string | Yes | Semicolon-separated output groups, with comma-separated one-based pages or inclusive '..' ranges inside each group. Order, duplicates, and backward ranges are preserved; for example '2..8,29;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 |

### Split PDF by Size

**Slug:** `PDF_BLOCKS_SPLIT_PDF_BY_SIZE`

Split a PDF into downloadable PDFs no larger than a requested byte limit.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | object | Yes | PDF file to split. |
| `maximum_bytes` | integer | Yes | Maximum byte size allowed for each output PDF. |

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