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
Question to solve exception "Capability is not supported"
Moderator: Alex
Re: Question to solve exception "Capability is not supported
Hello Michael,
You need check supported page sizes using the Device.GetSupportedPageSizes method before setting value of the PageSize property.
Best regards, Alexander
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
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.
And after this try/catch-block, I set my properties or don't set the pageSize-property.
Best regards, Michael
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;
}
.....
.....
...
Best regards, Michael