> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to PDF.co

The PDF.co connector lets your AI agent act in each user's PDF.co account. Each user connects their own PDF.co API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 39 tools.

**Authentication:** API Key
**Categories:** Files & Documents
**Tools:** 39: 5 read, 34 write, 0 destructive
**Users sign in with:** API key
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=PDFCO)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the PDF.co connection

   In **AgentKit > Connections**, create a PDF.co connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'pdfco'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize PDF.co:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'pdfco_get_credit_balance',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "pdfco"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize PDF.co:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="pdfco_get_credit_balance",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their PDF.co credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'pdfco_get_credit_balance',
  toolInput: {},
  connector: 'pdfco',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="pdfco_get_credit_balance",
    tool_input={},
    connection_name="pdfco",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `pdfco_get_credit_balance`

Get Credit Balance · Read-only

Get the number of PDF.co credits left on the account.
Returns remainingCredits.
Use pdfco_get_credit_balance before large jobs or when a call fails with HTTP 402 (not enough credits).

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `pdfco_get_document_parser_template`

Get Document Parser Template · Read-only

Get one Document Parser template by ID, including its full definition.
Returns id, type, title, description, created_at, updated_at and body (the template definition text).
Use pdfco_get_document_parser_template to inspect or copy a template before calling pdfco_parse_document. Use pdfco_list_document_parser_templates to find IDs.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `template_id` (`string`, required): ID of the Document Parser template, from pdfco_list_document_parser_templates. Example: 1.

Example input: `{"template_id":"<template_id>"}`

### `pdfco_get_presigned_upload_url`

Get Presigned Upload URL · Read-only

Create a temporary presigned upload link for a local file; this tool does not upload anything. The caller then sends the file bytes with an HTTP PUT to presignedUrl (with the same Content-Type), and uses the returned url as the input URL for other PDF.co tools.
Returns presignedUrl (PUT target, valid about 15 minutes), url (the link to pass to other tools once uploaded, valid about an hour), name and credits.
Use pdfco_get_presigned_upload_url when the source file is not already at a public URL. Files up to 2 GB can be uploaded; process them with async true.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, required): File name for the upload, with extension. Example: contract.pdf.
- `contenttype` (`string`, optional): MIME type the file will be uploaded with; send the same Content-Type header in the PUT. Defaults to application/octet-stream. Example: application/pdf.

Example input: `{"name":"<name>"}`

### `pdfco_list_document_parser_templates`

List Document Parser Templates · Read-only

List the Document Parser templates available to the account, both PDF.co system templates and your own.
Returns templates, each with id, type (system or user), title and description.
Use pdfco_list_document_parser_templates to find a template_id for pdfco_parse_document. Use pdfco_get_document_parser_template to read one template's definition.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `pdfco_list_html_templates`

List HTML Templates · Read-only

List the HTML-to-PDF templates available to the account: PDF.co's system templates and your own.
Returns templates, each with id, title, description, type (system or user), test_json (sample data) and updated_at.
Use pdfco_list_html_templates to find a template_id and sample data for pdfco_html_template_to_pdf.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `pdfco_add_password`

Add Password to PDF · Write

Encrypt a PDF with an owner and/or user password and set what readers may do: print, copy, edit, fill forms, annotate, assemble pages or extract for accessibility.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_add_password to protect or restrict a PDF. Use pdfco_remove_password to unlock one.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/password-protect/sample.pdf.
- `allow_accessibility_support` (`boolean`, optional): Set false to prohibit content extraction for accessibility tools. Defaults to true (allowed).
- `allow_assembly_document` (`boolean`, optional): Set false to prohibit inserting, deleting or rotating pages. Defaults to true (allowed).
- `allow_content_extraction` (`boolean`, optional): Set false to prohibit copying text and images. Defaults to true (allowed).
- `allow_fill_forms` (`boolean`, optional): Set false to prohibit filling form and signature fields. Defaults to true (allowed).
- `allow_modify_annotations` (`boolean`, optional): Set false to prohibit adding or changing annotations and form fields. Defaults to true (allowed).
- `allow_modify_document` (`boolean`, optional): Set false to prohibit editing the document. Defaults to true (allowed).
- `allow_print_document` (`boolean`, optional): Set false to prohibit printing. Defaults to true (allowed).
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `encryption_algorithm` (`string`, optional): Encryption algorithm. Defaults to AES_128bit; AES_128bit or AES_256bit is recommended. One of: `RC4_40bit`, `RC4_128bit`, `AES_128bit`, `AES_256bit`.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: protected.pdf.
- `owner_password` (`string`, optional): Owner password, needed to change or remove the restrictions. Example: OwnerPass123.
- `print_quality` (`string`, optional): Allowed print quality when printing is allowed. Defaults to HighResolution. One of: `LowResolution`, `HighResolution`.
- `user_password` (`string`, optional): User password that readers must enter to open the PDF. Leave empty to allow opening without a password (restrictions still apply). Example: ReadPass123.

Example input: `{"url":"<url>"}`

### `pdfco_add_to_pdf`

Add Text, Images and Fields to PDF · Write

