Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, August 10, 2006 8:50:32 AM(UTC)

Anze  
Anze

Groups: Registered
Posts: 1


Hello!

I am new to this forum and still a bit new to programming so please be gentle :)
I am currently programming in Delphi (which I am new to) and would like to know how to :

- Reset the LEADRasterDocument

(Explanation: I am developing an application which scans and OCRs a document and saves it into a PDF, what do I need now is like a Reset function so i can clear all the pages from LEADRasterDocument and do the scanning again...)

- Set the pagecount on LEADRasterTwain

(Explanation: I would like to scan and than acquire them without the driver's GUI intervention)

Thank you for your replys...
Anze
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, August 13, 2006 5:49:54 AM(UTC)

Qasem Lubani  
Guest

Groups: Guests
Posts: 3,034

Was thanked: 2 time(s) in 2 post(s)

Hello,
Regarding the part "Reset the LEADRasterDocument" you can call the RemovePage()   Method  which removes the specified page from the OCR document.
Please refer to our "OCR COM Objects help file" Delphi Tutorials for complete samples on using LEADTOOLS OCR COM with Delphi 4.0 and later.

For the second part, in order to acquire a page without showing the manufacturer's user interface, you need to set the uFlags parameter for the Acquire Method to LTWAIN_SHOW_NONE. To restrict the page count, set the CAP_XFERCOUNT capability to the desired number. Here's a code sample that does this using our VCL Twain control:

function TForm1.LEADTwain1AcquirePageEvent(Bitmap: TBitmapHandle): Integer;
begin
   LEADImage1.Bitmap := Bitmap;
   Result := SUCCESS;
end;

procedure TForm1.TestXferCount();
var
   nRet: L_INT;
   twCap: TW_CAPABILITY;
begin
   LEADTwain1.InitSession(Handle);
   // Show the Twain Select Source UI
   nRet := LEADTwain1.SelectSource();
   If(nRet <> SUCCESS) then
   Begin
      ShowMessage('Error occurred while selecting the source.');
      Exit;
   End;

   twCap.Cap:= CAP_XFERCOUNT;
   twCap.ConType:= TWON_ONEVALUE;

   LEADTwain1.CreateNumericContainerOneValue (@twCap, TWAINNUMERICTYPE_TW_INT16, 5); // Set the capability to scan 5 pages, for example

   nRet := LEADTwain1.SetCapability(@twCap, LTWAIN_CAPABILITY_SET);
   LEADTwain1.FreeContainer(@twCap);
   LEADTwain1.EnableAcquirePageEvent := True;
   nRet := LEADTwain1.Acquire(LTWAIN_SHOW_NONE);
end;


For more information Please refer to our "Twain VCL Help File"
 
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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.241 seconds.