Skip to main content

Type 5: PowerShell before processing

Enterprise edition and higher

As soon as BarcodeOCR detects a new file in the input folder, but before it processes the file, it starts a PowerShell script. Use it to skip certain files, to run general preprocessing or to assign the file to a different configuration.

You set up the interface in the Advanced step of the configuration. Before that, you need to prepare PowerShell.

General​

  • BarcodeOCR runs the interface after it has detected a new file in the input folder, but before it processes the 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 further processing.
  • There is no timeout while waiting for the script.

Parameters​

The interface passes a data object. It can also contain arrays and long texts.

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"
SourceFilePathFull path to the input fileC:\Config\dec24748\Tour\Sample.pdf

Return values​

  • The interface can return two values to BarcodeOCR, which BarcodeOCR takes into account in further processing.
  • The sample script simplifies this step. It offers two corresponding variables that you only need to set.
  • If the script returns empty variables, the values are not overwritten.
  • BarcodeOCR logs the values returned by the script in the process log.
  • If the script throws an error, BarcodeOCR ignores the output of the script and processes the file according to the settings of the configuration.
Return valueDescriptionSample values
OVERWRITE_CONFIGOptional. Expects the name of a configuration as defined in the first step, General. The name is not case-sensitive. If set and valid, BarcodeOCR processes the file with the settings of this configuration.Test, <empty string>
DO_NOT_PROCESSIf set to true, BarcodeOCR aborts processing of the file. The file remains in the input folder.true, false