RotateImageExOCR_S
Rotates an image.
Member of namespace
OCR_SRSyntax
bool RotateImageExOCR_S (string ImagePath, string RotationMode)
Parameters
- ImagePath
Path to the image file to rotate. If left blank, the current page image file is used by default. Smart parameters are supported.
- RotationMode
- The type of rotation to apply to the image. Here are the valid values:
0 Auto 1 No rotation 2 90-degree rotation, clockwise 3 180-degree rotation, clockwise 4 90-degree rotation, counter-clockwise If left blank, Auto is used by default.
Returns
False if any of the following conditions apply:- The ruleset with this action is not bound to a page object of the document hierarchy
- The action cannot locate the image file that you specified in the first parameter
- The rotation mode that you specified is not within the valid range of values
Otherwise, this action returns True.
Level
Page level.Details
This action performs rotation of the specified image, using the specified rotation mode. When the RotationMode is not specified, the automatic image rotation algorithm is used. Note that this algorithm relies on, and works best with, images with good quality machine printed text. If an image contains text with various orientations, for example vertical and horizontal, the image might be rotated undesirably.
The automatic rotation algorithm does not fully work with images containing 9-pin dot-matrix text or other non-machine printed text. After the action runs and the image is rotated, the rotation applied to the image is saved in a page level variable called OCRSRotMod. It is recommended that this action be called in a separate ruleset and profile before recognition due to instances where the engine does not release the image until the ruleset has completed.
Automatic retry is supported if the operation timeout is reached. Automatic rotation and deskew can be performed automatically at the same time as recognition, if the feature is enabled. If automatic rotation is enabled during recognition, then it is not necessary to call this action prior to recognition unless the application requires the rotation to be fixed prior to recognition for some other application specific reason. For more information about enabling automatic rotation, see OCR_SR actions.
- Example:
In the following example, the first instance of this action rotates the current page image file automatically and saves the applied rotation mode in the variable OCRSRotMod. The second instance applies a 90-degree rotation to the current image.
RotateImageEx("","") RotateImageEx("", "2")