Product Info
DownloadsTestimonialsGot it downloaded and we will put that to work right away! We purchased a .Net twain control set for a custom written application using cameras about three years ago. We found Vintasoft in an Internet search. When we updating the software, we purchased the newer version that we needed. Peter Philbrick |
VintaSoftTwain.NET SDK - FAQGeneral questions:
Redistribution:
Sales:
Programming:
Web:
Databases:
For which purposes can I use the VintaSoftTwain.NET SDK?SDK can be used for controlling a work of scanners, web or digital cameras and any other TWAIN devices.
From which parts does the library consist?The SDK contains:
In which programming languages can I use the Vintasoft.Twain component?With Single Developer license or Site license you can use component in:
With Server license you can use component in:
What restrictions does the unregistered version contain?Unregistered version has the following restrictions:
All these restrictions are removed in registered version.
I have problems. What should I do?Answers to the majority of questions can be found in the documentation or this web site. Please write to our support team to get more help.
What files do I need to include in the setup package of my program?You need include only one file: Vintasoft.Twain.dll. This file must be placed in the same folder as the assembly that references it. Make sure that the version you distribute is the version your assembly was compiled with.
Can I re-distribute the Vintasoft.Twain.dll with my application without royalties?Yes, this component is royalty free. You pay only for registration one time. Only Vintasoft.Twain.dll can be re-distributed with your application.
What to do when my Single developer license application redistribution count is about to exceed 100 copies in a year?If you own Single developer license you must contact Sales in an event your application redistribution count is about to exceed 100 copies in current year. You'll be provided with an opportunity to upgrade your Single developer license to Site license with 30% discount or to buy additional Single developer license.
What is the difference between Single developer license and Site license?
May I upgrade my existing Standard edition license to equivalent Standard + WPF edition license?Yes, please contact Sales and you'll be provided with an opportunity to buy the equivalent Standard + WPF edition license with 70% discount.
Is there a difference in deploying my application on a desktop PC or on a server?Yes, there is. Please read the "Deploying" section in this product documentation to understand the difference. Terms: Desktop PC - Windows XP, Vista, 7 OS installed. Server - Windows Server 2000, 2003, 2008 OS installed.
How can I add the Vintasoft.Twain.DeviceManager component to a form in my .NET project?To add VintaSoft.Twain.DeviceManager component to your form you should do the following:
How can I acquire black-white images?Here is a sample of code for acquiring black-white images only:
[VB.NET]
Dim _device As Vintasoft.Twain.Device
...
Private Sub AcquireBlackWhiteImages()
_device.ShowUI = False
_device.DisableAfterAcquire = True
' open the device
_device.Open()
' set necessary pixel type
_device.PixelType = PixelType.BW
' acquire images from device
_device.Acquire()
End Sub
How can I work with ADF without displaying the User Interface?Here is an example that shows how to asynchronously acquire images from document feeder:
[VB.NET]
Dim _device As Vintasoft.Twain.Device
...
Private Sub AcquireImagesFromAdf()
' set scan settings
_device.ShowUI = False
_device.DisableAfterAcquire = True
_device.Open()
_device.PixelType = PixelType.RGB
_device.UnitOfMeasure = UnitOfMeasure.Inches
_device.Resolution = New Resolution(200, 200)
' set document feeder settings
If _device.DocumentFeeder.Present Then
_device.DocumentFeeder.Enabled = True
_device.XferCount = -1
' enable duplex if possible
If _device.DocumentFeeder.DuplexMode <> DuplexMode.None Then
_device.DocumentFeeder.DuplexEnabled = True
End If
' acquire images from device
If _device.DocumentFeeder.PaperDetectable Then
If _device.DocumentFeeder.Loaded Then
_device.Acquire()
End If
Else
_device.Acquire()
End If
End If
End Sub
' Handler of the ImageAcquired event.
Private Sub _device_ImageAcquired(ByVal sender As System.Object, _
ByVal e As Vintasoft.Twain.ImageAcquiredEventArgs)
e.Image.Save("c:\multipage.tif")
End Sub
' Handler of the ScanCompleted event.
Private Sub _device_ScanCompleted(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
' do not close the device if UI is used
If Not _device.ShowUI Then
_device.Close()
MsgBox("Scan completed.")
End If
End Sub
Can I hide the user interface and acquire images in modal loop?Here is an example that shows how to synchronously acquire images from the device:
[VB.NET]
Friend Shared Sub Main(args As String())
Try
Using deviceManager As New DeviceManager()
' open the device manager
deviceManager.Open()
' get reference to the current device
Dim device As Device = deviceManager.CurrentDevice
' open the device
device.Open()
' set acquisition parameters
device.TransferMode = TransferMode.Memory
device.ShowUI = False
device.DisableAfterAcquire = True
device.PixelType = PixelType.BW
' create directory for TIFF file
Dim directoryForImages As String = _
Path.GetDirectoryName(Directory.GetCurrentDirectory())
directoryForImages = Path.Combine(directoryForImages, "Images")
If Not Directory.Exists(directoryForImages) Then
Directory.CreateDirectory(directoryForImages)
End If
Dim multipageTiffFilename As String = Path.Combine(directoryForImages, _
"multipage.tif")
' acquire image(s) from the device
Dim acquireModalState1 As AcquireModalState = AcquireModalState.None
Dim imageIndex As Integer = 0
Do
acquireModalState1 = device.AcquireModal()
Select Case acquireModalState1
Case AcquireModalState.ImageAcquired
' save image to file
device.AcquiredImages.Last.Save(multipageTiffFilename)
' output current state
imageIndex = imageIndex + 1
Console.WriteLine(String.Format("Image{0} is saved.", _
imageIndex))
Case AcquireModalState.ScanCompleted
' close device and device manager
CloseDeviceAndDeviceManager(deviceManager, device)
' output current state
Console.WriteLine("Scan completed.")
Case AcquireModalState.ScanCanceled
' close device and device manager
CloseDeviceAndDeviceManager(deviceManager, device)
' output current state
Console.WriteLine("Scan canceled.")
Case AcquireModalState.ScanFailed
' close device and device manager
CloseDeviceAndDeviceManager(deviceManager, device)
' output current state
Console.WriteLine(String.Format("Scan failed: {0}", _
deviceManager.ErrorString))
End Select
Loop While acquireModalState1 <> AcquireModalState.None
End Using
Catch ex As TwainException
Console.WriteLine("Error: " + ex.Message)
End Try
Console.ReadLine()
End Sub
' Close device and device manager.
Private Shared Sub CloseDeviceAndDeviceManager(deviceManager As DeviceManager, _
device As Device)
If device.State = DeviceState.Opened Then
' close the device
device.Close()
End If
' close the device manager
deviceManager.Close()
End Sub
I want to scan only a part of image. How can I do this?Here is an example that shows how to acquire only the top part of page:
[VB.NET]
Private Sub AcquirePartOfImage()
Using deviceManager As New DeviceManager()
Try
' open the device manager
deviceManager.Open()
deviceManager.SelectDevice()
' get reference to current device
Dim device As Device = deviceManager.CurrentDevice
' open the device
device.Open()
' set acquisition parameters
device.ShowUI = False
device.DisableAfterAcquire = True
' set image layout (get only the top half of the page)
device.UnitOfMeasure = UnitOfMeasure.Inches
Dim imageLayout As System.Drawing.RectangleF = device.ImageLayout.Get()
device.ImageLayout.Set(0, 0, imageLayout.Width, imageLayout.Height / 2)
Dim tiffFilename As String = Path.Combine(Directory.GetCurrentDirectory(), _
"multipage.tif")
' acquire images from device
Dim acquireModalState1 As AcquireModalState = AcquireModalState.None
Do
acquireModalState1 = device.AcquireModal()
Select Case acquireModalState1
Case AcquireModalState.ImageAcquired
' save acquired image to multipage TIFF file
device.AcquiredImages.Last.Save(tiffFilename)
Case AcquireModalState.ScanCompleted, _
AcquireModalState.ScanCanceled, _
AcquireModalState.ScanFailed
' close the device
device.Close()
' close the device manager
deviceManager.Close()
End Select
Loop While acquireModalState1 <> AcquireModalState.None
Catch ex As TwainException
Console.WriteLine("Error: " + ex.Message)
Console.ReadLine()
End Try
End Using
End Sub
How can I select a device without displaying the device selection dialog?Here is an example that shows how to select a device by name:
[VB.NET]
Private Sub SelectDeviceByName(ByVal deviceName As String)
' create TWAIN device manager
Using deviceManager As New DeviceManager()
' open TWAIN device manager
deviceManager.Open()
' select the device by device name
Dim device As Device = Nothing
For i As Integer = 0 To deviceManager.Devices.Length - 1
If deviceManager.Devices(i).Info.ProductName = deviceName Then
deviceManager.CurrentDeviceIndex = i
device = deviceManager.CurrentDevice
Exit For
End If
Next
' throw exception if device is not found
If device Is Nothing Then
Throw New ApplicationException("Device is not found.")
End If
' acquire images from the device
device.Acquire()
End Using
End Sub
How can I disable the progress indicator dialog when I acquire images without UI?TWAIN standard allows to disable the progress indicator dialog when ShowUI=false. This can be made as follows:
[VB.NET]
Dim _device As Vintasoft.Twain.Device
...
Private Sub AcquireImagesWithoutUiAndIndicator()
_device.ShowUI = False
_device.ShowIndicators = False
_device.DisableAfterAcquire = True
' acquire images from device
_device.Acquire()
End Sub
I want to create my own progress indicator of image scan. Is this possible?Yes, this is possible if you use a Memory transfer mode - you should use a ImageAcquiringProgress event. Here is an example:
[VB.NET]
Dim _device As Vintasoft.Twain.Device
...
' Handler of the Device.ImageAcquiringProgress event
Private Sub _device_ImageAcquiringProgress(ByVal sender As System.Object, _
ByVal e As Vintasoft.Twain.ImageAcquiringProgressEventArgs)
ProgressBar1.Value = e.Progress
End Sub
Can I set a different Resolution in the X and Y direction?Yes. Here is the sample of code how to set X Resolution to 200 dpi and Y Resolution to 400 dpi:
[VB.NET]
Dim _device As Vintasoft.Twain.Device
...
Private Sub AcquireBlackWhiteImages()
_device.ShowUI = False
_device.DisableAfterAcquire = True
' open the device
_device.Open()
' set scan settings
_device.PixelType = PixelType.BW
_device.UnitOfMeasure = UnitOfMeasure.Inches
_device.Resolution = New Resolution(200, 400)
' acquire images from device
_device.Acquire()
End Sub
Our organization has a network scanner with ADF and we scan many documents each day. How can we automate our work? We want to save each document in a separate file.You can use blank page for separation of documents and detect blank page, as delimiter of documents, by the AcquiredImage.IsBlank method. Here is an example:
[VB.NET]
Dim _device As Vintasoft.Twain.Device
Dim _documentCounter as Integer
...
Private Sub AcquireImages()
' set scan settings
_device.ShowUI = False
_device.DisableAfterAcquire = True
_device.Open()
_device.PixelType = PixelType.BW
_device.UnitOfMeasure = UnitOfMeasure.Inches
_device.Resolution = New Resolution(300, 300)
' set settings of the internal image buffer
_device.AcquiredImages.Capacity = 1
_device.AcquiredImages.AutoClean = True
_device.AcquiredImages.TiffMultiPage = True
_device.AcquiredImages.TiffCompression = TiffCompression.Auto
' set document feeder settings
If _device.DocumentFeeder.Present Then
_device.DocumentFeeder.Enabled = True
_device.XferCount = -1
' enable duplex if possible
If _device.DocumentFeeder.DuplexMode <> DuplexMode.None Then
_device.DocumentFeeder.DuplexEnabled = True
End If
' acquire images from device
If _device.DocumentFeeder.PaperDetectable Then
If _device.DocumentFeeder.Loaded Then
_device.Acquire()
End If
Else
_device.Acquire()
End If
End If
End Sub
' Handler of the ImageAcquired event.
Private Sub _device_ImageAcquired(ByVal sender As System.Object, _
ByVal e As Vintasoft.Twain.ImageAcquiredEventArgs)
If e.Image.IsBlank() Then
_documentCounter = _documentCounter + 1
End If
Try
e.Image.Save("c:\documents\doc" + Str(_documentsCounter) + ".pdf")
Catch ex As PdfException
MsgBox(ex.Message)
End Try
End Sub
' Handler of the ScanCompleted event.
Private Sub _device_ScanCompleted(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
' do not close the device if UI is used
If Not _device.ShowUI Then
_device.Close()
MsgBox("Scan completed.")
End If
End Sub
Can I use patch codes to separate batch jobs? If so, how can I detect the end of batch job?You can detect batch jobs by using the CAP_JOBCONTROL Capability.
[VB.NET]
Imports Vintasoft.Twain
Dim _deviceManager As DeviceManager
Dim _device As Device
Dim _jobCounter As Integer = -1
Private Sub ScanWithJobControlButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles ScanWithJobControlButton.Click
Try
' create and open device manager
_deviceManager = New DeviceManager(Me)
_deviceManager.Open()
' get reference to current device
_device = _deviceManager.CurrentDevice
' create handlers of events
AddHandler _device.ImageAcquired, AddressOf _device_ImageAcquired
AddHandler _device.ScanCompleted, AddressOf _device_ScanCompleted
AddHandler _device.ScanCanceled, AddressOf _device_ScanCanceled
AddHandler _device.ScanFailed, AddressOf _device_ScanFailed
' set scanning settings
_device.ShowUI = False
_device.DisableAfterAcquire = True
_device.AcquiredImages.Capacity = 1
_device.AcquiredImages.TiffMultiPage = True
_device.Open()
_device.JobControl = JobControl.DetectAndIncludeJobSeparatorAndContinueScanning
_jobCounter = _jobCounter + 1
' acquire images from device
_device.Acquire()
Catch ex As TwainException
MsgBox(ex.Message)
End Try
End Sub
Private Sub _device_ImageAcquired(ByVal sender As System.Object, _
ByVal e As Vintasoft.Twain.ImageAcquiredEventArgs)
If _device.EndOfJob Then
_jobCounter = _jobCounter + 1
Else
Try
e.Image.Save("c:\job" + Str(_jobCounter) + ".tif")
Catch ex As ImageProcessingException
MsgBox(ex.Message)
End Try
End If
End Sub
Private Sub _device_ScanCompleted(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
_device.Close()
MsgBox("Scan completed.")
End Sub
Private Sub _device_ScanCanceled(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
_device.Close()
MsgBox("Scan canceled.")
End Sub
Private Sub _device_ScanFailed(ByVal sender As System.Object, _
ByVal e As Vintasoft.Twain.ScanFailedEventArgs)
_device.Close()
MsgBox("Scan failed: " + e.ErrorString)
End Sub
Can I save acquired images to PDF document?Yes, you can do this. Acquired images can be saved to a new PDF document or added to an existing PDF document.
[VB.NET]
Dim _device As Vintasoft.Twain.Device
...
' set settings of PDF document
_device.AcquiredImages.PdfMultiPage = True
_device.AcquiredImages.PdfDocumentInfo.Author = "VintaSoft Ltd."
_device.AcquiredImages.PdfDocumentInfo.Title = "Documents acquired from " + _
_device.Info.ProductName
_device.AcquiredImages.PdfDocumentInfo.Creator = "VintaSoftTwain.NET SDK"
_device.AcquiredImages.PdfDocumentInfo.ModificationDate = DateTime.Now
' save the first acquired image as new PDF document
_device.AcquiredImages(0).Save("c:\test.pdf")
' add the second acquired image to existing PDF document
_device.AcquiredImages(1).Save("c:\test.pdf")
' add the third acquired image to existing PDF document
_device.AcquiredImages(2).Save("c:\test.pdf")
How can I retrieve an extended image info from the scanner?This example demonstrates how to get information about barcodes found on acquired image:
[VB.NET]
Private Sub GetExtendedImageInfo()
Using deviceManager As New DeviceManager()
Try
' open the device manager
deviceManager.Open()
deviceManager.SelectDevice()
' get reference to current device
Dim device As Device = deviceManager.CurrentDevice
' open the device
device.Open()
' set acquisition parameters
device.ShowUI = False
device.DisableAfterAcquire = True
' specify that image info is necessary
device.ExtendedImageInfo.Add(New _
ExtendedImageInfo(ExtendedImageInfoId.BarcodeCount))
device.ExtendedImageInfo.Add(New _
ExtendedImageInfo(ExtendedImageInfoId.BarcodeType))
device.ExtendedImageInfo.Add(New _
ExtendedImageInfo(ExtendedImageInfoId.BarcodeTextLength))
device.ExtendedImageInfo.Add(New _
ExtendedImageInfo(ExtendedImageInfoId.BarcodeText))
Dim tiffFilename As String = Path.Combine(Directory.GetCurrentDirectory(), _
"multipage.tif")
' acquire images from device
Dim acquireModalState1 As AcquireModalState = AcquireModalState.None
Do
acquireModalState1 = device.AcquireModal()
Select Case acquireModalState1
Case AcquireModalState.ImageAcquired
' save acquired image to multipage TIFF file
device.AcquiredImages.Last.Save(tiffFilename)
Dim barcodeCount As ExtendedImageInfo = device.ExtendedImageInfo(0)
If barcodeCount.Items IsNot Nothing Then
If barcodeCount.Items.Length > 0 Then
If barcodeCount.Items(0) > 0 Then
Dim barcodeType As ExtendedImageInfo = _
device.ExtendedImageInfo(1)
Dim barcodeTextLength As ExtendedImageInfo = _
device.ExtendedImageInfo(2)
Dim barcodeText As ExtendedImageInfo = _
device.ExtendedImageInfo(3)
Dim infoString As String
For i As Integer = 0 To barcodeCount.Items(0) - 1
infoString = ""
If barcodeType.IsValid Then
infoString = "BarcodeType=" + _
barcodeType.Items(i) + " "
Else
infoString = "BarcodeType=Undefined "
End If
If barcodeText.IsValid Then
infoString = "BarcodeText='" + _
barcodeText.StringItems(i) + "'"
Else
infoString = "BarcodeText=Undefined "
End If
Console.WriteLine(infoString)
Next
End If
End If
End If
Case AcquireModalState.ScanCompleted, AcquireModalState.ScanCanceled, _
AcquireModalState.ScanFailed
' close the device
device.Close()
' close the device manager
deviceManager.Close()
End Select
Loop While acquireModalState1 <> AcquireModalState.None
Catch ex As TwainException
Console.WriteLine("Error: " + ex.Message)
Console.ReadLine()
End Try
End Using
End Sub
Can I acquire 48-bit images?Yes. VintaSoftTwain.NET SDK allows to acquire 48-bit color images or 16-bit gray images if Memory transfer mode is used. [VB.NET] Dim _device As Vintasoft.Twain.Device ... _device.Open() _device.PixelType = PixelType.RGB _device.BitDepth = 16 ' 16 - for Epson scanners, 48 - for Canon scanners _device.Acquire() Here is an example that demonstrates how to acquire 24-bpp color image without UI from scanner: [VB.NET] Dim _device As Vintasoft.Twain.Device ... _device.Open() _device.PixelType = PixelType.RGB _device.BitDepth = 8 ' 8 - for Epson scanners, 24 - for Canon scanners _device.Acquire() Here is an example that demonstrates how to acquire 16-bpp gray image without UI from scanner: [VB.NET] Dim _device As Vintasoft.Twain.Device ... _device.Open() _device.PixelType = PixelType.Gray _device.BitDepth = 16 _device.Acquire()
Can I create predefined session setup for my high-volume scanner?Yes, SDK allows to load/save predefined session setups for mid- and high-volume scanners.
[VB.NET]
...
_device.Open()
Dim fs As FileStream = New FileStream("scanner-setup.xml", FileMode.Append, _
FileAccess.Write)
_device.SaveSettings(fs)
fs.Close()
...
Here is an example that demonstrates how to load previously saved device settings into the device:
[VB.NET]
...
_device.OpenDataSource()
Dim fs As FileStream = New FileStream("scanner-setup.xml", FileMode.Open, _
FileAccess.Read)
_device.LoadSettings(fs)
fs.Close()
_device.Acquire()
...
I receive "Cannot initialize the device manager" message when I open the device manager. How to solve this problem?You have to:
TWAIN Data Source Manager (DSM) v1.X is TWAIN_32.DLL, normally this file located in "C:\Windows\" directory and included in distributive package of all 32-bit versions of Windows. TWAIN DSM v2.X for 32-bit systems consists from 2 files: TWAINDSM.DLL and TWAINDSM32.MSM. This DSM is NOT included in distributive package of Windows. In 32-bit systems DSM files must be placed in "C:\Windows\System32\" directory. In 64-bit systems DSM files must be placed in "C:\Windows\SysWow64\" directory. TWAIN DSM v2.X for 64-bit systems consists from 2 files: TWAINDSM.DLL and TWAINDSM64.MSM. This DSM is NOT included in distributive package of Windows. In 64-bit systems DSM files must be placed in "C:\Windows\System32\" directory. Latest version of TWAIN DSM 2.X can be found here: http://www.twain.org or http://sourceforge.net/projects/twain-dsm/files/.
I cannot see devices in TWAIN selection dialog of my application but I can see devices in other applications. Why?You can compile your application with version 7.0 and higher of VintaSoftTwain.NET SDK in "Any CPU" mode and your application will:
You can compile your application with version 7.0 and higher of VintaSoftTwain.NET SDK in "x86" (WOW) mode and your application will:
You can compile your application with version 7.0 and higher of VintaSoftTwain.NET SDK in "x64" mode and your application will:
We recommend use of "x86" mode because all scanners have x32 TWAIN drivers but only new and professional scanners have native x64 TWAIN drivers.
What steps should I make to add the VintaSoft.Twain Component to my web project?On Server side you must do the following:
On Client side you must do the following:
I want to create a script on my website which would automatically configure .NET Framework security settings for my web server, allowing me to avoid complex configurations routines for the end user. What should I do?You can create a script which will execute this command: caspol.exe -q -machine -addgroup All_Code -site www.my-company.com FullTrust
I have a message "Your .NET Framework Security settings must be configured to run the components in your browser" when I run my web application. What did I make wrong?First of all you should set a .NET Framework policy as described here. Next you should check which version of Vintasoft.Twain.dll you use (for example, 7.0.0.1). Further you should set an OBJECT object in your web page correctly. Correct version number is very important! Here is an example: < OBJECT ID="TwainDeviceManager" WIDTH=1 HEIGHT=1 It's all that you should do.
Can I scan images and upload them to the server in intranet application with integrated windows authentication?Yes, library allows to use any authentication methods supported by .NET Framework. The following example shows how to use authentication information of the currently logged on user: [VB.NET] Dim _httpUpload As Vintasoft.Http.HttpUpload ... _httpUpload.Url = "http://localhost/vstwaindemo/imageupload.aspx" _httpUpload.UseDefaultCredentials = True ... The following example shows how to use multiple authentication information:
[VB.NET]
Dim _httpUpload As Vintasoft.Http.HttpUpload
...
Dim myCache As New CredentialCache()
myCache.Add(New Uri("http://www.my-web-server.com/"), "Basic", _
New NetworkCredential(UserName, SecurelyStoredPassword))
myCache.Add(New Uri("http://www.my-web-server.com/"), "Digest", _
New NetworkCredential(UserName, SecurelyStoredPassword, Domain))
_httpUpload.Credentials = myCache
...
Can I scan images and upload them to the server in web application with Cookieless Forms authentication?Yes, you can do this, please see example 8 and 9 here.
How to acquire images from scanner, save acquired images as PDF stream and upload to the server in JavaScript?If you use VintaSoftTwain.NET SDK in JavaScript you must know that:
[JavaScript]
...
// acquire image(s) from the device
var acquireModalState;
var acquireStatusString = "Scan canceled";
var mem;
var firstImage = true;
do
{
acquireModalState = device.AcquireModal();
// image acquired
if (acquireModalState == 2)
{
if (firstImage)
{
// get the first image as PDF stored in the memory
mem = device.AcquiredImages.Last.GetAsStream(5);
firstImage = false;
}
else
{
// add image to PDF stored in the memory
device.AcquiredImages.Last.SaveToStream(mem, 5);
}
}
// scan completed
else if (acquireModalState == 3)
{
acquireStatusString = "Scan completed";
// upload data from the memory stream (mem) to the server
...
}
// scan failed
else if (acquireModalState == 4)
acquireStatusString = "Scan failed";
// scan canceled
else if (acquireModalState == 5)
acquireStatusString = "Scan canceled";
}
while (acquireModalState != 0)
...
Can I store acquired images into a table of MS SQL server?Yes, you can do this, please see example 3 here.
I want to store acquired images as PDF documents in database. Can I do this?Yes, you can save acquired image(s) to a stream and further save stream data to database. Here is an example that shows how to save each acquired image as a separate PDF document in a stream: [VB.NET] Dim mem As MemoryStream = _device.AcquiredImages(0).GetAsStream(ImageFileFormat.PDF) And here is an example that shows how to save all acquired images as a single PDF document in a stream:
[VB.NET]
Dim mem As MemoryStream = _device.AcquiredImage(0).GetAsStream(ImageFileFormat.PDF)
Dim i As Integer
For i = 1 To _device.AcquiredImages.Count - 1
_device.AcquiredImages(i).SaveToStream(mem, ImageFileFormat.PDF)
Next i
|