Discarding Blank Pages
Many times, it is desirable to not acquire a page if it is determined to be blank. This saves disk space when creating image files from the acquisition, as blank pages are not saved.
If your TWAIN driver supports discarding blank pages. ..: There are a few TWAIN devices that automatically have the capability to discard blank pages. Usually, this feature is provided for by setting a custom capability within the TWAIN Source if the application is acquiring images without the device's user interface shown. If the user interface is shown, these drivers usually provide an option to turn on the automatic discarding of blank pages. Since setting a custom capability is dependent on the Source, the DTWAIN_SetCapValues function will set whatever capability your TWAIN driver has provided that turns on the feature of automatically discarding pages.
The TWAIN specification is unclear on whether this capability should exist as a regular capability instead of a custom capability. Prior to version 1.9 of the TWAIN specification, there used to be a capability that could be turned on that would discard blank pages (if the TWAIN driver supported this capability). However, the latest version of the TWAIN specification has deprecated this capability, but some TWAIN drivers may still support it. The capability is DTWAIN_CV_ICAPAUTODISCARDBLANKPAGES. Therefore the following may work if the TWAIN device supports this capability ('C' code).
DTWAIN_SOURCE Source;
Source = DTWAIN_SelectSource( );
if ( Source != 0 && DTWAIN_IsCapSupported( Source, DTWAIN_CV_ICAPAUTODISCARDBLANKPAGES ) ) { DTWAIN_ARRAY array = DTWAIN_ArrayCreateFromCap( SOURCE, DTWAIN_CV_ICAPAUTODISCARDBLANKPAGES, 1 ); DTWAIN_ArraySetAtLong( array, 0, 1 ); /* turn on blank page processing */ DTWAIN_SetCapValues( Source, DTWAIN_CV_ICAPAUTODISCARDBLANKPAGES, DTWAIN_CAPSET, array ); DTWAIN_ArrayDestroy( array ); }
Also, your TWAIN driver still may have a custom capability that sets the automatic discarding of blank pages. You will need to consult with the manufacturer of your TWAIN driver to see if the driver has the capability to discard blank pages, as well as the capability value to use when calling DTWAIN_SetCapValues.
If your TWAIN driver does not support discarding of blank pages
|