Skip to main content

Type 4: PowerShell after processing

Enterprise edition and higher

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​

ParameterDescriptionSample values
ConfigurationNameName of the configuration"Test"
ConfigurationGuidUnique identifier of the configurationcbfc4771-7f73-481e-b1ca-e4b95eb3d605
ConfigurationFilePathFile path to the configuration file"C:\ProgramData\Keil IT\BarcodeOCR\AnalyserConfig.xml"
UsedBarcodeRecognized barcode used for splitting and renamingContent of the barcode, empty for error files
ResultWas the file saved in the output folder?True = file saved in the output folder, False = file saved in the error folder
ErrorReasonReason why the document was placed in the error folderNoBarcode, CorruptedFile, Unknown, Duplicate, NameError
FileProcessStartTimeTime when processing of the file started–
SourceFilePathFull path to the input fileC:\Config\dec24748\Tour\Sample.pdf
BackupFilePathFull path to the file in the backup folder (if active)C:\Config\dec24748\Tour\Backup\Sample_eb3d605.pdf
DestinationFilePathFull path to the output fileC:\Config\dec24748\Tour\Error\No_Barcode_1.pdf
SubfolderSubfolder structure, if defined beforehandSubfolder\Sub-Subfolder
NumberOfPagesNumber of pages in the document4
NumberOfRemovedPagesNumber of pages removed by blank page detection0
StartPagePage number of the first page in the original batch1
EndPagePage number of the last page in the original batch4

Parameters per page​

The following information is passed as an array, with one entry per page of the output document.

ParameterDescriptionSample values
NumberPage number4
RecognizedTextRecognized text on this page (if text recognition is enabled)"Lorem ipsum ...."
BarcodesList of recognized barcodes on this pagePer barcode: type, text and X/Y coordinates