Saving multiple page pdf to database

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

Moderator: Alex

Post Reply
Posts: 3
Joined: Tue Sep 22, 2009 9:14 am

Saving multiple page pdf to database

Post by SPASA2009 » Thu Sep 09, 2010 8:28 am


I am upgrading an application from version 5 which scans one or more pages as pdf to a database using javascript. It is working fine for single pages but when scanning more than one page I receive an error 'wrong number of arguments or invalid property assignment' on the line
device.AcquiredImages.Last.Save(mem, 5);

here is the code:
acquireState = device.AcquireModal();
if (acquireState == 2) // image acquired
// save all acquired images as PDF stored in the memory
if (firstImage)
// get the first image as PDF stored in memory
mem = device.AcquiredImages.Last.GetAsStream(5);
firstImage = false;
// add image to PDF stored in the memory
device.AcquiredImages.Last.Save(mem, 5);
}while (acquireState != 0);

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

Re: Saving multiple page pdf to database

Post by Alex » Thu Sep 09, 2010 1:24 pm


JavaScript does not support function overloading. :-(

Today version of VintaSoftTwain.NET SDK is released - we have added the AcquiredImage.SaveToStream(Stream, ImageFileFormat) method with the same functionality as AcquiredImage.Save(Stream, ImageFileFormat) method.

Best regards, Alexander

Post Reply