Pdf co

Learn how to use Pdf co with Composio

Overview

SLUG: PDF_CO

Description

Template description for Pdf_co

Authentication Details

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.

1

Select App

Navigate to [Pdf co](https://platform.composio.dev/marketplace/Pdf co).

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)

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["PDF_CO"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

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
string
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
boolean
aspectRatio
number
async_
boolean
backColor
string
barcodeHeight
integer
barcodeWidth
integer
caseSensitive
boolean
fontName
string
fontSize
integer
foreColor
string
margin
integer
name
string
outputFormat
string
pdfPassword
string
resolution
integer
type
stringRequired
value
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
name
string
pages
string
password
string
profiles
string
url
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
extraParams
string
file
string
name
string
profiles
string
url
string

Action Response

data
objectRequired
error
string
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
string
pages
string
password
string
profiles
string
url
stringRequired

Action Response

data
objectRequired
error
string
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
string
pages
string
password
string
profiles
string
url
stringRequired

Action Response

data
objectRequired
error
string
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
string
DataDecryptionIV
string
DataDecryptionKey
string
DataEncryptionAlgorithm
string
DataEncryptionIV
string
DataEncryptionKey
string
async
boolean
callback
string
expiration
integerDefaults to 60
httppassword
string
httpusername
string
inline
boolean
name
string
profiles
object
url
stringRequired
worksheetIndex
integer

Action Response

data
objectRequired
error
string
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
string
name
string
template
stringRequired
url
string

Action Response

data
objectRequired
error
string
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
string
run_async
boolean

Action Response

data
objectRequired
error
string
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
string
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
string
objects
arrayRequired
pages
string
password
string
run_async
boolean
url
stringRequired

Action Response

data
objectRequired
error
string
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
stringDefaults to eng
pages
string
password
string
profiles
string
rect
string
url
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
name
string
pages
stringRequired
password
string
profiles
string
url
stringRequired

Action Response

data
objectRequired
error
string
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
string
url
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
pages
string
password
string
profiles
string
regexSearch
boolean
searchString
stringRequired
url
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
password
string
url
stringRequired

Action Response

data
objectRequired
error
string
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
string
url
stringRequired

Action Response

data
objectRequired
error
string
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
string
profiles
string
url
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
async_job
boolean
callback
string
expiration
integer
footer
string
header
string
margins
string
mediaType
string
name
string
orientation
string
paperSize
string
printBackground
boolean
profiles
string
url
stringRequired

Action Response

data
objectRequired
error
string
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
string
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
string
profiles
string
run_async
boolean
urls
stringRequired

Action Response

data
objectRequired
error
string
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
string
pages
stringRequired
password
string
run_async
boolean
url
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
caseSensitive
boolean
pages
string
password
string
regexSearch
boolean
searchString
stringRequired
url
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
name
string
password
string
regexSearch
boolean
replaceString
stringRequired
searchString
stringRequired
url
stringRequired

Action Response

data
objectRequired
error
string
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
string
DataEncryptionIV
string
DataEncryptionKey
string
callback
string
expiration
integer
file_path
string
httppassword
string
httpusername
string
inline
boolean
name
string
outputDataFormat
string
pages
string
password
string
profiles
object
run_async
boolean
url
string

Action Response

data
objectRequired
error
string
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
boolean
inline
boolean
lang
string
name
string
pages
string
password
string
profiles
string
run_async
boolean
url
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
file
string
inline
boolean
name
string
profiles
string
run_async
boolean
url
string

Action Response

data
objectRequired
error
string
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
integer
imageFormat
string
pages
string
password
string
profiles
string
url
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
file
string
inline
boolean
name
string
pages
string
password
string
profiles
string
searchString
string
url
string

Action Response

data
objectRequired
error
string
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
string
expiration
integerDefaults to 60
httppassword
string
httpusername
string
inline
boolean
lang
stringDefaults to eng
lineGrouping
string
name
string
pages
string
password
string
rect
string
run_async
boolean
unwrap
boolean
url
stringRequired

Action Response

data
objectRequired
error
string
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
string
pages
string
password
string
profiles
string
run_async
boolean
url
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
encrypt
boolean
expiration
integer
inline
boolean
name
string
optimization
string
pages
string
password
string
profiles
string
run_async
boolean
url
stringRequired

Action Response

data
objectRequired
error
string
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
string
password
string
profiles
string
run_async
boolean
url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired