Find documents in a file Version 4 (Python)
Action group: Text recognition
Description
The action searches the source file for different types of documents and saves them as separate files. If necessary, the orientation of the documents will be corrected.
Action icon
Parameters and their settings
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
File path | The path to the file from which you want to get individual documents. Supported formats: jpg, jpeg, bmp, png, pdf. | Robin.FilePath | Yes | |
API key | A unique identifier for accessing the service. | Robin.String | Yes | |
Cloud server | If the value is «true», the action will send a request to the DBrain cloud server. If «false», the action will send a request to the local DBrain server. | Robin.Boolean | true | No |
Folder path | The path to the folder where the images of the found documents will be saved. The images will be created with the *.png extension, and their names will contain the name of the type of the corresponding document. If the field is not filled in, the images will be saved to the source file folder. | Robin.FolderPath | C:\doc\img | No |
Overwrite | If «true», and there are images with the same name and extension in the specified folder, then the new image will overwrite it. If «false», the image will not be overwritten and the action will return an error. | Robin.Boolean | true | No |
Add the source file to the name | If «true», then the name of each image will contain the name of the source file and the name of the document type specified in the image. If «false», then the image names will contain only the names of document types. | Robin.Boolean | true | No |
Time out | The time in milliseconds during which data will be extracted from the document. The default value is 120000 ms. | Robin.Numeric | No | |
Results | ||||
Result | A collection of paths to document images that were found in the source file. If several documents of the same type are found, an index will be added to the names of their images. | Robin.Collection |
Special conditions of use
Connecting to Dbrain https://doc.dbrain.io/podklyuchenie/podklyuchenie-k-oblaku
The action works with specific types of documents: personal insurance policy number (SNILS), the first spread and registration in a passport.
Neural network recognizes only documents of Russia.
If a user submits documents other than the declared ones (personal insurance policy number, first spread and registration in a passport) for input, if the similarity percentage is <50, they will not be classified and recorded in the result table.
Example of how the "Add the source file to the name" parameter works: If true, the resulting file will be written as "Action Tests_NILS_1.png". If false, then "SNILS_1.png".
The robot will return an error if:
- the "File path" field contains an invalid input file format.
- there is already a file with the specified name on the specified path and the "overwrite" field = false.
- Timeout expired, no result is obtained.
- an invalid API key is specified.
Example of use
Task
Find documents in a file.
Solution
Use the "Find documents in a file" action.
Implementation
- Transfer the "Find documents in a file" action to the workspace.
- Set the parameters of the "Find documents in a file" action.
- Click on the "Start" button in the top panel.
Result
The program robot completed successfully. The documents have been saved to separate files.