> ## Documentation Index
> Fetch the complete documentation index at: https://composio-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# PDF Blocks

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

![PDF Blocks logo](https://mintcdn.com/composio-preview/gqjBKmmJCINafaiK/images/toolkits/pdf_blocks.svg?fit=max\&auto=format\&n=gqjBKmmJCINafaiK\&q=85\&s=5421318dcdc410284291152ada528185)

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

## Tools

> [accordion] 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
>
> **file** `object` *required*
>
> PDF file to watermark.
>
> **image** `object` *required*
>
> PNG or JPEG image to use as the watermark.
>
> **pages** `string`
>
> One-based pages and ranges to watermark, such as '1,3..5'; omit to watermark every page.
>
> **margin** `number`
>
> Margin from the page border in inches.
>
> **transparency** `integer`
>
> Watermark transparency percentage, where 0 is opaque and 100 is fully transparent.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Add PDF Password
>
> **Slug:** `PDF_BLOCKS_ADD_PASSWORD`
>
> Create an encrypted copy of a PDF that requires a password to open.
>
> #### Input Parameters
>
> **file** `object` *required*
>
> PDF file to encrypt.
>
> **password** `string` *required*
>
> 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")`
>
> Encryption algorithm for the output PDF.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] 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
>
> **file** `object` *required*
>
> PDF file to protect with permission restrictions.
>
> **allow\_print** `boolean`
>
> Allow printing the PDF.
>
> **user\_password** `string`
>
> 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` *required*
>
> Printable ASCII owner password that controls future permission changes. This secret is never returned.
>
> **allow\_fill\_form** `boolean`
>
> Allow filling interactive form fields.
>
> **allow\_copy\_content** `boolean`
>
> Allow copying content from the PDF.
>
> **allow\_accessibility** `boolean`
>
> Allow accessibility tools to extract content.
>
> **allow\_change\_content** `boolean`
>
> Allow changing PDF content.
>
> **encryption\_algorithm** `string ("AES-128" | "AES-256")`
>
> Encryption algorithm for the restricted PDF.
>
> **allow\_assemble\_document** `boolean`
>
> Allow document assembly operations such as inserting or rotating pages.
>
> **allow\_comment\_and\_fill\_form** `boolean`
>
> Allow comments and interactive form filling.
>
> **allow\_print\_high\_resolution** `boolean`
>
> Allow high-resolution printing when printing is allowed.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] 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
>
> **file** `object` *required*
>
> PDF file to watermark.
>
> **color** `string ("Red" | "Blue" | "Gray" | "Black")`
>
> Watermark text color.
>
> **pages** `string`
>
> One-based pages and ranges to watermark, such as '1,3..5'; omit to watermark every page.
>
> **line\_1** `string` *required*
>
> First watermark line using standard Latin characters.
>
> **line\_2** `string`
>
> Optional second watermark line.
>
> **line\_3** `string`
>
> Optional third watermark line.
>
> **margin** `number`
>
> Margin from the page border in inches.
>
> **template** `integer ("1001" | "1002" | "1003" | "1004" | "1005" | "1017" | "1018" | "1019" | "1020" | "1021")`
>
> 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`
>
> Watermark transparency percentage, where 0 is opaque and 100 is fully transparent.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Extract PDF Pages
>
> **Slug:** `PDF_BLOCKS_EXTRACT_PAGES`
>
> Create a PDF containing selected source pages in their original order.
>
> #### Input Parameters
>
> **file** `object` *required*
>
> PDF file from which to extract pages.
>
> **pages** `string`
>
> Set of one-based pages and inclusive '..' ranges, such as '1,3..5'; order and duplicates are ignored. Omit to include all pages.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Merge PDFs
>
> **Slug:** `PDF_BLOCKS_MERGE_PDFS`
>
> Merge PDF files into one PDF in the exact order provided.
>
> #### Input Parameters
>
> **files** `array` *required*
>
> PDF files to merge, in output order; repeated files are allowed.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Remove PDF Pages
>
> **Slug:** `PDF_BLOCKS_REMOVE_PAGES`
>
> Create a PDF with selected pages removed while preserving the remaining page order.
>
> #### Input Parameters
>
> **file** `object` *required*
>
> PDF file from which to remove pages.
>
> **pages** `string` *required*
>
> Set of one-based pages and inclusive '..' ranges to remove, such as '2,4..6'; at least one page must remain.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Remove PDF Password
>
> **Slug:** `PDF_BLOCKS_REMOVE_PASSWORD`
>
> Create an unencrypted copy of a password-protected PDF using its current password.
>
> #### Input Parameters
>
> **file** `object` *required*
>
> Encrypted PDF file to decrypt.
>
> **password** `string` *required*
>
> Current PDF password. This secret is sent only to PDF Blocks and is never returned.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Remove PDF Restrictions
>
> **Slug:** `PDF_BLOCKS_REMOVE_RESTRICTIONS`
>
> Create a PDF copy with permission restrictions cleared.
>
> #### Input Parameters
>
> **file** `object` *required*
>
> PDF file whose permission restrictions should be cleared.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Remove PDF Signatures
>
> **Slug:** `PDF_BLOCKS_REMOVE_SIGNATURES`
>
> Create a PDF copy with all digital signatures and timestamps removed.
>
> #### Input Parameters
>
> **file** `object` *required*
>
> Signed PDF file from which to remove digital signatures and timestamps.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Reorder PDF Pages
>
> **Slug:** `PDF_BLOCKS_REORDER_PAGES`
>
> Create a PDF in an exact page order, optionally dropping or repeating source pages.
>
> #### Input Parameters
>
> **file** `object` *required*
>
> PDF file whose pages should be reordered.
>
> **page\_order** `string` *required*
>
> 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
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Reverse PDF Pages
>
> **Slug:** `PDF_BLOCKS_REVERSE_PAGES`
>
> Create a PDF with the complete page order reversed.
>
> #### Input Parameters
>
> **file** `object` *required*
>
> PDF file whose page order should be reversed.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Rotate PDF Pages
>
> **Slug:** `PDF_BLOCKS_ROTATE_PAGES`
>
> Rotate all or selected PDF pages by a supported multiple of 90 degrees.
>
> #### Input Parameters
>
> **file** `object` *required*
>
> PDF file whose pages should be rotated.
>
> **angle** `integer ("0" | "90" | "180" | "270" | "-90" | "-180" | "-270")` *required*
>
> Rotation angle in degrees; positive values rotate clockwise and negative values rotate counter-clockwise.
>
> **pages** `string`
>
> One-based pages and ranges to rotate, such as '1,3..5'; omit to rotate every page.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] 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
>
> **file** `object` *required*
>
> PDF file to split.
>
> **page** `integer` *required*
>
> One-based page number that begins the second output PDF; it cannot exceed the input page count.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] 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
>
> **file** `object` *required*
>
> PDF file to split.
>
> **page\_count** `integer` *required*
>
> Maximum number of consecutive pages in each output PDF.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] 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
>
> **file** `object` *required*
>
> PDF file to split.
>
> **groups** `string` *required*
>
> 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
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] 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
>
> **file** `object` *required*
>
> PDF file to split.
>
> **maximum\_bytes** `integer` *required*
>
> Maximum byte size allowed for each output PDF.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not
