How to Convert PDF to CSV Using Automation Anywhere and PDF.co

Sep 2, 2024·6 Minutes Read

About Automation Anywhere

Automation Anywhere is a technology company headquartered in San Jose, California, USA. It is a provider of an end-to-end Robotic Process Automation (RPA) and Artificial Intelligence (AI) platform for automating any business process. They offer Discovery Bot for fast-track automation, IQ Bot for transforming unstructured and hidden data with AI that can learn on its own, Bot Insight for real-time analytics, and a Bot Store to get pre-built automation solutions.

We prepared this step by step tutorial with screenshots on how to make a Bot using PDF.co to convert PDF to CSV.

In this tutorial, we assume that you have already had a Community or Enterprise version of Automation anywhere with chrome extension as well as client agent already installed. We also assume that you have basic knowledge of how to create a simple bot and have it executed on your machine.

Useful Resources:

Step by Step Guide

This is a step-by-step tutorial on how to convert PDF to CSV using Automation Anywhere and PDF.co plugin.

PDF.co API Endpoint

PDF.co API Endpoint for converting PDF to CSV. We’ll have PDF.co method documentation handy either by Postman or online documentation at https://developer.pdf.co, so that we can configure API as per our need.

PDF.co API Endpoint

Bot Creation

In Automation Anywhere cloud Control Room, create a new boat for extracting CSV data from PDF. We’ll be using “Rest Web Service: Post Method” action to consume PDF.co “/pdf/convert/to/csv” API endpoint. We’ll also have the “Message Box” action attached to the output of the API call. The final bot structure will be as follows.

Bot Configuration

URI Configuration

Configure URI to “https://api.pdf.co/v1/pdf/convert/to/text” in “Rest Web Service: Post Method” action.

URI Configuration

Headers Configuration

Configure the Header key with the name “x-api-key” with the API key for PDF.co. This API key is essential for consuming pdf.co APIs. API key can be obtained at https://pdf.co.

Request Input Configuration

Configure input data to the REST web API call. Here, we’ve configured very basic JSON service request data as follows.

{"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-csv/sample.pdf", "name": "result.csv"}
Request Input Configuration

Configure REST API Output

Generate an output variable of type dictionary that will be holding the response of this API call.

Configure REST API Output

Configure Message Box

Drag and Drop the “Message box” action and attach it after the “REST Web Service: Post Method” action. Here, we’ll configure the “message to display” property with the “Body” property of the output variable.

Configure Message Box

Execute Bot and Review Output

With this configuration completed, we’re now ready to execute the bot and see the output message box. Before review the bot output message, let’s review the following input PDF used.

Execute Bot and Review Output

This is the final output message box of this bot.

Bot Message

If open the output URL, we’ll have CSV as following.

CSV Output

Additional Service Configurations

So far we’ve seen a basic version of PDF to CSV conversation. If we want to have a particular portion of PDF to be converted to CSV we can achieve this by configuring rect property of input request as following.

{"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-csv/sample.pdf", "name": "result.csv", "rect": "25.5, 302.3, 546.8, 151.5"}

By using Free PDF Multitool provided by ByteScout, we can get the selected region from the input PDF as follows.

Free PDF Multitool

And, this is how to output CSV looks like after we execute bot with the modified request.

Output CSV

Now, you’ve learned how to convert PDF to CSV using Automation Anywhere and PDF.co plugin.

Related Tutorials

See Related Tutorials