Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Integration > Twain, WIA or Scanner Component

Forum

Search UsersRules
Twain, WIA or Scanner Component
#1
Active user
Points:: 0
Joined:: Feb 26, 2015

Hello everyone.
I have a question experts. :)
I want to establish a connection with the scanner.
I want to take a picture from the scanner.
How do I do this?

Profile
#2
Guest
Points::
Joined::

Hello, Erdogan Uguz!

You can use COMObject to create an instance of WIA COM object or TWAIN add-in. Then you save a file to the temporary directory, read and save it in the ValueStorage attribute in the infobase.
Here are examples for you to start:

Code
ScanDialog = New COMObject("WIA.CommonDialog");
ScanDialog.ShowAcquireImage();

Code
TwainAddIn = New("AddIn.twain.AddInNativeExtension");
TwainAddIn.BeginScan(...);


Details on methods and properties of COM objects you can find in documentation of their vendors.

You might find useful the list of methods of the TWAIN component that is built into 1C:Small Business. See the TwainComponent common template usage.

Hope, this helps.

Profile
#3
Active user
Points:: 0
Joined:: Feb 26, 2015

I clicked on the link you wrote. I looked. Frankly, I do not understand anything.It seemed a bit confused. We are developing software using C # and Java. We use Twain and WIA. But here I do not understand how to use. I could not find in the Help guide. Is there a more detailed example?
- To list the scanner.
- Select the scanner.
- Get the picture from the scanner and to transfer the image box.

Profile
#4
Guest
Points::
Joined::

If you are asking about TWAIN component, those methods are named:
EnumDevices() - List scanners.
SelectDevice() - Select the scanner.
BeginScan(Boolean OpenDialog, String DeviceName, String PictureFormat, Number Resolution, Number Chromaticity, Number Rotation, Number PaperSize, Number DeflateParameter, Boolean DoubleSidedScan) - Get the picture from the scanner.

PictureFormat values:
a) PNG (default)
b) JPG
c) TIF
other formats, supported by the scanner

Resolution values:
number of dot per inch, for example 300 (300 DPI)

Chromaticity values:
a) 0 (black/white)
b) 1 (grayscale)
c) 2 (color)

Rotation values:
a) 0 (0 degrees)
b) 90 (90 degrees)
c) 180 (180 degrees)
d) 270 (270 degrees)

PaperSize values:
a) 0 (not set)
b) 11 (А3)
c) 1 (А4)
d) 5 (А5)
e) 6 (B4)
f) 2 (B5)
g) 7 (B6)
h) 14 (C4)
i) 15 (C5)
j) 16 (C6)
k) 3 (USLetter)
l) 4 (USLegal)
m) 10 (USExecutive)

DeflateParameter values:
Depend on the image format.
a) For JPG
0...100
b) For TIF:
2 – LZW
3 – CCITT3
4 – CCITT4
5 – RLE
6 – without compression

Profile
#5
Active user
Points:: 0
Joined:: Feb 26, 2015

Thanks. :)

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.