Twain, WIA or Scanner Component

1C:Enterprise platform integration capabilities and techniques

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Feb 26, 2015
Company: Uguz Limited sirketi

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?

 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

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.

 
#3
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Feb 26, 2015
Company: Uguz Limited sirketi

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.

 
#4
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

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

 
#5
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Feb 26, 2015
Company: Uguz Limited sirketi

Thanks. :)

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.