VintaSoft Twain .NET SDK Discussions

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Board index < VintaSoft Twain < VintaSoft Twain .NET SDK Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Question to solve exception "Capability is not supported"



Question to solve exception "Capability is not supported"

Post by mierli »

Hello
I have a problem to work with the property "device.PageSize".
For one scanner the property works fine, and I can set the PageSize to "PageSize.A4" - the scanner is the Canon Lide 500f.

On an other scanner I get an exception during the runtime or debug - "Capability is not supported - Name= ISupportedSizes".
This is a HP Office-Jet Pro 8500.

How I could check this property whether the the "PageSize" is valid for one scanner or not valid for other scanners; so I could solved this problem - but I don't know, how I could check for valid/or not valid.

Please have you a clue for my problem?
Many thanks in advance & best regards
Michael


Re: Question to solve exception "Capability is not supported

Post by Alex »

Hello Michael,

You need check supported page sizes using the Device.GetSupportedPageSizes method before setting value of the PageSize property.

Best regards, Alexander


Re: Question to solve exception "Capability is not supported

Post by mierli »

Hello Alex
thanks for your reply.

If I call this method "Device.GetSupportedPageSize()", I get also an exception. So now I add a workaround to check in a try/catch-block with the "GetSupportedPageSize()"-method the pageSize-property.
   ....
   .....
               bool pageSizeIsSupported = true;
                try
                {
                    var x = _device.GetSupportedPageSizes();
                }
                catch (TwainDeviceCapabilityException)
                {
                    pageSizeIsSupported = false;
                }
   .....
   .....
   ...
And after this try/catch-block, I set my properties or don't set the pageSize-property.

Best regards, Michael


Page 1 from 1: 1