Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt

Use this file to discover all available pages before exploring further.

When you write scripts in .NET languages, a few things differ from VBScript and JScript.

Accessing objects

Use the Workspace and ExportBatch keywords to access Scanning Station object elements.

Framework and assemblies

  • Compile .NET assemblies using .NET Framework 4.0 or later. Set the target framework in your Visual Studio project properties.
  • You can add external assemblies — standard or user-compiled — and every class inside becomes available in scripts and global modules. See External assemblies.
  • Scanning Station objects don’t support multithreading.

Debugging

  • Use the System.Diagnostics.Debugger.Break method to break into the debugger.
  • Debugging also requires a .pdb file with debug information. These files can be very large — we recommend keeping them outside the project. Make sure the script is compiled with the debugging information included. In Microsoft Visual Studio, you can attach to the process where the .NET code runs.

using directives

You can put using-style directives at the top of a script, alongside comments and blank lines. The syntax matches the language:
  • C#.Net: using
  • JScript.Net: Import
  • VisualBasic.Net: Imports
For example, in C#.Net:
using System.Drawing;
Image img = Image.FromFile(@"D:\2.png");
A using directive only works if it appears before the first line of executable code. For example:
using System.IO;
File.Create(@"C:\sample.txt");

Functions and optional parameters

  • Functions from global modules are called directly in .NET scripts — you don’t need to prefix them with the global module name.
  • To skip an optional parameter, pass System.Type.Missing instead.