RPA Tools – Template Scenario 4: How to Add a Text to a PDF File Automatically - ByteScout

RPA Tools – Template Scenario 4: How to Add a Text to a PDF File Automatically

  • Home
  • /
  • Articles
  • /
  • RPA Tools – Template Scenario 4: How to Add a Text to a PDF File Automatically

If you need an application that can perform business automation tasks without human interaction required (aka “robot”), then we can offer you ByteScout RPA Tools. This powerful app builder does not require any programming skills and provides many pre-built templates. You can use these templates to create simple apps that can help you with tasks that are maybe too boring to do them manually.
This article takes less than 10 minutes to read and tells how to build a robot that can add a text to a PDF file.

Make Your Robots – Try RPA Tools

Scenario 4

4 Easy start: Add text to PDF file

We offer this robot to show you how you can add a text to a PDF document using RPA Tools.

How to create this robot

To create this robot, you need to open the RPA Tools application on your computer and press the “Add Robot” button.

 

 

Then you can press the “4 Easy start: Add text to PDF file” button in the “Select Template” dialog window.

 

 

You can see the “Robot Info” informational dialog window. Please press the “OK” button.

 

 

Now you have the robot created and displayed in the Designer.

 

Robot information

As you can see, many colorful blocks altogether formed the “4 Easy start: Add text to PDF file” robot. Let me tell you a bit more about these blocks.
First, there are some grey “print” and “text” blocks used to describe what the other blocks are going to do.

 

 

The reason why the commenting blocks are grey is we disabled them, which means that the robot is going to ignore them when it runs. Nevertheless, you can still read the text that the blocks contain, and this why we put them in.

Second, there is one big blue block named “File Writer: PDF Add String to File”. The block’s job is inserting a text to an existing PDF document. This block requires several parameters, and there are several things about them, which I would like to introduce.

 

 

The “IN Input file name” provides an input PDF file. Also, I need to mention that the input file we pass to the block stays unmodified. However, the block makes a copy of the file. It then inserts a text provided by the “IN String” parameter into the copy. While inserting the text, the block uses font size specified by “IN Font size”. The text appears at the page set by “IN Page numbers” and at “IN Position”. As a result, you can have an output PDF file defined by “OUT Output file name”.

We had to set all these parameters to allow the “File Writer: PDF Add String to File” block to do its job. To do so, we connected the six blocks you can see in the next picture.

 

 

By the way, you can notice that we used {myDocs} inside of the “text” blocks providing file names. {myDocs} is a macro for the “C:\Users\UserName\Documents” path.
(You can find descriptions for all available macros in a dialog window if you press the “Macros” button in the ByteScout RPA Tools Robot Designer.)

To summarize, the “File Writer: PDF Add String to File” block is doing most of this robot’s work, and we provide all the information the block needs to make the job done.

Third, some service blocks are going to show you the results produces by this robot.

 

 

We used two blue “Special: Open Folder (Selected File)” blocks. They open Windows Explorer so you can see the “Input” and the “Output” folders.

How to run this robot

Now, as you have this robot created and displayed in the Designer, you can save it and close the Designer window using the “Save and Close” button.
After saving, you can see the robot name in the “Robots” list of the RPA Tools application.

 

 

To run the robot, please press the “Run” button.

Results

If you open the input PDF file you can see our sample PDF.

 

 

Then, if you open the output PDF file, you can see that the robot added a line to the first page of the document.

 

 

Tutorials:

prev
next