Save Multi-images PDF as stream into SQlserver

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
chen_jon
Posts: 1
Joined: Wed Nov 05, 2008 6:48 am

Save Multi-images PDF as stream into SQlserver

Post by chen_jon » Wed Nov 05, 2008 6:54 am

Hi,

I used the following code to save multi-page images as PDF into table. But it only saves the last image:
bool firstImage=true;
System.IO.MemoryStream mem=null;
try
{
while (m_TwainObject.AcquireModal())
{
if (firstImage)
{
mem = m_TwainObject.GetImageAsStream(0, ImageFileFormat.PDF);
firstImage = false;
}
else
{
m_TwainObject.SaveImage(0, mem, ImageFileFormat.PDF);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

//code below to save into table
//dbService.SaveScannedImage(mem.ToArray());

My question: Can the current library save multi-image PDF? If yes, how?
Thanks for help

Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Re: Save Multi-images PDF as stream into SQlserver

Post by Alex » Wed Nov 05, 2008 5:44 pm

Hello Chen,

Thank you for your message, your code is fully correct. We have found a bug in the SaveImage(int, Stream, ImageFileFormat) method in version 4.3.0.1 of library and now this bug is fixed. Please download the latest version (4.3.0.3) version of library from this page: http://www.vintasoft.com/download.html

Best regards, Alexander

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests