Error on TwainAddGdPictureImageToPdfOCR
-
- Posts: 3
- Joined: Fri Jan 15, 2010 5:05 pm
Error on TwainAddGdPictureImageToPdfOCR
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
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
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
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
-
- Posts: 3
- Joined: Fri Jan 15, 2010 5:05 pm
Re: Error on TwainAddGdPictureImageToPdfOCR
Hi,
For reproduce this problem, you can put a TButton and a TMemo on your Delphi demo program with this source:
Thanks
--
Alfredo Silvano
nothing to do, with last version, same result.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
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;
--
Alfredo Silvano
Re: Error on TwainAddGdPictureImageToPdfOCR
Hi,
Please replace:
by:
With best regards,
Loïc
Please replace:
Code: Select all
TwainPdfStart
Code: Select all
TwainPdfOCRStart
Loïc
-
- Posts: 3
- Joined: Fri Jan 15, 2010 5:05 pm
Re: Error on TwainAddGdPictureImageToPdfOCR
Ok, now run correctly, but OCR doesn't check on dictionary, what else?Loïc wrote:Hi,
Please replace:
by:Code: Select all
TwainPdfStart
With best regards,Code: Select all
TwainPdfOCRStart
Loïc
Thanks
Re: Error on TwainAddGdPictureImageToPdfOCR
Hi,
I don't understand your new issue. Could you give me more details ?
Kind regards,
Loïc
I don't understand your new issue. Could you give me more details ?
Kind regards,
Loïc
Who is online
Users browsing this forum: No registered users and 0 guests