Pdf co

Learn how to use Pdf co with Composio

Overview

SLUG: PDF_CO

Description

PDF.co is a secure, cost-effective, and scalable API platform offering a suite of web APIs for tasks such as PDF extraction, generation, editing, splitting, merging, form filling, and barcode processing.

Authentication Details

generic_api_key
stringRequired

Connecting to Pdf co

Create an auth config

Use the dashboard to create an auth config for the Pdf co toolkit. This allows you to connect multiple Pdf co accounts to Composio for agents to use.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Pdf co Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4pdf_co_auth_config_id = "ac_YOUR_PDF_CO_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": {"generic_api_key": user_api_key}}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Pdf co for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, pdf_co_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the [Pdf co toolkit’s playground](https://app.composio.dev/app/Pdf co)

For code examples, see the Tool calling guide and Provider examples.

Tool List

Tool Name: Get Account Balance Info

Description

Tool to get account balance info. Use after authenticating to check remaining credits.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Generate Barcode

Description

Tool to generate barcode images (QR, Code128, Code39, PDF417, etc.). Use when you need to encode data into barcodes on the fly.

Action Parameters

addText
aspectRatio
async_
backColor
barcodeHeight
barcodeWidth
caseSensitive
fontName
fontSize
foreColor
margin
name
outputFormat
pdfPassword
resolution
type
stringRequired
value
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert Excel to CSV

Description

Tool to convert an Excel file (XLS/XLSX) to CSV. Use when you have a public Excel file URL and need CSV output. Inline option returns data inline; otherwise provides download URL.

Action Parameters

inline
name
pages
password
profiles
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert Excel to HTML

Description

Tool to convert an Excel file to HTML. Use when you have an Excel URL or file bytes and need HTML output.

Action Parameters

async
extraParams
file
name
profiles
url

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert Excel to JSON

Description

Tool to convert an online Excel or CSV file to JSON format. Use when you have a public file URL and need structured data extraction.

Action Parameters

name
pages
password
profiles
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert Excel to Text

Description

Tool to convert Excel files to plain text. Use after providing an Excel file URL to extract spreadsheet content.

Action Parameters

encrypt
boolean
inline
boolean
name
pages
password
profiles
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert Excel to XML

Description

Tool to convert an Excel file to XML. Use when needing XML output from xls/xlsx/csv synchronously or asynchronously.

Action Parameters

DataDecryptionAlgorithm
DataDecryptionIV
DataDecryptionKey
DataEncryptionAlgorithm
DataEncryptionIV
DataEncryptionKey
async
boolean
callback
expiration
integerDefaults to 60
httppassword
httpusername
inline
boolean
name
profiles
url
stringRequired
worksheetIndex

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Document Parser

Description

Tool to parse documents based on predefined templates to extract structured data. Use when you need to extract structured fields from a PDF by supplying a custom template.

Action Parameters

async_req
boolean
file
name
template
stringRequired
url

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Upload File

Description

Tool to upload a local file to PDF.co. Use when you need to stage a document on PDF.co for downstream processing.

Action Parameters

file_path
stringRequired
name
run_async

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Check Job Status

Description

Tool to check status and result of an asynchronous job. Use after submitting a job to poll for completion.

Action Parameters

jobid
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Add Content to PDF

Description

Tool to add content to an existing PDF. Use when you need to overlay text, images, barcodes, or links before distributing the file.

Action Parameters

name
objects
arrayRequired
pages
password
run_async
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Change PDF Text Searchable

Description

Tool to make PDF text searchable using OCR. Use when you need to add a searchable text layer to scanned or image-only PDF documents.

Action Parameters

inline
boolean
language
Defaults to eng
pages
password
profiles
rect
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Account Credit Balance

Description

Tool to get remaining account credit balance. Use when you need to check available credits in PDF.co account.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Account Credit Balance

Description

Tool to get remaining account balance. Use when you need to check available credits.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Generate Barcode

Description

Tool to generate high quality barcode images in 45+ formats including QR Code, Code 128, Code 39, and more. Use when you need to create barcodes with customization options like rotation, decoration images for QR codes, or async processing.

Action Parameters

async
callback
decorationImage
encrypt
expiration
inline
name
outputDataFormat
profiles.Angle
profiles.CaptionFont
profiles.NarrowBarWidth
type
Defaults to QRCode
value
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Upload File from Base64

Description

Tool to create a temporary file using base64-encoded source data. Use when you need to upload file content as base64 to PDF.co for downstream processing. Temporary files are automatically deleted after 1 hour (or custom expiration time).

Action Parameters

expiration
file
stringRequired
name

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Delete PDF Pages

Description

Tool to delete specific pages from a PDF file. Use when you need to remove unwanted pages before further processing.

Action Parameters

async_job
name
pages
stringRequired
password
profiles
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Extract PDF Attachments

Description

Tool to extract embedded attachments from a PDF. Use when you need to retrieve embedded files from a PDF after uploading.

Action Parameters

async_job
boolean
password
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Find Text in PDF

Description

Tool to find text in a PDF document. Use when you need to locate keywords or regex patterns and get their page positions.

Action Parameters

caseSensitive
pages
password
profiles
regexSearch
searchString
stringRequired
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: PDF Forms Info Reader

Description

Tool to extract form field information from a PDF. Use when you need to retrieve names, types, and values of form fields.

Action Parameters

inline
password
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert Text to PDF

Description

Tool to convert plain text data to PDF. Use when you need to generate a PDF from raw text content or text file links.

Action Parameters

async_job
boolean
name
stringRequired
profiles
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert Email to PDF

Description

Tool to convert email files (.eml/.msg) to PDF. Use when you need to transform standalone email messages into PDF documents.

Action Parameters

async_job
boolean
name
profiles
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert HTML to PDF

Description

Tool to convert HTML code or webpage URL into a PDF document. Use when you need to capture a webpage or HTML snippet as a PDF file.

Action Parameters

DoNotWaitFullLoad
async_job
callback
expiration
footer
header
margins
mediaType
name
orientation
paperSize
printBackground
profiles
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: PDF Info Reader

Description

Tool to retrieve detailed information and metadata of a PDF. Use when you need page count, author, encryption details, and other document properties.

Action Parameters

url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Merge PDFs

Description

Tool to merge multiple PDF files into one document. Use when you need to combine several PDF URLs into a single PDF file.

Action Parameters

name
profiles
run_async
urls
Required

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Rotate PDF Pages

Description

Tool to rotate selected pages in a PDF. Use when you need to adjust the orientation of specific pages in an online PDF file before further processing.

Action Parameters

angle
integerRequired
name
pages
stringRequired
password
run_async
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Search and Delete Text in PDF

Description

Tool to search for and delete text in a PDF by keyword or regex. Use when you need to remove sensitive or unwanted text from a PDF document.

Action Parameters

async_job
caseSensitive
pages
password
regexSearch
searchString
stringRequired
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Search and Replace Text in PDF

Description

Tool to search for and replace text in a PDF document. Use when you need to update specific text instances within an existing PDF file (e.g., changing invoice numbers).

Action Parameters

async_job
name
password
regexSearch
replaceString
stringRequired
searchString
stringRequired
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Split PDF

Description

Tool to split a PDF into multiple files by page ranges. Use when you need to extract specific pages or page ranges from a PDF.

Action Parameters

DataEncryptionAlgorithm
DataEncryptionIV
DataEncryptionKey
callback
expiration
file_path
httppassword
httpusername
inline
name
outputDataFormat
pages
password
profiles
run_async
url

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert PDF to CSV

Description

Tool to convert PDF or scanned images to CSV format. Use when you need to extract tabular data from a PDF into CSV format.

Action Parameters

encrypt
inline
lang
name
pages
password
profiles
run_async
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert PDF to HTML

Description

Tool to convert PDF documents to HTML. Use when you need an HTML rendition of a PDF or scanned image.

Action Parameters

encrypt
file
inline
name
profiles
run_async
url

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert PDF to Image

Description

Tool to convert PDF pages to images (PNG, JPG, TIFF). Use when you need image previews of PDF content.

Action Parameters

async_job
boolean
dpi
imageFormat
pages
password
profiles
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert PDF to JSON

Description

Tool to convert PDF or scanned images to JSON format. Use when you need a structured JSON representation of PDF content.

Action Parameters

async
file
inline
name
pages
password
profiles
searchString
url

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert PDF to Text

Description

Tool to convert PDF or scanned images to plain text. Use when you need raw text output preserving layout.

Action Parameters

callback
expiration
Defaults to 60
httppassword
httpusername
inline
lang
Defaults to eng
lineGrouping
name
pages
password
rect
run_async
unwrap
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert PDF to XLS

Description

Tool to convert PDF or scanned images to XLS format. Use when you need to extract tabular data into an Excel spreadsheet.

Action Parameters

name
pages
password
profiles
run_async
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert PDF to XLSX

Description

Tool to convert PDF or scanned images to XLSX (Excel) format. Use when you need structured spreadsheet output from a PDF.

Action Parameters

columns0Based
encrypt
expiration
inline
name
optimization
pages
password
profiles
run_async
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Convert PDF to XML

Description

Tool to convert PDF or scanned images to XML format. Use when you need to extract structured data from PDF into XML.

Action Parameters

pages
password
profiles
run_async
url
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired