Page 1 of 1

Delphi EventHandler Demo

Posted: Tue Feb 18, 2020 2:40 pm
by phaeteon
Ha anyone used a Eventhandler on Delphi?
var
_NativePDF: GDPicturePDF;
__GdPicturePDF1: __GdPicturePDF; //seem to be the definition of EventHandler
begin
_NativePDF.NewPDF;
_NavePDF.LoadFromFile(xxx,false)

__GdPicturePDF1.OcrPagesProgress:=???? how to combine with _NativePDf ?

_NativePDF.OcrPagesProgress:=OcrPagesProgressEvent;
_NativePDF.OcrPages_4('*',8,'deu',DictPath,'',300,OCRMode_FavorAccuracy, 30000, True);

Re: Delphi EventHandler Demo

Posted: Wed Feb 19, 2020 2:42 pm
by Loïc
I tried to figure out how to achieve that with no success...
The event definitions are located into the __GdPicturePDF class.
My assumption is we have to query __GdPicturePDF interface from an ole object instance like this:


definition part:

Code: Select all

  public
     FGdPicturePDF : GdPicturePDF;
     FGdPicturePDFEvents :  __GdPicturePDF;
initialization:

Code: Select all

 FGdPicturePDF :=  CreateOleObject('GdPicture14.GdPicturePDF') as GdPicturePDF;
  FGdPicturePDF.QueryInterface( __GdPicturePDF, FGdPicturePDFEvents);

  FGdPicturePDFEvents.PageBitmapOcrReady := PageBitmapOcrReady; <--------- I am stuck there. Have no f****** idea how to subscribe the event...

Will try to find some competences around, if I can obtain anything I will report here...