EDN Admin
Well-known member
I had a related question running on this in a different thread,but I was told to start a new thread since the original had gotten off the original topic. I am trying to scan multiple pages from an Automatic Document Feeder Scanner and combine them to a single
multi-page tif file. I am using two different third party libraries to do this.
The first library I am using is to scan the documents. It saves the files to the local hard drive as single page tif files. This library returns the file-names as they were saved on the hard drive. This part seems to be working as advertised. The source
for this including a video on how to use it is at: http://www.mka-soft.com/index.php/easy-coding/97-access-twain-v3
The second library is supposed to combine the individual files into a single multi-page tif file. I am having difficulty with this part in returning any data to me. The source for this is at: http://bitmiracle.com/libtiff/
Both of these programs are freeware or Open source projects.
Here is the code I am using to try to make this work.
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; Dim FileNames <span style="color:Blue; As Collection
<span style="color:Blue; Dim FileArray <span style="color:Blue; As <span style="color:Blue; New List(Of <span style="color:Blue; String)
<span style="color:Blue; Dim Mergename <span style="color:Blue; as <span style="color:Blue; String
<span style="color:Blue; Dim FileNames = TwainLib.ScanImages()
<span style="color:Blue; For <span style="color:Blue; Each Itm <span style="color:Blue; In FileNames
FileArray.Add(ControlChars.Quote & Itm & ControlChars.Quote)
<span style="color:Blue; Next
MergeName = ControlChars.Quote & <span style="color:#A31515; "%temp%MergedTiffFile.Tif" & ControlChars.Quote
FileArray.Add(MergeName)
TiffCP.Program.Main(FileArray.ToArray)
Process.Start(MergeName)
[/code]
<br/>
Where I am running into trouble is on the last line where I actually try to open the file. I am getting an error that the file cannot be found.I have tried running this on the command line as an executable and it runs fine, but I do not have enough experience
yet to know if I am running it correctly here.
I would be grateful for any help.
View the full article
multi-page tif file. I am using two different third party libraries to do this.
The first library I am using is to scan the documents. It saves the files to the local hard drive as single page tif files. This library returns the file-names as they were saved on the hard drive. This part seems to be working as advertised. The source
for this including a video on how to use it is at: http://www.mka-soft.com/index.php/easy-coding/97-access-twain-v3
The second library is supposed to combine the individual files into a single multi-page tif file. I am having difficulty with this part in returning any data to me. The source for this is at: http://bitmiracle.com/libtiff/
Both of these programs are freeware or Open source projects.
Here is the code I am using to try to make this work.
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; Dim FileNames <span style="color:Blue; As Collection
<span style="color:Blue; Dim FileArray <span style="color:Blue; As <span style="color:Blue; New List(Of <span style="color:Blue; String)
<span style="color:Blue; Dim Mergename <span style="color:Blue; as <span style="color:Blue; String
<span style="color:Blue; Dim FileNames = TwainLib.ScanImages()
<span style="color:Blue; For <span style="color:Blue; Each Itm <span style="color:Blue; In FileNames
FileArray.Add(ControlChars.Quote & Itm & ControlChars.Quote)
<span style="color:Blue; Next
MergeName = ControlChars.Quote & <span style="color:#A31515; "%temp%MergedTiffFile.Tif" & ControlChars.Quote
FileArray.Add(MergeName)
TiffCP.Program.Main(FileArray.ToArray)
Process.Start(MergeName)
[/code]
<br/>
Where I am running into trouble is on the last line where I actually try to open the file. I am getting an error that the file cannot be found.I have tried running this on the command line as an executable and it runs fine, but I do not have enough experience
yet to know if I am running it correctly here.
I would be grateful for any help.
View the full article