Open yewanji opened 3 years ago
@yewanji I've had a similar problem I think. Recently I tried using a static instance of Scanner and that seemed to help:
private static Scanner scanner = Scanner.getDevice();
private static ScannerListener prevListener;
public TwainExample() throws ScannerIOException {
if ( prevListener != null ) scanner.removeListener( prevListener );
scanner.addListener( this );
prevListener = this;
scanner.acquire();
}
public class TwainExample implements ScannerListener {
//The error log is as follows uk.co.mmscomputing.device.twain.TwainIOException: uk.co.mmscomputing.device.twai n.TwainScanner.setException: jtwain: EXCEPTION 0xC00000FD thrown in twain source or source manager. This may have left the twain subsystem in an unstable state. Please restart application or web-browser. at uk.co.mmscomputing.device.twain.TwainScanner.signalException(TwainSca nner.java:131) at uk.co.mmscomputing.device.twain.jtwain.signalException(jtwain.java:28 7) at uk.co.mmscomputing.device.twain.jtwain.cbexecute(jtwain.java:243) at uk.co.mmscomputing.device.twain.jtwain.nstart(Native Method) at uk.co.mmscomputing.device.twain.jtwain.access$200(jtwain.java:12) at uk.co.mmscomputing.device.twain.jtwain$1.run(jtwain.java:338) uk.co.mmscomputing.device.twain.TwainException: jtwain: EXCEPTION 0xC00000FD thr own in twain source or source manager. This may have left the twain subsystem in an unstable state. Please restart application or web-browser. at uk.co.mmscomputing.device.twain.jtwain.ncallSourceManager(Native Meth od) at uk.co.mmscomputing.device.twain.jtwain.callSourceManager(jtwain.java: 104) at uk.co.mmscomputing.device.twain.TwainSourceManager.call(TwainSourceMa nager.java:24) at uk.co.mmscomputing.device.twain.TwainIdentity.open(TwainIdentity.java :70) at uk.co.mmscomputing.device.twain.TwainSource.open(TwainSource.java:99)
urceManager.java:93) at uk.co.mmscomputing.device.twain.jtwain.cbexecute(jtwain.java:234) at uk.co.mmscomputing.device.twain.jtwain.nstart(Native Method) at uk.co.mmscomputing.device.twain.jtwain.access$200(jtwain.java:12) at uk.co.mmscomputing.device.twain.jtwain$1.run(jtwain.java:338) //This question has puzzled me for a long time