The project is ported from twain-samples.
- Visual Studio 2017 or above
- Qt 5.12.11 msvc2017
- Add system variable
QTDIR
: msvc2017 (x86) or msvc2017_64 (x64) - If you have multiple Qt Kit directories in system path, move the target kit directory ahead of others. Otherwise, when running
windeployqt.exe
to deploy a Qt project, it will fail to copy the correct dll files.
- Start Visual Studio as administrator.
- Open
TWAIN-Samples\Twain_DS_sample01\visual_studio\TWAINDS_VS2017.sln
. - Build the project. The relevant files will be copied to
C:\Windows\twain_32\sample2\
.
-
Open the virtual scanner in Dynamic Web TWAIN online demo.
-
Open the scanner in twacker.
-
Run twacker.
-
In Visual Studio, set a breakpoint in
DS_Entry()
and then go toDebug > Attach to Process
to find the twacker process. -
Click the
Attach
button and then select the virtual scanner to trigger debugging.
-
Create a
source.json
file which contains the folder of custom image set. For example:{ "folder": "C:/Users/admin/Pictures/barcode" }
Copy the JSON file to
C:\Windows\twain_32\sample2
. -
In the folder of custom image set, create a
info.json
file which contains the index of current selected file and max image count for ADF:{ "index": 0, "maxcount": 10 }
-
Use twacker to scan the custom images one by one. The index will be auto-updated if your folder have Write permission.