

Of course, because TWAIN and SANE are different APIs that are available on mutually-exclusive platforms, there will have to be at some point some #ifdefs or other method of distinguishing between platforms to determine which API to use. I don't insist on "compile once, run anywhere", but I do insist on "write once, compile anywhere" at the least. Once I have such a library in hand, I can construct a GUI that just calls the routines as needed, and use one of several available PDF rendering libraries to create the output.

I'd prefer something like Java or C#, but C or C++ would work fine too.

I'm not particularly concerned with the programming environment: I am familiar with all the popular imperative/OO languages. Then it should be possible to either specify explicitly, hint, or query the resulting image format of the byte array that is returned from a successful scan. A few properties that are shared between TWAIN and SANE should be exposed: for example, the DPI, paper size, and color/grayscale/lineart. The API must be able to provide a byte array of the bits, compressed or otherwise, of the scanned data. First, I need a library that provides a uniform API regardless of whether it is using TWAIN or SANE on the backend. At the low level, I want to support the TWAIN and SANE interfaces, on Windows XP or later, Mac OS X, and popular Linux 2.6 distros of approx. I am therefore starting on the road to creating such a program. You cannot rely on the driver to handle multi-page scanning, because drivers only do that for form feed scanners that will "suck in" a stack of paper without pause, and combine the data before handing it off to the driver framework. To do this, the software has to store each scanned page, one at a time, and ask the user if they want to scan another page. The problem is that I know of no program that is cross-platform, and capable of creating multi-page scans from a flatbed scanner. Because "scanner" is an ambiguous word (which REALLY makes searching difficult!) let me clarify: I mean, for example, the process by which an HP F4280 printer/scanner device optically "scans" a paper document and creates a digital representation of it, usually ending up as a a. For a long time, it has annoyed me that you need special software for creating a multi-page PDF document from a flatbed scanner.