Edit a PDF by drawing text, stamping images (logos, signatures) and adding new fillable fields or checkboxes at given coordinates, and optionally filling existing form fields in the same call.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_add_to_pdf to annotate, stamp, sign or build a form. Use pdfco_fill_pdf_form when you only need to fill existing fields, and pdfco_replace_text to change existing words. Provide at least one of annotations, images or fields.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/sample.pdf.
- `annotations` (`array`, optional): Text objects or new form fields to draw. Each object needs text, x and y (points from the top-left corner); optional: pages (0-based ranges), type (text, textField, TextFieldMultiline or checkbox for a new fillable field, with an id), size, color (#RRGGBB or #AARRGGBB), fontName, fontBold, fontUnderline, fontStrikeout, width, height, alignment (left, center, right), link and RotationAngle. Use {{$$newLine}} or \n for line breaks and {{$$PageNumber}} for page numbers. Example: [{"text": "APPROVED", "x": 400, "y": 30, "size": 24, "color": "#FF0000", "pages": "0"}].
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `fields` (`array`, optional): Existing form fields to fill. Each object needs fieldName (the exact name from pdfco_get_pdf_form_fields) and text (the value; for a checkbox use true, X or 1 to tick it; for a radio button or combo box use the item value or index). Optional: pages, size, fontName, fontBold, fontItalic, fontUnderline, fontStrikeout. Example: [{"fieldName": "topmostSubform[0].Page1[0].f1_02[0]", "text": "John"}, {"fieldName": "topmostSubform[0].Page1[0].c1_1[0]", "text": "true"}].
- `images` (`array`, optional): Images or PDF pages to place on top of the document, such as a logo or signature image. Each object needs url (public image or PDF link, or a data URI), x and y; optional: width, height, pages (0-based ranges), link and keepAspectRatio (default true). Example: [{"url": "https://example.com/signature.png", "x": 400, "y": 700, "width": 120, "pages": "!0"}].
- `name` (`string`, optional): File name for the generated output file. Example: edited.pdf.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.
- `profiles` (`string`, optional): Advanced settings as a JSON-encoded string. Examples: {"FlattenDocument()": []} makes the result read-only; {"Pages[0].SetCropBox()": ["28", "28", "539", "786"]} crops page 1. See https://developer.pdf.co/api/profiles.

Example input: `{"url":"<url>"}`

### `pdfco_auto_rotate_pages`

Auto-rotate PDF Pages · Write

Detect the text orientation of each page with AI/OCR and rotate sideways or upside-down pages upright, typically for scans.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_auto_rotate_pages when page orientation is unknown or mixed. Use pdfco_rotate_pages to rotate specific pages by a fixed angle.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-rotate/sample_rotated.pdf.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `lang` (`string`, optional): OCR language for scanned pages and images, as a Tesseract code; join two with + (eng+deu). Defaults to eng. See https://developer.pdf.co/api/language-support. Example: deu.
- `profiles` (`string`, optional): Advanced PDF.co profile settings as a JSON-encoded string, for options without their own input. Example: {"CheckPermissions": false} to skip the document-permission check (only if you own the document). See https://developer.pdf.co/api/profiles.

Example input: `{"url":"<url>"}`

### `pdfco_check_job`

Check Job · Write

Check the status of a background PDF.co job started with async true, and get its result when it is done. Each check uses a small number of credits.
Returns status (working, success, failed or aborted), message, url of the finished output, pageCount, credits and remainingCredits; some endpoints also return inline results. HTTP 404 Job not found means the job ID is unknown for this API key, so stop polling.
Use pdfco_check_job after any tool that returned a jobId. While status is working, wait a few seconds and check again; on success read the file at url.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `job_id` (`string`, required): The jobId returned by the call that started the background job. Example: 6YSZD3U872ZYYFEDMQCQSGEEO8YSF5WA--151-300.

Example input: `{"job_id":"<job_id>"}`

### `pdfco_compress_pdf`

Compress PDF · Write

Reduce a PDF's file size by downsampling and recompressing images and subsetting fonts, with a preset level or advanced settings.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_compress_pdf before emailing or uploading large PDFs. Start with the default medium preset; use high or aggressive for smaller files at lower image quality.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-compress/sample.pdf.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `color_quality` (`integer`, optional): JPEG quality for colour and greyscale images, 1 (smallest file) to 100 (best quality). Defaults to 60. Example: 75.
- `compression_level` (`string`, optional): Compression preset: low (lightest, keeps the highest image resolution), medium (default, balanced), high, or aggressive (smallest file). One of: `low`, `medium`, `high`, `aggressive`.
- `config` (`object`, optional): Advanced overrides merged on top of the preset, only for what a preset can't do: images (color, grayscale, monochrome downsample and compression), fonts (subset, compress) and save (garbage level). Example: {"images": {"color": {"downsample": {"ppi": 100, "threshold": 150}}}}. See https://developer.pdf.co/api/pdf-compress.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: compressed.pdf.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.

Example input: `{"url":"<url>"}`

### `pdfco_delete_pages`

Delete PDF Pages · Write

Remove selected pages from a PDF and return the remaining pages as a new PDF.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_delete_pages to drop pages from one document. Use pdfco_split_pdf to separate pages into several files.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `pages` (`string`, required): Pages to delete, 1-based: comma-separated numbers and ranges such as 1,3,5-7 or 4- (page 4 to the end). Reverse numbers like !1 are not supported here.
- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-split/sample.pdf.
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: result.pdf.

Example input: `{"pages":"<pages>","url":"<url>"}`

### `pdfco_delete_text`

Delete or Redact Text · Write

Remove text from a PDF by search text or by page area, optionally covering it with a coloured patch for a visible redaction.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_delete_text to redact or strip text. Use pdfco_replace_text to substitute new text instead. Provide search_strings, redactions, or both.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-text/sample.pdf.
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `case_sensitive` (`boolean`, optional): Set false for case-insensitive matching. Defaults to true.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `make_unsearchable` (`boolean`, optional): Set true to turn every page into an image after deleting, so no text can be searched or copied. Defaults to false.
- `name` (`string`, optional): File name for the generated output file. Example: redacted.pdf.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.
- `profiles` (`string`, optional): Advanced settings as a JSON-encoded string. Example: {"UsePatch": true, "PatchColor": "#000000", "RemoveTextUnderPatch": true} draws black boxes over the deleted text (a visible redaction). See https://developer.pdf.co/api/profiles.
- `redactions` (`array`, optional): Rectangular areas to remove, each with page (0-based), x, y, width and height in points from the top-left corner. Example: [{"page": 0, "x": 50, "y": 100, "width": 200, "height": 20}].
- `regex` (`boolean`, optional): Set true to treat the search strings as regular expressions. Defaults to false.
- `replacement_limit` (`integer`, optional): Maximum matches to change for each search string; 0 (default) changes every match. Example: 1.
- `search_strings` (`array`, optional): Texts to delete. Provide search_strings, redactions, or both. Example: ["Invoice", "Confidential"].

Example input: `{"url":"<url>"}`

### `pdfco_document_to_pdf`

Document to PDF · Write

Convert an office document to PDF: Word, RTF, TXT, XPS or PowerPoint with source_format doc, or CSV and Excel spreadsheets with source_format csv.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_document_to_pdf for one office file. Use pdfco_image_to_pdf for images, pdfco_merge_documents to convert and combine several files, and pdfco_url_to_pdf for web pages.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source document. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/doc-to-pdf/sample.docx.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `autosize` (`boolean`, optional): Spreadsheet sources only (source_format csv; ignored for doc): set true to size pages to fit the content; false uses the worksheet's page setup.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: document.pdf.
- `pages` (`string`, optional): Spreadsheet sources only (source_format csv; ignored for doc): pages to include, 0-based ranges such as 0,2-4. Leave empty for all.
- `source_format` (`string`, optional): Type of the source file: doc for DOC, DOCX, RTF, TXT, XPS, PPT and PPTX (PowerPoint is best effort; macros do not run); csv for CSV, XLS and XLSX. Defaults to doc. One of: `doc`, `csv`. Default: `doc`.

Example input: `{"url":"<url>"}`

### `pdfco_fill_pdf_form`

Fill PDF Form · Write

Fill the existing fillable fields of a PDF form (text boxes, checkboxes, radio buttons, combo boxes) by field name.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_fill_pdf_form to complete a form such as a tax or application form. Call pdfco_get_pdf_form_fields first to get the exact field names. Use pdfco_add_to_pdf to place text on a PDF that has no fillable fields.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `fields` (`array`, required): Existing form fields to fill. Each object needs fieldName (the exact name from pdfco_get_pdf_form_fields) and text (the value; for a checkbox use true, X or 1 to tick it; for a radio button or combo box use the item value or index). Optional: pages, size, fontName, fontBold, fontItalic, fontUnderline, fontStrikeout. Example: [{"fieldName": "topmostSubform[0].Page1[0].f1_02[0]", "text": "John"}, {"fieldName": "topmostSubform[0].Page1[0].c1_1[0]", "text": "true"}].
- `url` (`string`, required): Public URL of the source PDF form. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-form/f1040.pdf.
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: filled.pdf.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.
- `profiles` (`string`, optional): Advanced settings as a JSON-encoded string. Example: {"FlattenDocument()": []} flattens the filled form so the values can no longer be edited. See https://developer.pdf.co/api/profiles.

Example input: `{"fields":[],"url":"<url>"}`

### `pdfco_find_text`

Find Text in PDF · Write

Search a PDF for a word, phrase or regular expression and return where each match is, without changing the file.
Returns body, an array of matches with text, pageIndex, left, top, width and height in points, plus pageCount and credits. With inline false it returns a url to a JSON file instead.
Use pdfco_find_text to check whether text exists or get coordinates for pdfco_add_to_pdf. Use pdfco_replace_text or pdfco_delete_text to change the matches.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `search_string` (`string`, required): Text to search for, or a regular expression when regex_search is true (escape backslashes as \\). Example: Invoice Date \d+/\d+/\d+.
- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-text/sample.pdf.
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `inline` (`boolean`, optional): Defaults to true (matches returned in body). Set false to get a url to a JSON file of matches instead.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.
- `regex_search` (`boolean`, optional): Set true to treat search_string as a regular expression. Defaults to false.
- `word_matching_mode` (`string`, optional): How matches are bounded: SmartMatch (default, flexible word boundaries), ExactMatch (whole words only) or None (plain substring). One of: `SmartMatch`, `ExactMatch`, `None`.

Example input: `{"search_string":"<search_string>","url":"<url>"}`

### `pdfco_generate_barcode`

Generate Barcode · Write

Create a barcode or QR code image from a value, optionally with a logo in the middle of a QR code.
Returns url, a temporary link to the PNG image (valid for expiration minutes), plus credits and remainingCredits.
Use pdfco_generate_barcode to make a code image, then pdfco_add_to_pdf to stamp it on a PDF. Use pdfco_read_barcodes to decode existing codes.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `value` (`string`, required): The text or number to encode. It must fit the chosen type's character set, e.g. digits only for EAN13. Example: https://example.com/order/1042.
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `decoration_image` (`string`, optional): QR codes only: public URL of a logo image to place in the centre of the code. Example: https://example.com/logo.png.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: barcode.png.
- `profiles` (`string`, optional): Advanced settings as a JSON-encoded string: Angle (0, 1, 2 or 3 for 0, 90, 180 or 270 degrees), NarrowBarWidth in pixels, CaptionFont such as Arial, 12. Example: {"Angle": 1, "NarrowBarWidth": 3}.
- `type` (`string`, optional): Barcode symbology. Defaults to QRCode. Common choices: QRCode, Code128, Code39, DataMatrix, EAN13, UPCA, PDF417. One of: `QRCode`, `AustralianPostCode`, `Aztec`, `Codabar`, `CodablockF`, `Code128`, `Code16K`, `Code39`, `Code39Extended`, `Code39Mod43`, `Code39Mod43Extended`, `Code93`, `DataMatrix`, `DPMDataMatrix`, `EAN13`, `EAN2`, `EAN5`, `EAN8`, `GS1DataBarExpanded`, `GS1DataBarExpandedStacked`, `GS1DataBarLimited`, `GS1DataBarOmnidirectional`, `GS1DataBarStacked`, `GTIN12`, `GTIN13`, `GTIN14`, `GTIN8`, `IntelligentMail`, `Interleaved2of5`, `ITF14`, `MaxiCode`, `MICR`, `MicroPDF`, `MSI`, `PatchCode`, `PDF417`, `Pharmacode`, `PostNet`, `PZN`, `RoyalMail`, `RoyalMailKIX`, `Trioptic`, `UPCA`, `UPCE`, `UPU`. Default: `QRCode`.

Example input: `{"value":"<value>"}`

### `pdfco_get_pdf_form_fields`

Get PDF Form Fields · Write

List the fillable form fields in a PDF, with each field's name, type, current value, page and position.
Returns info with the document properties plus FieldsInfo.Fields: an array of fields with PageIndex, Type (EditBox, CheckBox, RadioButton, ComboBox and others), FieldName, Value, Text and the field rectangle.
Use pdfco_get_pdf_form_fields to learn the exact field names before calling pdfco_fill_pdf_form. Use pdfco_get_pdf_info for general document properties.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF form. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-form/f1040.pdf.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.

Example input: `{"url":"<url>"}`

### `pdfco_get_pdf_info`

Get PDF Info · Write

Read a PDF's properties and security settings without changing it.
Returns info with PageCount, Title, Author, Subject, Keywords, Creator, Producer, creation and modification dates, page size (PageRectangle), Encrypted and the permission flags (printing, modifying, copying, form filling and others).
Use pdfco_get_pdf_info to check page count, metadata or protection before other operations. Use pdfco_get_pdf_form_fields to list fillable form fields.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-info/sample.pdf.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.

Example input: `{"url":"<url>"}`

### `pdfco_html_template_to_pdf`

HTML Template to PDF · Write

Create a PDF from a saved PDF.co HTML template by filling its {{macros}} with your JSON data, for invoices, receipts or reports.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_html_template_to_pdf with a template ID from pdfco_list_html_templates. Use pdfco_html_to_pdf to convert raw HTML instead.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `template_data` (`string`, required): Data for the template's Mustache/Handlebars macros, as a JSON string (recommended) or CSV text; an object is also accepted and sent as JSON. Example: {"invoice_id": "1042", "paid": true}.
- `template_id` (`integer`, required): ID of a PDF.co HTML template, from pdfco_list_html_templates or the HTML to PDF Templates page in the PDF.co dashboard. Example: 1.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `do_not_wait_full_load` (`boolean`, optional): Set true to convert after minimal loading instead of waiting for the full page load, which is faster but may miss late content. Defaults to false.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `footer` (`string`, optional): HTML printed at the bottom of every page, with the same classes as header. Example: <span style='font-size:10px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span></span>.
- `header` (`string`, optional): HTML printed at the top of every page. Classes date, title, url, pageNumber and totalPages are filled in, e.g. <span class='pageNumber'></span>. Leave room with margins.
- `margins` (`string`, optional): Page margins overriding the page CSS, as "top right bottom left" or one value for all sides, in px, mm, cm or in. Example: 40px 20px 40px 20px.
- `media_type` (`string`, optional): CSS media type used for rendering: print (default), screen or none. One of: `print`, `screen`, `none`.
- `name` (`string`, optional): File name for the generated output file. Example: document.pdf.
- `orientation` (`string`, optional): Page orientation. Defaults to Portrait. One of: `Portrait`, `Landscape`.
- `paper_size` (`string`, optional): Paper size: Letter, Legal, Tabloid, Ledger, A0 to A6, or a custom "width height" with px, mm, cm or in (e.g. 200mm 300mm). Defaults to A4.
- `print_background` (`boolean`, optional): Set false to leave out background colours and images. Defaults to true.

Example input: `{"template_data":"<template_data>","template_id":1}`

### `pdfco_html_to_pdf`

HTML to PDF · Write

Render HTML markup into a PDF with a headless browser, with optional paper size, orientation, margins, header and footer.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_html_to_pdf when you have the HTML. Use pdfco_url_to_pdf for a live web page, and pdfco_html_template_to_pdf to fill a saved PDF.co HTML template with JSON data.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `html` (`string`, required): The HTML to convert, as a full document or a fragment; inline CSS and JavaScript run before rendering. The request body is limited to 4 MB. Example: <h1>Invoice 1042</h1>Total: $120
.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `do_not_wait_full_load` (`boolean`, optional): Set true to convert after minimal loading instead of waiting for the full page load, which is faster but may miss late content. Defaults to false.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `footer` (`string`, optional): HTML printed at the bottom of every page, with the same classes as header. Example: <span style='font-size:10px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span></span>.
- `header` (`string`, optional): HTML printed at the top of every page. Classes date, title, url, pageNumber and totalPages are filled in, e.g. <span class='pageNumber'></span>. Leave room with margins.
- `margins` (`string`, optional): Page margins overriding the page CSS, as "top right bottom left" or one value for all sides, in px, mm, cm or in. Example: 40px 20px 40px 20px.
- `media_type` (`string`, optional): CSS media type used for rendering: print (default), screen or none. One of: `print`, `screen`, `none`.
- `name` (`string`, optional): File name for the generated output file. Example: document.pdf.
- `orientation` (`string`, optional): Page orientation. Defaults to Portrait. One of: `Portrait`, `Landscape`.
- `paper_size` (`string`, optional): Paper size: Letter, Legal, Tabloid, Ledger, A0 to A6, or a custom "width height" with px, mm, cm or in (e.g. 200mm 300mm). Defaults to A4.
- `print_background` (`boolean`, optional): Set false to leave out background colours and images. Defaults to true.

Example input: `{"html":"<html>"}`

### `pdfco_image_to_pdf`

Image to PDF · Write

Convert one or more JPG, PNG or TIFF images into a PDF, one page per image, in the order given.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_image_to_pdf for photos and scans. Use pdfco_document_to_pdf for office files and pdfco_merge_documents to combine images with other documents.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `urls` (`array`, required): Public URLs of the JPG, PNG or TIFF images, in page order. You can also pass one comma-separated string. Example: ["https://example.com/scan1.png", "https://example.com/scan2.jpg"].
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: images.pdf.

Example input: `{"urls":["https://example.com/scan1.png","https://example.com/scan2.jpg"]}`

### `pdfco_merge_documents`

Merge Documents · Write

Convert and combine files of different types (PDF, Word, Excel, RTF, TXT, images, or ZIP archives of them) into one PDF, in the order given. Uses more credits than a PDF-only merge because each file is converted first.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_merge_documents for mixed file types. Use pdfco_merge_pdfs when every input is already a PDF.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `urls` (`array`, required): Source file URLs to combine, in output order: PDF, DOC, DOCX, XLS, XLSX, RTF, TXT, PNG, JPG or ZIP archives of these (not HEIC or WEBP). Each must be publicly reachable by PDF.co. You can also pass one comma-separated string. Example: ["https://example.com/a.docx", "https://example.com/b.png"].
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: merged.pdf.
- `profiles` (`string`, optional): Advanced PDF.co profile settings as a JSON-encoded string, for options without their own input. Example: {"CheckPermissions": false} to skip the document-permission check (only if you own the document). See https://developer.pdf.co/api/profiles.

Example input: `{"urls":["https://example.com/a.docx","https://example.com/b.png"]}`

### `pdfco_merge_pdfs`

Merge PDFs · Write

Combine two or more PDF files into one PDF, in the order given.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_merge_pdfs when every input is a PDF. Use pdfco_merge_documents when inputs mix Word, Excel, images or ZIP files.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `urls` (`array`, required): Source file URLs to combine, in output order. Each must be publicly reachable by PDF.co. You can also pass one comma-separated string. Example: ["https://example.com/a.pdf", "https://example.com/b.pdf"].
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: merged.pdf.
- `profiles` (`string`, optional): Advanced PDF.co profile settings as a JSON-encoded string, for options without their own input. Example: {"CheckPermissions": false} to skip the document-permission check (only if you own the document). See https://developer.pdf.co/api/profiles.

Example input: `{"urls":["https://example.com/a.pdf","https://example.com/b.pdf"]}`

### `pdfco_parse_document`

Parse Document with Template · Write

Extract named fields, tables and values from a PDF or scanned image using a Document Parser template, either a saved template ID or a template definition passed inline.
Returns body.objects, a list of extracted items with name, objectType (field or table), value or rows, and pageIndex, plus templateName; in async mode returns jobId and the url of the JSON, CSV or XML output to read once pdfco_check_job reports success.
Use pdfco_parse_document for recurring layouts you have a template for. Use pdfco_parse_invoice for invoices without a template, and pdfco_list_document_parser_templates to find template IDs. Provide template_id or template.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF or scanned image. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/document-parser/sample-invoice.pdf.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `inline` (`boolean`, optional): Async calls only: set true to include the parsed results in the completed pdfco_check_job response as well as the output file url.
- `name` (`string`, optional): File name for the generated output file. Example: result.json.
- `output_format` (`string`, optional): Format of the output file: JSON (default), CSV or XML. One of: `JSON`, `CSV`, `XML`.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.
- `profiles` (`string`, optional): Advanced PDF.co profile settings as a JSON-encoded string, for options without their own input. Example: {"CheckPermissions": false} to skip the document-permission check (only if you own the document). See https://developer.pdf.co/api/profiles.
- `template` (`string`, optional): A Document Parser template definition (YAML or JSON text) to use directly instead of a saved template_id. See https://developer.pdf.co/api/documentparser/overview.
- `template_id` (`integer`, optional): ID of a saved Document Parser template, from pdfco_list_document_parser_templates. Provide template_id or template. Example: 1.

Example input: `{"url":"<url>"}`

### `pdfco_parse_invoice`

Parse Invoice with AI · Write

Extract structured data from an invoice of any layout with PDF.co's AI invoice parser, with no template needed. Always runs as a background job.
Returns jobId and a url right away; poll pdfco_check_job until status is success, then read the JSON at url: vendor, customer, invoice (number, dates, totals, tax), paymentDetails, others and lineItems.
Use pdfco_parse_invoice for invoices only, one invoice per file (split multi-invoice files with pdfco_split_pdf first; 100 pages max). Use pdfco_parse_document for other document types or when you have a template.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source invoice (PDF or image). PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/document-parser/sample-invoice.pdf.
- `custom_field` (`string`, optional): Extra fields to extract beyond the standard invoice schema, as comma-separated camelCase names. Example: storeNumber,deliveryDate,purchaseOrderRef.
- `line_item_structure` (`object`, optional): Exact shape for every line item: keys are camelCase field names you choose and values are "string" or "number". Example: {"description": "string", "quantity": "number", "unitPrice": "number", "totalPrice": "number"}.

Example input: `{"url":"<url>"}`

### `pdfco_pdf_to_csv`

PDF to CSV · Write

Convert tables and text in a PDF or scanned image to CSV, detecting columns, rows and table borders.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success. With inline true on a synchronous call the CSV text is returned in body.
Use pdfco_pdf_to_csv to get tabular data as CSV. Use pdfco_pdf_to_excel for an .xlsx or .xls workbook, and pdfco_pdf_to_json for text with coordinates.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF or scanned image (PDF, PNG, JPG, TIFF). PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-csv/sample.pdf.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `inline` (`boolean`, optional): Set true to also return the extracted content inside the response body field, in addition to the url of the output file. Applies to synchronous calls (async false); keep false for large documents.
- `lang` (`string`, optional): OCR language for scanned pages and images, as a Tesseract code; join two with + (eng+deu). Defaults to eng. See https://developer.pdf.co/api/language-support. Example: deu.
- `line_grouping` (`string`, optional): How to group text lines inside table cells: 1 merges rows whose cells all align, 2 merges cells down each column, 3 joins single-cell rows to the row above. Leave empty for no grouping. One of: `1`, `2`, `3`.
- `name` (`string`, optional): File name for the generated output file. Example: result.csv.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.
- `profiles` (`string`, optional): Advanced PDF.co profile settings as a JSON-encoded string, for options without their own input. Example: {"CheckPermissions": false} to skip the document-permission check (only if you own the document). See https://developer.pdf.co/api/profiles.
- `rect` (`string`, optional): Area to extract from, in PDF points from the top-left corner, as "x y width height". Leave empty to use the whole page. Example: 51.8 114.8 235.5 204.0.
- `unwrap` (`boolean`, optional): Set true to join wrapped lines inside a table cell into one line. Only applies when line_grouping is 1.

Example input: `{"url":"<url>"}`

### `pdfco_pdf_to_excel`

PDF to Excel · Write

Convert tables and text in a PDF or scanned image to an Excel workbook (.xlsx by default, or .xls), keeping layout and fonts.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_pdf_to_excel when the user wants a spreadsheet file. Use pdfco_pdf_to_csv for CSV text, and pdfco_document_to_pdf with source_format csv to turn a spreadsheet back into a PDF.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF or scanned image (PDF, PNG, JPG, TIFF). PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-excel/sample.pdf.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `format` (`string`, optional): Excel file format of the output: xlsx (Excel 2007+, default) or xls (legacy Excel 97-2003). One of: `xlsx`, `xls`. Default: `xlsx`.
- `lang` (`string`, optional): OCR language for scanned pages and images, as a Tesseract code; join two with + (eng+deu). Defaults to eng. See https://developer.pdf.co/api/language-support. Example: deu.
- `line_grouping` (`string`, optional): How to group text lines inside table cells: 1 merges rows whose cells all align, 2 merges cells down each column, 3 joins single-cell rows to the row above. Leave empty for no grouping. One of: `1`, `2`, `3`.
- `name` (`string`, optional): File name for the generated output file. Example: result.xlsx.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.
- `profiles` (`string`, optional): Advanced PDF.co profile settings as a JSON-encoded string, for options without their own input. Example: {"CheckPermissions": false} to skip the document-permission check (only if you own the document). See https://developer.pdf.co/api/profiles.
- `rect` (`string`, optional): Area to extract from, in PDF points from the top-left corner, as "x y width height". Leave empty to use the whole page. Example: 51.8 114.8 235.5 204.0.
- `unwrap` (`boolean`, optional): Set true to join wrapped lines inside a table cell into one line. Only applies when line_grouping is 1.

Example input: `{"url":"<url>"}`

### `pdfco_pdf_to_html`

PDF to HTML · Write

Convert a PDF or scanned image to an HTML page, keeping text, fonts, images and layout, or to plain HTML with simple true.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_pdf_to_html to publish or display a PDF as a web page. Use pdfco_pdf_to_text when you only need the words. Use pdfco_html_to_pdf for the opposite direction.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF or scanned image (PDF, PNG, JPG, TIFF). PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `columns` (`boolean`, optional): Set true if the PDF is laid out in columns like a newspaper, so text is read column by column. Defaults to false.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `inline` (`boolean`, optional): Set true to also return the extracted content inside the response body field, in addition to the url of the output file. Applies to synchronous calls (async false); keep false for large documents.
- `lang` (`string`, optional): OCR language for scanned pages and images, as a Tesseract code; join two with + (eng+deu). Defaults to eng. See https://developer.pdf.co/api/language-support. Example: deu.
- `line_grouping` (`string`, optional): How to group text lines inside table cells: 1 merges rows whose cells all align, 2 merges cells down each column, 3 joins single-cell rows to the row above. Leave empty for no grouping. One of: `1`, `2`, `3`.
- `name` (`string`, optional): File name for the generated output file. Example: result.html.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.
- `profiles` (`string`, optional): Advanced PDF.co profile settings as a JSON-encoded string, for options without their own input. Example: {"CheckPermissions": false} to skip the document-permission check (only if you own the document). See https://developer.pdf.co/api/profiles.
- `rect` (`string`, optional): Area to extract from, in PDF points from the top-left corner, as "x y width height". Leave empty to use the whole page. Example: 51.8 114.8 235.5 204.0.
- `simple` (`boolean`, optional): Set true for plain HTML without the original layout styling. Defaults to false (rich HTML and CSS that keeps the document design).
- `unwrap` (`boolean`, optional): Set true to join wrapped lines inside a table cell into one line. Only applies when line_grouping is 1.

Example input: `{"url":"<url>"}`

### `pdfco_pdf_to_json`

PDF to JSON · Write

Convert a PDF or scanned image to JSON that describes each page as rows and columns of text objects with font, colour and position.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success. With inline true on a synchronous call the JSON is returned in body.document.
Use pdfco_pdf_to_json when you need text with coordinates and formatting. Use pdfco_pdf_to_text for plain text, pdfco_pdf_to_csv for tables, pdfco_parse_document to pull named fields with a template, or pdfco_parse_invoice for invoices.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF or scanned image (PDF, PNG, JPG, TIFF). PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-json/sample.pdf.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `inline` (`boolean`, optional): Set true to also return the extracted content inside the response body field, in addition to the url of the output file. Applies to synchronous calls (async false); keep false for large documents.
- `lang` (`string`, optional): OCR language for scanned pages and images, as a Tesseract code; join two with + (eng+deu). Defaults to eng. See https://developer.pdf.co/api/language-support. Example: deu.
- `line_grouping` (`string`, optional): How to group text lines inside table cells: 1 merges rows whose cells all align, 2 merges cells down each column, 3 joins single-cell rows to the row above. Leave empty for no grouping. One of: `1`, `2`, `3`.
- `name` (`string`, optional): File name for the generated output file. Example: result.json.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.
- `profiles` (`string`, optional): Advanced PDF.co profile settings as a JSON-encoded string, for options without their own input. Example: {"CheckPermissions": false} to skip the document-permission check (only if you own the document). See https://developer.pdf.co/api/profiles.
- `rect` (`string`, optional): Area to extract from, in PDF points from the top-left corner, as "x y width height". Leave empty to use the whole page. Example: 51.8 114.8 235.5 204.0.
- `unwrap` (`boolean`, optional): Set true to join wrapped lines inside a table cell into one line. Only applies when line_grouping is 1.

Example input: `{"url":"<url>"}`

### `pdfco_pdf_to_text`

PDF to Text · Write

Extract text from a PDF or scanned image as plain text that keeps the page layout, running OCR on scanned pages.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success. Set async false with inline true on small files to get the text in body directly.
Use pdfco_pdf_to_text for layout-preserving text with OCR. Use pdfco_pdf_to_text_simple for a faster, cheaper pass on digital PDFs, and pdfco_pdf_to_json or pdfco_pdf_to_csv for structured output.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF or scanned image (PDF, PNG, JPG, TIFF). PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-text/sample.pdf.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `inline` (`boolean`, optional): Set true to also return the extracted content inside the response body field, in addition to the url of the output file. Applies to synchronous calls (async false); keep false for large documents.
- `lang` (`string`, optional): OCR language for scanned pages and images, as a Tesseract code; join two with + (eng+deu). Defaults to eng. See https://developer.pdf.co/api/language-support. Example: deu.
- `line_grouping` (`string`, optional): How to group text lines inside table cells: 1 merges rows whose cells all align, 2 merges cells down each column, 3 joins single-cell rows to the row above. Leave empty for no grouping. One of: `1`, `2`, `3`.
- `name` (`string`, optional): File name for the generated output file. Example: result.txt.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.
- `profiles` (`string`, optional): Advanced PDF.co profile settings as a JSON-encoded string, for options without their own input. Example: {"CheckPermissions": false} to skip the document-permission check (only if you own the document). See https://developer.pdf.co/api/profiles.
- `rect` (`string`, optional): Area to extract from, in PDF points from the top-left corner, as "x y width height". Leave empty to use the whole page. Example: 51.8 114.8 235.5 204.0.
- `unwrap` (`boolean`, optional): Set true to join wrapped lines inside a table cell into one line. Only applies when line_grouping is 1.

Example input: `{"url":"<url>"}`

### `pdfco_pdf_to_text_simple`

PDF to Text (Simple) · Write

Extract the text layer of a digital PDF quickly, without OCR, layout analysis or profiles; uses fewer credits than full text extraction.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success. With inline true on a synchronous call the text is returned in body.
Use pdfco_pdf_to_text_simple for fast text from PDFs that already contain selectable text. Use pdfco_pdf_to_text for scanned pages or layout-preserving output.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-text/sample.pdf.
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `inline` (`boolean`, optional): Set true to also return the extracted content inside the response body field, in addition to the url of the output file. Applies to synchronous calls (async false); keep false for large documents.
- `name` (`string`, optional): File name for the generated output file. Example: result.txt.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.

Example input: `{"url":"<url>"}`

### `pdfco_read_barcodes`

Read Barcodes · Write

Find and decode barcodes and QR codes in a PDF or image, such as QR Code, Code 128, Code 39, EAN, UPC, DataMatrix and PDF417. Can also detect checkboxes and form marks on scans.
Returns barcodes, an array with Value, TypeName, Page, Rect (position) and Confidence for each code found, plus pageCount and credits.
Use pdfco_read_barcodes to decode codes. Use pdfco_generate_barcode to create one, and pdfco_split_pdf_by_text to split a PDF at barcode pages.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `types` (`string`, required): Comma-separated barcode types to look for, e.g. QRCode,Code128,Code39,DataMatrix,EAN13,UPCA,PDF417 (see https://developer.pdf.co/api/barcode/overview). To detect form marks on scans use Checkbox, Rectangle, Oval, UnderlinedField, Segment, HorizontalLine or VerticalLine.
- `url` (`string`, required): Public URL of the source PDF or image. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/barcode-reader/sample.pdf.
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages.
- `profiles` (`string`, optional): Advanced PDF.co profile settings as a JSON-encoded string, for options without their own input. Example: {"CheckPermissions": false} to skip the document-permission check (only if you own the document). See https://developer.pdf.co/api/profiles.

Example input: `{"types":"<types>","url":"<url>"}`

### `pdfco_remove_password`

Remove Password from PDF · Write

Remove the password and permission restrictions from a PDF, producing an unprotected copy.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_remove_password with the PDF's password to unlock it before other edits. Use pdfco_add_password to protect a PDF. Only unlock documents you are allowed to.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/password-protect/sample_protected.pdf.
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: unlocked.pdf.
- `password` (`string`, optional): The PDF's current password (owner or user). Example: s3cret.

Example input: `{"url":"<url>"}`

### `pdfco_replace_text`

Search and Replace Text · Write

Find text in a PDF and replace it with new text, for example to fill placeholders such as [CLIENT-NAME] in a template.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_replace_text to change wording. Use pdfco_delete_text to remove or black out text, pdfco_replace_text_with_image to swap text for an image, and pdfco_find_text to locate text without changing the file.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `replace_strings` (`array`, required): Replacement texts, one per search string and in the same order. Example: ["John Doe", "Acme Inc"].
- `search_strings` (`array`, required): Texts to find. Each one is replaced by the item at the same position in replace_strings. Example: ["[CLIENT-NAME]", "[CLIENT-COMPANY]"].
- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-search-and-replace/sample-agreement-template-signature-page-1.pdf.
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `case_sensitive` (`boolean`, optional): Set false for case-insensitive matching. Defaults to true.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: result.pdf.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.
- `profiles` (`string`, optional): Advanced PDF.co profile settings as a JSON-encoded string, for options without their own input. Example: {"CheckPermissions": false} to skip the document-permission check (only if you own the document). See https://developer.pdf.co/api/profiles.
- `regex` (`boolean`, optional): Set true to treat the search strings as regular expressions. Defaults to false.
- `replacement_limit` (`integer`, optional): Maximum matches to change for each search string; 0 (default) changes every match. Example: 1.

Example input: `{"replace_strings":["John Doe","Acme Inc"],"search_strings":["Invoice","Confidential"],"url":"<url>"}`

### `pdfco_replace_text_with_image`

Replace Text with Image · Write

Find text in a PDF and replace it with an image, for example to drop a logo or signature into a placeholder.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_replace_text_with_image when the placeholder is text. Use pdfco_add_to_pdf to place an image at fixed coordinates, and pdfco_replace_text for text-to-text replacement.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `replace_image` (`string`, required): Public URL (or data URI) of the image to insert where the text was found. Example: https://example.com/logo.png.
- `search_string` (`string`, required): Text to find and replace with the image. Example: Your Company Name.
- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-text/sample.pdf.
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `case_sensitive` (`boolean`, optional): Set false for case-insensitive matching. Defaults to true.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: result.pdf.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages.
- `password` (`string`, optional): Password to open the source PDF, if it is password-protected. Example: s3cret.
- `profiles` (`string`, optional): Advanced PDF.co profile settings as a JSON-encoded string, for options without their own input. Example: {"CheckPermissions": false} to skip the document-permission check (only if you own the document). See https://developer.pdf.co/api/profiles.
- `regex` (`boolean`, optional): Set true to treat the search strings as regular expressions. Defaults to false.
- `replacement_limit` (`integer`, optional): Maximum matches to change for each search string; 0 (default) changes every match. Example: 1.

Example input: `{"replace_image":"<replace_image>","search_string":"<search_string>","url":"<url>"}`

### `pdfco_rotate_pages`

Rotate PDF Pages · Write

Rotate all or selected pages of a PDF by 90, 180 or 270 degrees.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_rotate_pages when you know which pages and angle. Use pdfco_auto_rotate_pages to let PDF.co detect and fix the orientation of scanned pages.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `angle` (`integer`, required): Clockwise rotation in degrees: 90, 180 or 270 (0 leaves pages unchanged). One of: `0`, `90`, `180`, `270`.
- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-rotate/sample.pdf.
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `name` (`string`, optional): File name for the generated output file. Example: rotated.pdf.
- `pages` (`string`, optional): Pages to process, 0-based: comma-separated page numbers and ranges such as 0,2,5-10 or 3- (page 3 to the end); !0 is the last page. Leave empty for all pages. Example: 0,2 rotates the first and third pages.

Example input: `{"angle":0,"url":"<url>"}`

### `pdfco_split_pdf`

Split PDF · Write

Split a PDF into several PDFs by page numbers or ranges, one output file per range.
Returns urls, an array of temporary links to the output PDFs, plus pageCount and credits. With async it returns jobId and a url to a JSON file listing the outputs; pass inline true to get the list in the pdfco_check_job response.
Use pdfco_split_pdf when you know the page ranges. Use pdfco_split_pdf_by_text to split wherever a text or barcode appears, and pdfco_delete_pages to drop pages from one document.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-split/sample.pdf.
- `async` (`boolean`, optional): Set true to run the job in the background: the call returns a jobId and reserved output url at once; poll pdfco_check_job until status is success. Scalekit stops waiting after 10 seconds, so use true for large or many-page files.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `inline` (`boolean`, optional): For async calls, set true to include the list of output URLs in the completed pdfco_check_job response.
- `name` (`string`, optional): File name for the generated output file. Example: part.pdf.
- `pages` (`string`, optional): Page ranges to split out, 1-based: each comma-separated item becomes one output file, e.g. 1-2,3- gives pages 1-2 and pages 3 to the end; !1 is the last page; * splits every page into its own file. Leave empty to split every page.

Example input: `{"url":"<url>"}`

### `pdfco_split_pdf_by_text`

Split PDF by Text or Barcode · Write

Split a PDF into several PDFs at every page that contains a search text, regular expression or barcode.
Returns urls, an array of temporary links to the output PDFs, plus pageCount and credits; with async it returns jobId to poll with pdfco_check_job.
Use pdfco_split_pdf_by_text for batches of scanned documents separated by a heading or barcode sheet. Use pdfco_split_pdf when you know the page numbers.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `search_string` (`string`, required): Text that marks a split page. For a barcode use [[barcode:<types>]] or [[barcode:<types> <value>]], e.g. [[barcode:qrcode]] or [[barcode:qrcode,datamatrix /pdf.co/]]. Regular expressions need regex_search true.
- `url` (`string`, required): Public URL of the source PDF. PDF.co downloads the file from this URL, so it must be reachable without a login: a direct link, a PDF.co temporary file URL from an earlier result, or a presigned upload URL from pdfco_get_presigned_upload_url. Each input file can be up to 100 MB. Prefix with cache: (cache:https://...) to let PDF.co reuse a file it already downloaded. Example: https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-split/split_by_text_and_barcode.pdf.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `case_sensitive` (`boolean`, optional): Set false for case-insensitive matching. Defaults to true.
- `exclude_key_pages` (`boolean`, optional): Set true to drop the pages where the search text was found from the output. Defaults to false.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `inline` (`boolean`, optional): For async calls, set true to include the output URLs in the completed pdfco_check_job response.
- `lang` (`string`, optional): OCR language for scanned pages and images, as a Tesseract code; join two with + (eng+deu). Defaults to eng. See https://developer.pdf.co/api/language-support. Example: deu.
- `name` (`string`, optional): File name for the generated output file. Example: part.pdf.
- `regex_search` (`boolean`, optional): Set true to treat search_string as a regular expression. Defaults to false.

Example input: `{"search_string":"<search_string>","url":"<url>"}`

### `pdfco_url_to_pdf`

Web Page to PDF · Write

Capture a live web page as a PDF with a headless browser, running its JavaScript, with optional paper size, orientation, margins, header and footer.
Returns url (a temporary link to the output file, valid for expiration minutes), pageCount, credits and remainingCredits; with async it returns jobId and the reserved url to read once pdfco_check_job reports success.
Use pdfco_url_to_pdf to save or archive a web page. Use pdfco_html_to_pdf when you have the HTML itself, and pdfco_document_to_pdf for a link to a Word or Excel file.
Runs in the background by default; poll pdfco_check_job with the returned jobId.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Address of the web page to capture. Example: https://example.com/report.
- `async` (`boolean`, optional): Run the job in the background. Defaults to true: the call returns a jobId and the reserved output url right away; poll pdfco_check_job with the jobId until status is success, then read the url. Scalekit stops waiting after 10 seconds, so only set false for small files that finish within a few seconds. Default: `true`.
- `do_not_wait_full_load` (`boolean`, optional): Set true to convert after minimal loading instead of waiting for the full page load, which is faster but may miss late content. Defaults to false.
- `expiration` (`integer`, optional): Minutes until the output URL expires and the file is deleted from PDF.co temporary storage. Defaults to 60; the maximum depends on your PDF.co plan. Example: 120.
- `footer` (`string`, optional): HTML printed at the bottom of every page, with the same classes as header. Example: <span style='font-size:10px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span></span>.
- `header` (`string`, optional): HTML printed at the top of every page. Classes date, title, url, pageNumber and totalPages are filled in, e.g. <span class='pageNumber'></span>. Leave room with margins.
- `margins` (`string`, optional): Page margins overriding the page CSS, as "top right bottom left" or one value for all sides, in px, mm, cm or in. Example: 40px 20px 40px 20px.
- `media_type` (`string`, optional): CSS media type used for rendering: print (default), screen or none. One of: `print`, `screen`, `none`.
- `name` (`string`, optional): File name for the generated output file. Example: page.pdf.
- `orientation` (`string`, optional): Page orientation. Defaults to Portrait. One of: `Portrait`, `Landscape`.
- `paper_size` (`string`, optional): Paper size: Letter, Legal, Tabloid, Ledger, A0 to A6, or a custom "width height" with px, mm, cm or in (e.g. 200mm 300mm). Defaults to A4.
- `print_background` (`boolean`, optional): Set false to leave out background colours and images. Defaults to true.
- `render_timeout` (`integer`, optional): Maximum time to wait for the page to finish rendering, in milliseconds, up to 177000. Useful for pages with heavy JavaScript. Example: 15000.

Example input: `{"url":"<url>"}`

## Related

Other Files & Documents connectors ([all 45](/agentkit/connectors/?category=files-documents)):

- [Google Drive](/agentkit/connectors/googledrive/): Scalekit connector, OAuth, 47 tools
- [Google Forms](/agentkit/connectors/googleforms/): Scalekit connector, OAuth, 10 tools
- [Microsoft 365](/agentkit/connectors/microsoft365/): Scalekit connector, OAuth, 317 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
