Files
ntwain/README.md

46 lines
1.7 KiB
Markdown
Raw Normal View History

2018-11-20 21:23:34 -05:00
# TWAIN dotnet library
2014-04-02 19:01:21 -04:00
2023-04-08 19:34:57 -04:00
NOTE: This is a rewrite of the original NTwain lib and is still
in early stages. Use the V3 branch for the current version.
2018-11-18 19:40:08 -05:00
2017-02-02 19:56:25 -05:00
## Info
2018-11-10 14:09:36 -05:00
2018-11-23 20:25:07 -05:00
This is a dotnet library created to make working with
[TWAIN](http://twain.org/) devices easier in dotnet.
It internally uses some parts of the
[twaincs](https://github.com/twain/twain-cs) code from
the TWAIN Working Group.
2023-04-08 19:34:57 -04:00
V4 of this lib has these features:
2014-04-02 19:01:21 -04:00
2023-04-08 19:46:54 -04:00
* Targets TWAIN version 2.5.
* Runs under supported framework (4.6.2+) and netcore variants (8.0+).
2023-04-08 19:34:57 -04:00
* Easier to use than the low-level C API with many dotnet niceties.
* Attempt at reducing heap allocations compared to previous versions.
## Compred to older versions
These are not implemented yet in this early version:
* All TWAIN data types are now struct instead of class (and they come
from [twaincs](https://github.com/twain/twain-cs) for correctness.
2023-04-08 19:34:57 -04:00
* All lower-level TWAIN APIs are public instead of hidden away.
2017-02-02 19:56:25 -05:00
## Using the lib
2014-11-29 22:43:07 -05:00
Before using this lib, you are required to be reasonably
2018-11-10 14:09:36 -05:00
familiar with the TWAIN spec and understand how it works in general.
2023-04-08 19:34:57 -04:00
The TWAIN spec pdf can be downloaded from [twain.org](http://twain.org/).
The main class to use is `TwainAppSession`. This is the highest abstraction level
provided by this lib. A lower-level abstraction is the triplet calls
(under `NTwain.Triplets` namespace). The lowest level is the pinvoke dsm calls
(under `NTwain.DSM` namespace).
You use `TwainAppSession` by subscribing to its events and calling methods to do TWAIN things.
2023-04-08 19:46:54 -04:00
There is a sample winform project (both 32 and 64 bit variants) on how it can be used.
2023-04-08 19:34:57 -04:00
Note that an application process should only have one active (opened)
`TwainAppSession` at any time.