Type 4: PowerShell after processing
After saving an output file, BarcodeOCR starts a PowerShell script. The script receives an extensive data structure with information about the recognition process. Compared to Type 1, this interface offers more options and more information for further processing per output file.
You set up the interface in the Advanced step of the configuration, in the Launching a PowerShell script section with the option After each saved output document start the following PowerShell script. Before that, you need to prepare PowerShell.
A good starting point is the sample script External Application - Powershell write all parameters to file.ps1. It writes all passed information to a text file, see Sample scripts.
General
- BarcodeOCR calls the interface after saving an output file.
- The parameters are passed as a data object.
- BarcodeOCR waits until the script has finished and evaluates the returned values. If the values are not empty, BarcodeOCR uses them for saving.
- Renaming and duplicate handling defined in the user interface are applied anyway.
- There is no timeout while waiting for the script.
Parameters
The interface passes a data object. It can also contain arrays and long texts.
General parameters
| Parameter | Description | Sample values |
|---|---|---|
ConfigurationName | Name of the configuration | "Test" |
ConfigurationGuid | Unique identifier of the configuration | cbfc4771-7f73-481e-b1ca-e4b95eb3d605 |
ConfigurationFilePath | File path to the configuration file | "C:\ProgramData\Keil IT\BarcodeOCR\AnalyserConfig.xml" |
UsedBarcode | Recognized barcode used for splitting and renaming | Content of the barcode, empty for error files |
Result | Was the file saved in the output folder? | True = file saved in the output folder, False = file saved in the error folder |
ErrorReason | Reason why the document was placed in the error folder | NoBarcode, CorruptedFile, Unknown, Duplicate, NameError |
FileProcessStartTime | Time when processing of the file started | – |
SourceFilePath | Full path to the input file | C:\Config\dec24748\Tour\Sample.pdf |
BackupFilePath | Full path to the file in the backup folder (if active) | C:\Config\dec24748\Tour\Backup\Sample_eb3d605.pdf |
DestinationFilePath | Full path to the output file | C:\Config\dec24748\Tour\Error\No_Barcode_1.pdf |
Subfolder | Subfolder structure, if defined beforehand | Subfolder\Sub-Subfolder |
NumberOfPages | Number of pages in the document | 4 |
NumberOfRemovedPages | Number of pages removed by blank page detection | 0 |
StartPage | Page number of the first page in the original batch | 1 |
EndPage | Page number of the last page in the original batch | 4 |
Parameters per page
The following information is passed as an array, with one entry per page of the output document.
| Parameter | Description | Sample values |
|---|---|---|
Number | Page number | 4 |
RecognizedText | Recognized text on this page (if text recognition is enabled) | "Lorem ipsum ...." |
Barcodes | List of recognized barcodes on this page | Per barcode: type, text and X/Y coordinates |