This project has moved. For the latest updates, please go here.

Duplex Scanner with Magnetic Stripe Read Capability

Oct 23, 2014 at 6:47 PM
To all Saraff Twain Staff, thanks for the nice job. It really works nicely.

I am using a duplex ID card scanner with magnetic stripe read capability. Is it possible to read the magnetic stripe using Saraff.Twain library?

Thanks Again.
Coordinator
Oct 23, 2014 at 8:53 PM
Hello, jggino.
thanks for your opinion.
Try follow code:
private void _twain32_XferDone(object sender,Twain32.XferDoneEventArgs e) {
    // ...
    var _extImageInfo=e.GetExtImageInfo(new TwEI[] { TwEI.MagType,TwEI.MagDataLength,TwEI.MagData });
    foreach(var _item in _extImageInfo) {
        if(_item.IsSuccess) {
            switch(_item.InfoId) {
                case TwEI.MagType:
                    var _magType=(TwMD)_item.Value;
                    // ...
                    break;
                case TwEI.MagDataLength:
                    var _dataLength=(uint)_item.Value;
                    // ...
                    break;
                case TwEI.MagData:
                    var _data=(string)_item.Value;
                    break;
            }
        }
    }
    // ...
}
// ...
internal enum TwMD:ushort {
    Micr=0,
    Raw=1,
    Invalid=2
}
Marked as answer by jggino on 10/23/2014 at 4:19 PM
Oct 24, 2014 at 12:18 AM
I am amazed! Your response time to my query is very admirable. The code works perfectly.

Your library has really help me a lot!

THANKS GUYS.