Acquiring portait or landscape images
To acquire either a portrait or landscape image, there are a variety of options. Each options depend on whether your TWAIN device supports orientation and/or rotation.
The first option is to allow the TWAIN device to automatically rotate the document to the correct orientation. To do this, the --autorotate option can be used, however the device must support auto rotation for this command to have any effect. Many high-end scanners do support auto rotation, but most scanners do not. Therefore this option may not be available. See below as to how to check if your device supports auto rotation.
If your device does not support auto rotation, to acquire an image that is oriented to either landscape or portrait, the --orientation command can be used. To rotate an image, the --rotation command can be used.
Please note that orientation and rotation settings are completely different and separate from each other. This is an important fact, due to how the TWAIN specification defines these actions. TwainSave makes sure that these options are separate, thus the separate command options.
What to choose? Is it orientation, or is it rotation?
There are TWAIN devices that support only orientation, while others may support only rotation, and others may support both options, while others may not support any rotation nor orientation. There are devices that support auto rotation, and any combination of orientation and rotation options.
Why two separate options?
Wouldn't it be easier for TwainSave to figure out which option (--orientation or --rotation) to use if the command only stated, for example, orientation 90? TwainSave works this way since it is highly possible for a device to support both orientation and rotation, and if this is the case, perfectly legal to have both specified on the command line. If a device does support both orientation and rotation, the orientation setting is always done first, with the resulting rotation done afterwards. This is the required behavior for any TWAIN device that supports both orientation and rotation.
So how do we know what is supported?
The quickest way to know for sure what the device supports is to generate a --details log. The log will be in JSON format, so can easily be viewed with any JSON viewer. Look for the following entries listed under the desired scanner's properties:
For orientation: "orientation-values"
For rotation: "rotation-values"
For auto rotation: "capability-values" and under this section, search for a name key with the value "ICAP_AUTOMATICROTATE".
The "orientation-values will list the available orientation options. The "rotation-values" will state whether rotation is or is not supported. The ICAP_AUTOMATICROTATE showing up in the list of capabilities determines that auto rotation is supported.
So for example, if auto rotation is not supported, and the only orientation supported is 0 (meaning Portrait), but rotation is supported, to orient a page landscape, you would specify--rotation 90 on the TwainSave command-line, and not --orientation 90. If on the other hand, --orientation 90 is supported, then you would choose this option to produce a landscape image.
|