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"