This project has moved. For the latest updates, please go here.


May 8, 2014 at 9:21 AM
Hi Saraff,

need your help again, I add one more definition in TwCap: ICAP_AUTODISCARDBLANKPAGES=0x1134 ,

Setting code as below:

if ((twain321.IsCapSupported(TwCap.ICAP_AUTODISCARDBLANKPAGES) & TwQC.Set) != 0)
         twain321.SetCap(TwCap.ICAP_AUTODISCARDBLANKPAGES, -1);
But I will get error, would like to know what's wrong? thx.
May 8, 2014 at 6:48 PM
Hello, xgc521.
What error (Message, ConditionCode, ReturnCode and StackTrace)?
Feb 17, 2015 at 6:34 AM
Edited Feb 17, 2015 at 6:57 AM
I am getting the same problem.

I am able to set -1 to skip blank pages. But it is not skipping. Did I need to check other things?

Feb 17, 2015 at 8:01 AM
Hello, amurtaza.
See TWAIN Specification



Use this capability to have the Source discard blank images. The Application never sees these
images during the scanning session.
  • TWBP_DISABLE – this must be the default state for the Source. It indicates that all images will be
    delivered to the Application, none of them will be discarded.
  • TWBP_AUTO – if this is used, then the Source will decide if an image is blank or not and discard as
  • If the specified value is a positive number in the range 0 to 2^31–1, then this capability will use it as
    the byte size cutoff point to identify which images are to be discarded. If the size of the image is
    less than or equal to this value, then it will be discarded. If the size of the image is greater than
    this value, then it will be kept so that it can be transferred to the Application.


  • Type: TW_INT32
  • Default Value: TW_DISABLE
  • Allowed Values:
    • Byte count 0 to 2^31-1

TWAIN Version Introduced

Version 2.0

The example

if((this._twain32.IsCapSupported(TwCap.AutoDiscardBlankPages)&TwQC.Set)!=0) {
    /* OR */
// ...
internal enum TwBP:int {
    Disable=-2, // TWBP_DISABLE
    Auto=-1  // TWBP_AUTO
Marked as answer by SARAFF on 5/10/2015 at 12:12 AM
Feb 17, 2015 at 8:22 AM
I tried the same thing.

It is not working, did there any property i need to check. I am using Fujistu fi-6130z which can support this.

Even when I'm setting bytes 1234, it is giving me BAD VALUE error.

can you help me more.

Feb 17, 2015 at 10:31 AM
Edited Feb 17, 2015 at 10:39 AM
Check a Twain32.IsTwain2Supported value. What value of Twain32.IsCapSupported(TwCap.AutoDiscardBlankPages) ?
Also try use ICAP_AUTOSIZE.
Feb 17, 2015 at 11:10 AM
IsTwain2Supported is giving me false

as well ICAP_AUTOSIZE is also giving me Unsupported

How to update to twin2?
Feb 17, 2015 at 12:38 PM
See this and this and this.
Feb 24, 2015 at 6:04 AM
Thanks for your links.

After going through all link, I came to know that what exactly issue I have.

I tried to use the twain 2 which is unable to use as twain is giving some error due to hardware/ data source when i copied the twaindsm.dll file.
The solution is working fine if i set black dot ratio in Driver itself. I want to do the same through code. Can you tell me any capability, I didn't find so far.

Feb 24, 2015 at 12:16 PM
Hello, amurtaza.
If I understand the question, the following capabilities can help:
  • ICAP_FILTER - Describes the color characteristic of the subtractive filter applied to the image data
  • ICAP_GAMMA - Gamma correction value for the image data
  • ICAP_BRIGHTNESS - The brightness values available within the Source
  • ICAP_AUTOBRIGHT - TRUE enables and FALSE disables the Source’s Auto-brightness function (if any)
  • ICAP_CONTRAST - The contrast values available within the Source
  • ICAP_HIGHLIGHT - Specifies which value in an image should be interpreted as the lightest “highlight.”
  • ICAP_SHADOW - Specifies which value in an image should be interpreted as the darkest “shadow.”
Feb 24, 2015 at 3:56 PM
I checked with above properties, these are not working as all related to image it self.

But if i do the setting in job/ cache of twin driver 32 for [Black Dots Ratio] slider bar, it is working fine. May be there is any other capability if you know let me know.

AT page 36 it is explain.

Thanks in Advance.
Feb 24, 2015 at 9:18 PM
Try to get a list of all supported capabilities:
System.Diagnostics.Debug.WriteLine("SUPPORTED CAPS:");
foreach(TwCap _cap in this._twain32.GetCap(TwCap.SupportedCaps) as object[]) {
    System.Diagnostics.Debug.WriteLine(string.Format("{0}: {1}",_cap,this._twain32.IsCapSupported(_cap)));