Hi,
I like to scan multiple pages and save as multi-page tiff file (single file) back to database. Is it possible?
Thanks,
Jimmy
How to save multi-page tiff into database?
Moderator: Alex
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: How to save multi-page tiff into database?
Hello Jimmy,
Current version of library allows to save only the single image to the stream using the GetImageAsStream method. Please add your suggestion to the "New features request..." topic and we will add opportunity to save all images into the single stream.
At the moment you should save all images to a mutipage TIFF on a disk and then save file from disk to database.
Best regards, Alexander
Current version of library allows to save only the single image to the stream using the GetImageAsStream method. Please add your suggestion to the "New features request..." topic and we will add opportunity to save all images into the single stream.
At the moment you should save all images to a mutipage TIFF on a disk and then save file from disk to database.
Best regards, Alexander
-
- Posts: 2
- Joined: Thu Oct 23, 2008 8:53 pm
Re: How to save multi-page tiff into database?
Hi Alex,
I'm trying to save a multi-file tiff to disk and read it back to store into DB as you've suggested. I have a duplex printer and using Advanced Sample, Save As..., Multi-Tiff does not save both pages to the tiff (using fax tiff viewer and it shows only one page)
Can you please provide a sample of how to save a multi-file tiff to disk and read it back to save to DB as you've suggested.
Thanks in advance
I'm trying to save a multi-file tiff to disk and read it back to store into DB as you've suggested. I have a duplex printer and using Advanced Sample, Save As..., Multi-Tiff does not save both pages to the tiff (using fax tiff viewer and it shows only one page)
Can you please provide a sample of how to save a multi-file tiff to disk and read it back to save to DB as you've suggested.
Thanks in advance
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: How to save multi-page tiff into database?
Hello,
You can save acquired image(s) to a stream as multipage TIFF file or PDF document 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:
And here is an example that shows how to save all acquired images as a single PDF document in a stream:
Best regards, Alexander
You can save acquired image(s) to a stream as multipage TIFF file or PDF document 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:
Code: Select all
Dim mem As MemoryStream = VSTwain1.GetImageAsStream(0, ImageFileFormat.PDF)
Code: Select all
Public Sub ScanWithUI()
Dim mem As MemoryStream
VSTwain1.AppProductName = "MyTwainApplication"
Try
VSTwain1.StartDevice()
VSTwain1.SelectSource()
VSTwain1.ShowUI = true
VTwain1.MaxImages = 1
Dim firstImage As Boolean = True
While VSTwain1.AcquireModal()
If firstImage Then
' Create memory stream and place the first image to it
mem = VSTwain1.GetImageAsStream(0, ImageFileFormat.PDF)
firstImage = False
Else
' Add second and next images to the stream
VSTwain1.SaveImageToStream(0, mem, ImageFileFormat.PDF)
End If
End While
Catch ex As TwainException
MsgBox ex.Message
Catch ex As ImagingException
MsgBox ex.Message
End Try
...
' Upload stream data to server or something else...
...
End Sub
-
- Posts: 2
- Joined: Thu Oct 23, 2008 8:53 pm
Re: How to save multi-page tiff into database?
Thanks Alex!