PDF.co
API actions for the PDF.co integration.
PDF.co
Automate PDF conversions, barcode reading, and document editing with PDF.co.
Add text watermark
Stamp a line of text across every page of a PDF at a chosen position.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
source_url | string | Yes | Public URL of the PDF to watermark. |
text | string | Yes | Watermark text to place in the PDF. |
x | number | No | Horizontal position for the watermark text, in points. |
y | number | No | Vertical position for the watermark text, in points. |
Response
{
"url": "mock_value"
}Convert PDF to CSV
Turn the tables in a PDF into a CSV spreadsheet file.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
source_url | string | Yes | Public URL of the PDF to convert. |
pages | string | No | Optional pages to convert. The first page is 0, so 0-2 means the first three pages. Leave blank to convert every page. |
Response
{
"csv_url": "mock_value"
}Convert PDF to text
Extract the plain text from a PDF using PDF.co.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
source_url | string | Yes | Public URL of the PDF to convert. |
pages | string | No | Optional pages to convert. The first page is 0, so 0-2 means the first three pages. Leave blank to convert every page. |
Response
{
"text": "mock_value"
}Convert HTML to PDF
Turn HTML content into a PDF file, with an optional file name.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
html | string | Yes | The HTML content to turn into a PDF. |
name | string | No | Optional file name for the generated PDF. |
Response
{
"name": "mock_value",
"url": "mock_value"
}Merge PDFs
Combine multiple PDF files into a single document.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
file_urls | array | Yes | List of PDF URLs to merge (at least two). |
output_name | string | No | Optional name for the merged file. |
Response
{
"file_count": 1,
"url": "mock_value"
}Read barcodes
Scan a PDF or image and read any barcodes it contains.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
source_url | string | Yes | Public URL of the file containing barcodes. |
barcode_types | array | No | Optional list of barcode types to look for (e.g., Code39, QRCode). |
Response
{
"barcodes": [
{}
]
}Split PDF by page ranges
Split a PDF into multiple files using page ranges.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
source_url | string | Yes | Public URL of the PDF to split. |
page_ranges | string | Yes | Where to split the PDF, given as page ranges. The first page is 0, so 0-1,2,3- splits after page 2, after page 3, and keeps the rest. |
Response
{
"urls": [
"mock_value"
]
}