New: PDF/A-3b conversion with a compliance report included.See Docs

Split a PDF Using Automation Anywhere and PDF.co

Create a Task Bot that splits a PDF into separate files using page ranges and displays their download links. This workflow calls PDF.co directly through Automation Anywhere’s REST Web Services action.

Prerequisites

  • An Automation Anywhere account.
  • A PDF.co account and API key from the PDF.co dashboard.
  • A multipage PDF available through a direct download URL.

Step 1: Sign In and Set Up the Bot Agent

Sign in to your Automation Anywhere Control Room. If you have a new Community Edition account, follow the activation instructions sent by email.

Install the Bot Agent when prompted. Complete the setup to enable the browser extension, connect your computer, and register your device.

Step 2: Create a Task Bot

Go to Automation → Create → Task Bot and name it Split PDF.

In the Flow view, use Quick add between Start and End. Search for REST Web Services and select Post method.

Step 3: Configure the API Request

Enter this URI:

https://api.pdf.co/v1/pdf/split

Set Authentication Mode to No Authentication. PDF.co authenticates through a custom header.

Under Custom headers, add:

  • Name: x-api-key
  • Value: Your PDF.co API key.

For this demo, select Insecure string to enter the key directly. For shared or production bots, use a stored credential from Automation Anywhere’s Credential Vault.

Set Content type to JSON (application/json).

Step 4: Enter the Split Settings

Under Custom parameters → Enter the parameters, paste:

{
  "url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf",
  "pages": "1-2,3-",
  "name": "split-document.pdf",
  "inline": true,
  "async": false
}

The pages value creates two PDFs:

  • One containing pages 1–2.
  • Another containing page 3 through the end.

Replace url with your own accessible PDF URL when needed. The document must contain at least three pages for this example.

Page numbering starts at 1. Adjust the ranges to match your document. See the Split PDF documentation for supported parameters.

Step 5: Capture the Response

Under Assign the output to a variable:

  1. Select Multiple variables.
  2. Click Add variable mapping.
  3. Set Key to Body.
  4. Create a String variable named Body and map it to this key.
  5. Save the mapping.

Step 6: Add a Message Box

Add a Message Box action after the REST Web Services action.

Enter the following as the message:

$Body$

This displays the API response so you can inspect the result.

Step 7: Run and Review the Split PDFs

Save the bot and click Run. Complete any remaining device-connection prompts.

On success, the response contains "error": false and a urls array with the generated PDF links. Open each link and confirm that the output contains the expected pages.

Download the files before their temporary links expire.

This demo uses synchronous processing for a small PDF. Larger documents may require asynchronous processing and a job-status check before retrieving the results.

Related Tutorials

See Related Tutorials