Introducing TWAIN Direct

July 1, 2015 "Spike" McLarty

Scanning is about to change

If you are involved with the technology of scanning documents, you should check out a new standard emerging from the TWAIN Working Group, called TWAIN Direct.

This goes double for developers who work on scanning applications or SDKs (like Atalasoft's DotImage), and maybe triple for engineers who work on scanner firmware & software.

Full disclosure: Atalasoft is a member of the TWAIN Working Group. I'm our current representative to the WG, and have been actively involved in the standards work discussed here.

For many years, the TWAIN API has served as a binary bridge between applications and scanner drivers - competing in that role with other APIs like SANE, EMC's ISIS, Microsoft's WIA, and Apple's... things.  I've personally written a lot of code against TWAIN, and my customers have scanned a lot of paper (and other weird things, like human feet and Space Shuttle windows).  However, TWAIN is starting to look, as me sainted mother would say, a bit long in the tooth.  For example:

  • The TWAIN API has a huge number of features, nearly all of them optional. Tricky to learn, tricky to use.
  • TWAIN is only available to desktop applications, and in truth it's largely confined to x86 and x64 Windows.
  • To use it with a scanner, a device-specific driver has to be installed.
  • Those drivers are damn hard to write! And debug, and maintain.

The TWAIN Working Group is well aware of the limitations of the TWAIN API, and they've been quietly working away on a new scanning protocol called TWAIN Direct. It's gone well, things are coming together, press releases are being released, announcements are announcing, and I can jump on my blog-box and shout "Look! Look!".

Some of the key points to understand about TWAIN Direct are:

  • It's radically simpler to understand and use than its predecessor the TWAIN API.
  • It's a network protocol, initially defined over HTTP/HTTPS.
  • No drivers.  (NO! DRIVERS!    Yes, I'm particularly thrilled about that part.)
  • Network protocol + no drivers = platform agnostic. ARM, x86, x64, desktop, tablet, smartphone, embedded, current, future, whatever.

"Hmm," you ask, "what format is used to transport images from the scanner to the scanning application?"

I'm glad you asked that! TWAIN Direct uses a format called PDF/raster, which is a strict subset of PDF optimized for (wait for it...) transporting raster images from scanners to scanning applications.  I'll talk about PDF/raster in my next blog post. I'm excited about it.

For more information, a good place to start is the TWAIN Direct page on the TWAIN Working Group's site.

About the Author

"Spike" McLarty

Spike joined Atalasoft at the start of 2011, fresh from a decade running his (one person) company Dosadi, creating tools for TWAIN scanning and image processing, and writing the odd TWAIN driver. Before that, Spike climbed the technical ladder at Logitech for about 14 years, building compilers, image editors, TWAIN drivers, and a variety of applications. It adds up to about 20 years of Windows development experience. Spike has a BS and MS in Electrical Engineering from Stanford.

More Content by "Spike" McLarty
Previous Article
Practical Engineering
Practical Engineering

How am I able to see my phone through my sunglasses, when the glass on smartphones is usually polarized?

Next Article

A discussion of YAGNI or “You Aren’t Gonna Need It”

Try any of our Imaging SDKs free for 30 days with Full Support

Download Now