comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Scanner library Ada binding?
Date: Thu, 27 Oct 2016 14:08:38 -0700 (PDT)
Date: 2016-10-27T14:08:38-07:00	[thread overview]
Message-ID: <c1a69d72-66f8-4ad9-8bd6-418f72d82fd4@googlegroups.com> (raw)
In-Reply-To: <197b234f-c0e8-4b30-931e-0f97e8718168@googlegroups.com>

On Sunday, September 18, 2016 at 3:25:58 PM UTC-5, Stephen Leake wrote:
> I'm scanning all the liner notes from my CDs (several hundred).
...
> Does anyone have an Ada binding to the Windows TWAIN interface? I'm on 64 bit 
> Windows 8.1, GNAT GPL 2016 (32 bit).

I ended up implementing a Windows Metro app, starting from a scanner sample app provided with Microsoft Visual Studio.

It was a frustrating experience. The sample code uses C++ syntax that I could not find definitions for (I think "^" is some variant of pointer). The Microsoft code documentation makes the Google Android docs look wonderful :(. There appear to be at least 2 separate sets of code; those for a Metro app (called "the Windows Runtime") and those for a Desktop app (not clear what that runtime is called). And no way to limit searches to one or the other!

The low-level scan routines only return .BMP files. The only example code I could find that would convert that to JPEG was for the Desktop runtime (the scan example is for the Metro runtime). I already have some Desktop Ada code that incorporates the JPEG files into a PDF via latex, so I added more Ada code to call ImageMagick 'convert' via GNAT.OS_Lib.

It works, and it will save time, but what a pain!


  parent reply	other threads:[~2016-10-27 21:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-18 20:25 Scanner library Ada binding? Stephen Leake
2016-09-20 15:21 ` gautier_niouzes
2016-10-27 21:08 ` Stephen Leake [this message]
2016-10-28  0:00   ` Dennis Lee Bieber
2016-10-31 13:36     ` Sylvain Laperche
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox