Page 1 of 1
Error on TwainAddGdPictureImageToPdfOCR
Posted: Fri Jan 15, 2010 5:10 pm
by esseredigi
Hi,
I'm a Delphi developer and I've tried to use Tesseract OCR but using method in subject I catch this error:
Object variable or with block variable not set
What's happened?
Thanks
--
Alfredo Silvano
Re: Error on TwainAddGdPictureImageToPdfOCR
Posted: Fri Jan 15, 2010 5:38 pm
by Loïc
Hi,
Please, check first you are using the latest edition.
If the problem persists, try to give us a way to reproduce your problem.
With best regards,
Loïc
Re: Error on TwainAddGdPictureImageToPdfOCR
Posted: Fri Jan 22, 2010 4:19 pm
by esseredigi
Hi,
Loïc wrote:Hi,
Please, check first you are using the latest edition.
If the problem persists, try to give us a way to reproduce your problem.
With best regards,
Loïc
nothing to do, with last version, same result.
For reproduce this problem, you can put a TButton and a TMemo on your Delphi demo program with this source:
Code: Select all
procedure TForm1.btn1Click(Sender: TObject);
var
imgH: Integer;
DictPath: string;
begin
InitScanConfig;
if Twain1.TwainOpenDefaultSource then
begin
Twain1.TwainSetAutoFeed(True);
Twain1.TwainSetAutoScan(True);
Twain1.TwainSetCurrentResolution(400);
Twain1.TwainSetCurrentPixelType(TWPT_GRAY);
Twain1.TwainSetCurrentBitDepth(8);
Twain1.TwainEnableDuplex(False);
Twain1.TwainSetPaperSize(A4);
Twain1.TwainPdfStart('C:\Users\MyUser\Desktop\ocr.pdf','','','','');
DictPath := ExtractFilePath(ParamStr(0)) + 'ocrdata';
While Twain1.TwainAcquireToGdPictureImage(Handle) <> 0 do
Begin
imgH := Twain1.GetNativeImage;
ApplyImageFilters(imgH);
If chkPreview.Checked Then DisplayNativeImage;
Memo1.Text := Twain1.TwainAddGdPictureImageToPdfOCR(imgH,TesseractDictionaryItalian,
DictPath,'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-/\()');
Twain1.CloseImage(imgH);
end;
Twain1.TwainPdfStop;
Twain1.TwainCloseSource;
end;
end;
Thanks
--
Alfredo Silvano
Re: Error on TwainAddGdPictureImageToPdfOCR
Posted: Fri Jan 22, 2010 8:04 pm
by Loïc
Hi,
Please replace:
by:
With best regards,
Loïc
Re: Error on TwainAddGdPictureImageToPdfOCR
Posted: Tue Jan 26, 2010 4:12 pm
by esseredigi
Loïc wrote:Hi,
Please replace:
by:
With best regards,
Loïc
Ok, now run correctly, but OCR doesn't check on dictionary, what else?
Thanks
Re: Error on TwainAddGdPictureImageToPdfOCR
Posted: Tue Jan 26, 2010 4:16 pm
by Loïc
Hi,
I don't understand your new issue. Could you give me more details ?
Kind regards,
Loïc