CROSSCAP Enterprise System Manual
Powershell Classes
CROSSCAP Enterprise Manual > Appendix > Powershell Classes

Classes

These are the additional powershell classes contributed by CROSSCAP Enterprise.

(click any of the class names for a detailed description of respective variables and properties)

PowerShellBarcodeDescription

Description of a bar code.

PowerShellDocument

The main document describing the entire batch.

May be accessed as variable $Document from the export module (see Powershell-Export in section Export in chapter Templates) or from the template module (see Use of variables, in the Appendix).

PowerShellOcrTextDescription

Description of a recognized text section (OCR).

PowerShellPageNode

This class describes a scanned image.  May be accessed as variable $CurrentImage from the template module (see Use of variables, in the Appendix).

PowerShellPageNodeSignatur

This class describes an exported image file.

Code-Samples

Sample-script for use with the Powershell-Export function/ Export module:

The following example employs the PowerShellDocument class and makes use of variable $Document and its property BatchName:

# The name of the text file
$datei = "c:\temp\test.txt"
# Create a the text file with content 'Hello world!'
"Hello world!" | set-content $datei
# Append 'End' to the text file
"End" | Add-content $datei
# Append the batch name at the end
$Document.BatchName | Add-content $datei

Sample-ccript for use with the Powershell-variable / Template module:

The following example employs the PowerShellPageNode class and makes use of variable $CurrentImage and its properties PreEndorserString and IsDuplex:

# Example: The pre endorsed string is 20140512111109 and the last 5 digits represent a counter
# Extract the 5 digit counter from the pre endorsed string 
$counter = [int]$CurrentImage.PreEndorserString.Substring(10, 5)
# Add 1 to the counter
$counter++
# When scanned image is duplex, then add additional 1
if($CurrentImage.IsDuplex)
{
  $counter++
}
# Format string to original format with 5 digit counter
return ( $CurrentImage.PreEndorserString.Substring(0, 10) + "{0:D5}" -f $counter )