How to Fill a PDF Form Using Automation Anywhere and PDF.co
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.
This tutorial shows how to create an Automation Anywhere Task Bot that sends form data to PDF.co and returns a filled PDF. The bot uses the PDF.co PDF Add API through Automation Anywhere’s REST Web Services action.
Prerequisites
- An Automation Anywhere Community Edition or Enterprise account
- A PDF.co account and API key
- A fillable PDF available through a publicly accessible URL
- The Automation Anywhere Bot Agent installed on the device that will run the bot
Access the Control Room
Register for Automation Anywhere and follow the activation instructions sent to your email.
Use the supplied Control Room URL to set your password and sign in.
Install the Bot Agent
The Bot Agent connects your local device to the Automation Anywhere Control Room and is required to run the bot.
From the Control Room:
- Select the option to connect a local device.
- Download and install the Bot Agent.
- Enable the requested browser extension.
- Complete the device registration process.
See the Automation Anywhere Bot Agent documentation for installation requirements.
Create a Task Bot
In the Control Room:
- Open Automation.
- Click Create.
- Select Task Bot.
- Enter a name such as
PDF.co Fill Form. - Create the bot.
A Task Bot provides the step-by-step action editor needed for this workflow.
Add the REST Web Services Action
In the bot’s Flow view:
- Click Quick add between Start and End.
- Search for REST Web Services.
- Select Post method.
Configure the Request
Enter the following URI:
https://api.pdf.co/v1/pdf/edit/add
Leave the Authentication setting as No Authentication. The PDF.co API key will be supplied through a custom request header.
Set the content type to:
JSON (application/json)
Add the API Key Header
Under Custom headers, add a header with these values:
- Name:
x-api-key - Value type:
Insecure string - Value: Your PDF.co API key
The value field may initially use Credential mode. Change it to Insecure string before entering the API key directly.
Add the Request Body
Under Custom parameters, enter the following JSON:
{
"name": "f1040-form-filled",
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-form/f1040.pdf",
"fieldsString": "1;topmostSubform[0].Page1[0].f1_02[0];John A. Doe|1;topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1];true|1;topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_04[0];123456789"
}The fieldsString property uses this structure:
page;fieldName;value
Separate multiple fields with a pipe character:
page;fieldName;value|page;fieldName;value
Page numbering starts at 0. The sample uses page 1 because the PDF contains a cover page before the form.
Replace the sample field names and values when using your own PDF template. You can use the PDF.co PDF Inspector to inspect the template and identify its form field names.
Capture the API Response
Under Assign the output to a variable:
- Select Multiple variables.
- Click Add variable mapping.
- Enter
Bodyas the key. - Create a new String variable named
Body. - Map the response body to that variable.
The variable will contain the JSON response returned by PDF.co.
Display the Response
Add a Message Box action after the REST Web Services action.
In the message field, enter:
$Body$
This displays the complete PDF.co response when the bot finishes.
Save and Run the Bot
Save the Task Bot and click Run. Select the registered device if prompted.
After a successful request, the message box displays a JSON response containing the URL of the filled PDF. Open that URL to review the result.
PDF.co output URLs are temporary. Download the file or send it to permanent storage if it must be retained.
Conclusion
You have created an Automation Anywhere Task Bot that sends form values to the PDF.co PDF Add API, fills the corresponding fields, and returns a downloadable PDF.
Related Tutorials

