The PDF reading with the OCR (Optical Character Recognition) activity is used to extract the information from PDF documents that have both text and pictures. When the user has some images without any text in the form or document, then OCR activity extracts the data from the pictures or images and provides the text output as a result.
PDF is the most reliable format for storing any information or data. Every enterprise wants to store the data in several kinds of forms for the growth of their business.
The PDF data extraction is categorized into two parts that are given below:
- Extraction of large text in UiPath Studio
- Extract the particular elements or components
The UiPath tool supports the data extraction by the various PDF’s, whether in native text format or scanned pictures. The syntax of reading PDF with OCR (Optical Character Recognition) is given below:
This syntax reads entire characters from the identified PDF file and stores that file in the string variable with the help of OCR technology.
Suppose a user wants to extract any raw info from various PDF documents, then he will not do this task manually because the data extraction task via PDF is very boring, but when the user is familiar with the automation services, then it becomes very easy to extract the info.
Before starting data extraction, the user must install the UiPath.PDF.Activities on the system with the help of the Manage Package Section in UiPath Studio. After the selection of the package, we need to click on the save option, and then the installation of the package will start automatically.
Large text extraction in UiPath Studio
The Extraction of large text is related to those types of documents where the document can hold only text or both text and images. There are two options in the UiPath Studio to extract the large text, and those methods are given below:
- Read the PDF with the text activity
- Read the PDF with OCR (Optical Character Recognition) activity
Apart from these two methods, we also have another method to extract the large text, which is a screen scraping wizard.
Read the PDF with text activity
This activity allows us to read the data or information from the PDF file, which contains text only. If there is any picture that exists in that PDF, then this activity would not be the correct activity to be selected.
Read the PDF with OCR activity in UiPath Studio
Read the PDF with OCR activity of the UiPath tool allows the user to fetch the data or info with the help of PDF documents that have both format text and pictures. If the user has any pictures with text in that pdf document, then, this activity fetches the info from those pictures and provide the text in the form of output as a result.
Read PDF with OCR activity of UiPath uses Optical Character Recognition (OCR) for scanning the pictures within the PDF documents; that’s why the OCR engine is required for the scanning procedure. When the user searches the OCR engine in the Activities Panel then, the user will get the entire list of the installed engines. There are some important pointers in the read PDF with OCR activity, and those key pointers are given below:
- The user has the parameter in the properties panel of Reading Text activity and Read PDF with OCR activity within the UiPath Studio. This parameter enables us to mention the range of the page number, so it is known as the range. The data or information is extracted with the help of those page numbers.
- The Read text activity and Read PDF with OCR activity both are self-contained because both activities do not require other applications to open themselves. These kinds of activities execute any task in every condition, even if the PDF documents are not opened on the screen of the desktop.
Apart from the Read text activity and Read PDF with OCR activity, there is another way to extract the data by using a screen scraping wizard, which is found in the Design tab.
Screen Scraping wizards
The screen scraping wizard is the feature of the UiPath tool, which is used to scrap the data or information with the help of several platforms. Screen scrapper wizards can extract both kinds of data, whether it is text or image.
The screen scraping is mainly used to fetch the data or information from the Identified UI element or component or document like the .pdf file.
Extraction of the Particular element or component
The Extraction of specific elements or components means that there are some instances where the user wants to extract a particular element or component, such as the total no. of invoices or contact numbers from the resume. There are two methods in UiPath Studio that provide the Extraction of a particular element, and those methods are given below:
- Get the text activity in UiPath Studio
- Anchor the base activity
Get Text Activity
The Get Text Activity is used to give the points for those elements or components which the user wants to be extracted. There is an output variable which is used to extract the text with the help of this activity. The syntax of getting Text Activity is given below:
This activity mainly gets the text from the entire terminal screen and store that text in the string variable.
Anchor base activity
The Anchor base activity allows the user to extract the text and images in the UiPath Studio. There are two types of activity which are performed under the Anchor Base Activity, are given below:
- Find Element / Find Image Activity of UiPath
- Get Text Activity in the UiPath Studio
Find the element or component / Find the image activity in UiPath Studio
Find element activity or find picture activity of UiPath Studio allows the user to find any element text and picture. We can use this activity as per the requirement. Anchor base activity is called as the relative activity in UiPath Studio. We can use Anchor Bass Activity with the Find Image Activity and Get Text Activity.