Click or drag to resize

DocumentLoadImage Method

If a single page was loaded, this method returns a reference to the loaded Page object.

Namespace:  Kofax.OmniPageCSDK.IproPlus
Assembly:  Kofax.OmniPageCSDK.IproPlus (in Kofax.OmniPageCSDK.IproPlus.dll) Version: 1.0.0.0
Syntax
public void LoadImage(
	[OptionalAttribute] string FileName,
	[OptionalAttribute] int InsertPos,
	[OptionalAttribute] int IMAGEINDEX,
	out Page FirstPage
)

Parameters

FileName (Optional)
Type: SystemString
InsertPos (Optional)
Type: SystemInt32
IMAGEINDEX (Optional)
Type: SystemInt32
FirstPage
Type: Kofax.OmniPageCSDK.IproPlusPage
Remarks

A valid object is returned if either a single-page image file was loaded or the ImageIndex parameter was specified. If multiple pages were loaded, a reference to the first loaded page is still returned.

This method loads an image from an image file. The FileName is an optional string parameter. If it is specified, the specified image is loaded. If the file name is invalid, or the specified file is not a supported image file, a trappable error occurs. If the FileName parameter is unspecified, the Load Images dialog box is automatically displayed allowing the user to select one or more images from the file system.

The InsertPos is an optional numeric parameter. If it is specified, then it specifies the insertion position within the existing document for the newly loaded page(s). If it is unspecified, the loaded pages are appended after the last existing page.

If the optional ImageIndex Long parameter is specified, only the requested (zero based indexed) page is loaded from a multi-page image file. If it is unspecified, all contained pages are loaded.

If the source image is a grayscale image, this function may convert it to B/W based on document settings. If the source image is a color image, this function can convert it either to grayscale or B/W.

To learn more about the different conversion options, see the description of the Conversion property detailing the primary image conversion feature.

To apply an automatic, after-load preprocessing on the loaded and optionally converted images, pass a valid preprocess template file to the SetPreprocessTemplate method prior to calling the LoadImage method.

Calling this method sets the Modified property to True.

By default, this method automatically invokes image preprocessing when called according to the current settings. To turn out the running of image preprocessing algorithm, turn off the appropriate document level properties prior to calling this method.

For image preprocessing algorythms, see also the Deskew, DespeckleMode, Rotation, FaxCorrection, DownSample, ResEnhancement, and Inversion properties of the Document object. If (later on) you want these algorithms to be performed, update the properties as desired and call the ImagePreprocess method on the Document / Page objects.

See Also