LEADTOOLS Support
Imaging
Imaging SDK Questions
Multi page scanning (.Net platform using C#)
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Friday, August 12, 2005 3:29:45 AM(UTC)
Groups: Registered
Posts: 3
Hi,
I need to implement the multipage scanning in my software.Presently my software supports scanning where for an example if i put 2 documents with content on both sides to scan only 2 sides are scanned.(page 1 and 3) .The software comes with my multipage scanner(HP scanjet 5590) , when trying to scan it shows a dialog box asking where to save fiels and also giving me the option to select both side scanning.But in the code i have written ,when i try to Acquire, that kinda dialog box doesnt apper.Another user interface of HP appears n I can edit the docs i scanned n press Accept to save then to the hard disk.There no option to slect to scan both side of a document so only page no 1 n 3 is scanned when two docs are inserted.
I have attached my coding here.There is a method/event handler name "twnSession.AcquireMultiPage".Can I use so i can enable multi page scanning.Unfortunately in the samples given,there is no indication abt how to use multi page scanning.I need some coding examples so i can do multipaging.Could u pls check that coding n let me know how to change that coding(adding event handlers etc.., n how to save the multi page scanned docs into a single pdf) so i can successfully implement multi page scanning.
I am displaying the scanned doc in a RasterimageViewer.I am using Previous,Next,Last,First button to traverse from one doc to another.How shall saved the scanned docs into one single PDF.Can i have a code example.I am using C#
#2
Posted
:
Monday, August 15, 2005 8:44:22 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
(1) About the dialogs issue, doesn't display user interface, but try to set the duplex capability manually. To set the duplex capability, please try to use the following code:
+---------------------------------------------------------+
TwainCapability twSetCapability;
twSetCapability = new TwainCapability();
twSetCapability.Information.ContainerType = TwainContainerType.OneValue;
twSetCapability.Information.Type = TwainCapabilityType.DuplexEnabled;
twSetCapability.OneValue.ItemType = TwainItemType.Bool;
twSetCapability.OneValue.Value = TwainCapabilityValue.True;
twnSession.SetCapability(twSetCapability, TwainSetCapabilityMode.Set);
+---------------------------------------------------------+
(2) About the twnSession.AcquireMultiPage event, we have a sample code in the LEADTOOLS .Net documentation that shows how to use this event. You can find the sample code in the "Leadtools ClassLibrary Documentation" Help file, under the following topic:
- TwainSession.AcquireFast Method
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Friday, November 24, 2006 6:31:20 AM(UTC)
Groups: Registered
Posts: 4
Is it possible to use the multi page scanning (I mean, the AcquireMultiPage event) without using the AcquireFast method?
I've tried to use this code:
twnSession.EnableAcquireMultiPageEvent = true;
TwainAcquireMultiPageEventHandler(twain_AcquireMulti);
But the event handler is never called. Did I make any mistake or it is not included in the Raster Imaging Pro?
Thanks
#4
Posted
:
Sunday, November 26, 2006 12:31:51 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
Since you have raster Imaging Pro SDK, you will not be able to use the AcquireFast and AcquireMultiPageEvent because you need to unlock kthe document capability.
However, you can od this by using the Acquire method with the AcquirePage event by saving each page in to a multi-
Page file using the save method as follows:
RasterCodecs Codecs = New RasterCodecs();
private void twainSession_AcquirePage(object sender, TwainAcquirePageEventArgs e)
{
codecs.Save(e.Image,@"c:\1.tif",RasterImageFormat.Tif,1,1,1,1,CodecsSavePageMode.Append)
}
private void buttonAcquire_Click_1(object sender, System.EventArgs e)
{
try
{
twnSession.AcquirePage += new TwainAcquirePageEventHandler(twainSession_AcquirePage);
twnSession.Acquire(TwainUserInterfaceFlags.Show);
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message);
}
}
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#5
Posted
:
Sunday, November 26, 2006 12:36:38 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
Since you have raster Imaging Pro SDK, you can the Acquire method with the AcquirePage event by saving each page in to a multi-
Page file using the save method as follows:
RasterCodecs Codecs = New RasterCodecs();
private void twainSession_AcquirePage(object sender, TwainAcquirePageEventArgs e)
{
codecs.Save(e.Image,@"c:\1.tif",RasterImageFormat.Tif,1,1,1,1,CodecsSavePageMode.Append)
}
private void buttonAcquire_Click_1(object sender, System.EventArgs e)
{
try
{
twnSession.AcquirePage += new TwainAcquirePageEventHandler(twainSession_AcquirePage);
twnSession.Acquire(TwainUserInterfaceFlags.Show);
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message);
}
}
Thanks,
Maen Badwan
LEADTOOLS Technical Support
LEADTOOLS Support
Imaging
Imaging SDK Questions
Multi page scanning (.Net platform using C#)
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.