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)
Description of a bar code. | |
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). | |
Description of a recognized text section (OCR). | |
This class describes a scanned image. May be accessed as variable $CurrentImage from the template module (see Use of variables, in the Appendix). | |
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 $dateiSample-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 )