Question to solve exception "Capability is not supported"

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

Moderator: Alex

Post Reply
mierli
Posts: 6
Joined: Tue Aug 13, 2013 8:09 am

Question to solve exception "Capability is not supported"

Post by mierli » Mon Aug 26, 2013 7:13 pm

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

Alex
Site Admin
Posts: 1464
Joined: Thu Jul 10, 2008 2:21 pm

Re: Question to solve exception "Capability is not supported

Post by Alex » Wed Aug 28, 2013 9:33 am

Hello Michael,

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

Best regards, Alexander

mierli
Posts: 6
Joined: Tue Aug 13, 2013 8:09 am

Re: Question to solve exception "Capability is not supported

Post by mierli » Wed Aug 28, 2013 11:30 am

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.

Code: Select all

   ....
   .....
               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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest