saraff-9EB1047A4BEB4cef8506B29BA325BD5A / Saraff.Twain.NET

Saraff.Twain.NET is the skillful scanning component which allows you to control work of flatbed scanner, web and digital camera and any other TWAIN device from .NET environment. You can use this library in your programs written in any programming languages compatible with .NET technology.
GNU General Public License v3.0
102 stars 35 forks source link

Saraff.TwainX.NET For Twain 1.x #100

Closed EugeneQilo closed 1 year ago

EugeneQilo commented 1 year ago

Hello, Is there a reason why the library doesn't work with Twain 1.x for .NET Core??

When Saraff.Twain is used with an application built with .NET Framework, it works with both 1.x and 2.x. When same code is built with .NET 6, it only works with 2.x.. This is documented here, but the reason isn't clear to me?

Why the library can't be used with Twain 1.x?

saraff-9EB1047A4BEB4cef8506B29BA325BD5A commented 1 year ago

Hello, @EugeneQilo

About Saraff.TwainX.NET, it supports only the .NET Standard 2.0. Therefore it don't have reference to the winforms and cann't supports the twain 1.x.

Insted you can use the Saraff.Twain.NET 1.0.32.732, it supports .net 6.0 (for windows) and can uses the twain 1.x.

EugeneQilo commented 1 year ago

@saraff-9EB1047A4BEB4cef8506B29BA325BD5A thank you for the reply.. Your library is not working with one xray twain... The acquire is working with other applications like https://www.irfanview.com/ but not Saraff...

Like the DS is found, and acquire launches the UI... Then UI tries to find the hardware which fails... Not sure how such thing can be troubleshooted..

One thing I noticed is that when launched through Saraff, the DS generates logs in the same folder... When launched through Irfan app, it doesn't... Making me think that somehow the root directory being/not being set by the library... Is there such thing? Is there a flag to set root directly or something like that?

saraff-9EB1047A4BEB4cef8506B29BA325BD5A commented 1 year ago

Hello, @EugeneQilo See the Directory.SetCurrentDirectory(String) Method

It could also be that you are using the SaveFileDialog Class or OpenFileDialog Class and not setting the FileDialog.RestoreDirectory Property to true

EugeneQilo commented 1 year ago

@saraff-9EB1047A4BEB4cef8506B29BA325BD5A I'm not setting any of those... To make sure it wasn't anything from my application, I used the executables provided in your samples with elevated permission.. The issue was the same. How is it possible to troubleshoot such issues?

This is the TWAIN driver of concern... Go to here, search for "Apteryx Instrumentarium TWAIN 5.1.31 Installer"

saraff-9EB1047A4BEB4cef8506B29BA325BD5A commented 1 year ago

Hello, @EugeneQilo In this case, it makes sense to contact the developer of the twain driver with a question about what prevents it from working normally.

EugeneQilo commented 1 year ago

It won't be easy to get a hold of their developers (if they are still around), their front desk support staff provided another application that also uses twain, that one is working... Testing it with irfanview is also working...

saraff-9EB1047A4BEB4cef8506B29BA325BD5A commented 1 year ago

In any case, looking for third party issues is outside the scope of the support I provide. The Saraff.Twain.NET library is fully compliant with the TWAIN specification.

Also you can try use Alternative User Interfaces, Buffered Memory Mode Transfer or Disk File Mode Transfer if the issue related with UI of driver