Read barcode from PDF Version 9 (Python)
Action group: Vision
Description
The action looks for barcodes in the file and reads data from them.
Icon
Parameters
Input parameters
File Path - The path to the file where you want to find barcodes and extract data from them. Supported formats: jpg, jpeg, bmp, png, pdf
Page number - The page number of the file on which you want to search for barcodes
Barcode type - The type of barcode the action should find. If "Detect automatically" is selected, any barcode in the file will be found
Order - The sequence number of the found barcode from which the action should return data. If this field is not filled in, the action will return the data of all barcodes found. The numbering starts from 1
Output parameters
Result - A collection containing data that has been extracted from barcodes. One element of the collection is the value of one barcode.
Settings
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
File Path | The path to the file where you need to find barcodes and extract data from them. Supported formats: jpg, jpeg, bmp, png, pdf. | Robin.FilePath | Yes | |
Page number | The number of the file page on which to search for barcodes. If the field is not filled in, the barcode search will be performed on all pages. | Robin.Numeric | No | |
Barcode type | The type of barcode that the action should find. If «Detect automatically» is selected, any barcodes in the file will be found. Popup list:
| Robin.String | Yes | |
Order | The sequence number of the barcode found, from which the action should return data. If the field is not filled in, the action will return the data of all found barcodes. The numbering starts from 1. | Robin.Numeric | No | |
Results | ||||
Result | A collection containing data that has been extracted from barcodes. One element of the collection is the value of one barcode. | Robin.Collection |
Special conditions of use
- If there is a barcode in the file that is not specified in the action's algorithm, the action will ignore it. An unknown barcode will not be recognized, the action will return an empty collection.
- If the barcodes are rotated at any angle, they will be recognized.
- The robot will return an empty collection if no barcodes are found or an unknown barcode is in file.
- The barcode will not be recognized. The image has text, unnecessary information.
- The barcode will be recognized.
- Both barcodes will be recognized.
Example of use
Task
There is an image with a barcode, you need to read the barcode data.
Solution
Use the "Read barcode from PDF" action.
Implementation
- Move the "Read barcode from PDF" action to the workspace.
- Customize the parameters of the "Read barcode from PDF" action. Remember that the barcode will be read only if it belongs to the above barcode types from the dropdown list. In this case, it is type EAN13.
- Click on the "Start" button in the top panel.
Result
The program robot completed successfully. The barcode data has been recognized.
The result can be loaded into a collection by specifying a collection variable, or the result of this action can be input to another action that accepts the collection.
Thus, to display a result, you must either add an action that takes a collection as input, or specify a variable of type collection to be specified as a result of this action.