ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 CreateSearchablePDF error at addPage

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
jalbrecht Posted - May 03 2024 : 05:14:53
Heloo,

I have the following code :

if ImageEnView1.ImageCount > 1 then
begin
    PDf_TIT := 'TATA';
    TheList := TStringlist.Create;
    for i :=0 to length(ImageEnView1.MultiSelectedImagesList)-1 do
    begin
       if fileexists(ImageEnView1.ImageFileName[ImageEnView1.MultiSelectedImages[i]]) then
          TheList.Add(ImageEnView1.ImageFileName[ImageEnView1.MultiSelectedImages[i]] );
    end;

    iev:= TIEMultiBitmap.Create();
    iev.FillFromList(TheList);
    iev.CreateSearchablePDF(FileName , PDf_TIT ) ;

    iev := nil;
    TheList.Free;
end;

And I get an exception when it passes on
pdfGen.addPage( bmp.GetIEVisionImage(), ImageFormat ); in iexHelperFunctions.

I have checked my JPG and they are all here.
I have IEVISION in the correct directory.

Please heeeeelp !!

Thansk in advandce.
11   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - May 21 2024 : 19:12:07
Glad to hear you go to the bottom of it.

Sorry, I neglected to mention that there is a fix in the current beta for LanguageExistsInFolder() to make it check the current path, rather than the EXE one.


Nigel
Xequte Software
www.imageen.com
jalbrecht Posted - May 21 2024 : 04:29:47
Hi Nigel,

it worked as soon as I put this :
langCode := 'eng' ;
langPath := IncludeTrailingBackSlash(ExtractFilePath(Application.ExeName));

Instead the code from the example :

            if LanguageExistsInFolder(langCode, langPath) then
            begin
              SetCurrentDir( langPath );
              langPath := ''; // Language is in current path (support for paths with non-ansi characters)
            end
            else
            begin
               ShowMessage(' Language is in current path (support for paths with non-ansi characters) : not found');
               Exit;
            end;

I also put a local TImageEnMView instead using the one that displayed my images.

It works now fine !

Thanks and best regards.
xequte Posted - May 17 2024 : 00:15:44
Hmmm, it may not be the same issue as we have seen.

Try removing this code...

            if LanguageExistsInFolder(langCode, langPath) then
            begin
              SetCurrentDir( langPath );
              langPath := ''; // Language is in current path (support for paths with non-ansi characters)
            end
            else
            begin
               ShowMessage(' Language is in current path (support for paths with non-ansi characters) : not found');
               Exit;
            end;


And use a full path to the language files.

Email us those five test files too.

Nigel
Xequte Software
www.imageen.com
jalbrecht Posted - May 16 2024 : 04:45:40
---------------------------
Here what I get
---------------------------

An error was encountered processing this image. Ensure you are using the latest version of the IEVision plug-in.
Violation d'accès à l'adresse 0E127F28 dans le module 'ievision.dll'. Lecture de l'adresse 00000008

File found \\C5\G\GHSC\F-ZBPA\NI 000161\BV 100H\0_20230421120019831_000469.JPG
File found \\C5\G\GHSC\F-ZBPA\NI 000161\BV 100H\0_20230421120021648_000471.JPG
File found \\C5\G\GHSC\F-ZBPA\NI 000161\BV 100H\0_20230421120023322_000473.JPG
File found \\C5\G\GHSC\F-ZBPA\NI 000161\BV 100H\0_20230421120025153_000475.JPG
File found \\C5\G\GHSC\F-ZBPA\NI 000161\BV 100H\0_20230421120026919_000477.JPG

---------------------------
jalbrecht Posted - May 16 2024 : 04:43:01
Hi and thnk you/
So far no improvment.
Here is what I have now :

procedure Tmain1.BtnExportutuClick(Sender: TObject);
var
  typerech, compression : integer;
  FileName, PDf_TIT: string;
  i, p: integer;
  bmp : tiebitmap;
  iev:TIEVisionSearchablePDFGenerator;
  IEBitmap : TIEVisionImage ;
  newfilename,  fichier : string;
  TheList : TStringlist;
  langPath: string;
  langCode: string;
  old_CurrentDir : string;
begin
 //https://www.imageen.com/help/index.php?topic=TIEVisionSearchablePDFGenerator&m=2
 //    (Size: iepA4;      Name: 'A4';         Width: 595;  Height: 842),

//  ImageEnView2: TImageEnDBView;
//  ImageEnView1: TImageEnMView;
{
      in to formCreate :
      fDBMBitmap : TIEDBMultiBitmap;
      fDBBitmap : TIEDBBitmap;

      ImageEnView1.SetModernStyling;
      fDBMBitmap := TIEDBMultiBitmap.create( udm1.DS_fi_Img , '', 'CHEMIN_CPL', dmAllRecords ); //The file name is complete in field CHEMIN_CPL

CHEMIN_CPL is like '\\C5\G\GHSC\F-ZBPA\NI 000007\BV 050H\0_20230421143226408_000244.JPG'

      fDBMBitmap.ImagePath             := '';
      fDBMBitmap.FollowDBCursor        := True;
      fDBMBitmap.AutoLoad              := true;
      fDBMBitmap.mode                  := dmAllRecords ;

      ImageEnView1.SetExternalMBitmap( fDBMBitmap );
      imageEnView1.DefaultTopText := iedtCustom;
}

   old_CurrentDir := GetCurrentdir ;
   FwaitForm.wait(true);
    try
        if ImageEnView1.ImageCount > 0 then
        begin

            langCode := string(IEVisionLanguageNameToCode(IEOCRLanguageList[OCR_English_language].DisplayName));
            langPath := IncludeTrailingBackSlash(ExtractFilePath(Application.ExeName));

            if LanguageExistsInFolder(langCode, langPath) then
            begin
              SetCurrentDir( langPath );
              langPath := ''; // Language is in current path (support for paths with non-ansi characters)
            end
            else
            begin
               ShowMessage(' Language is in current path (support for paths with non-ansi characters) : not found');
               Exit;
            end;

            JvSaveDialog1.FileName := udm1.fi_Img.FieldByName('REG').AsString+'-'+udm1.fi_Img.FieldByName('CHECKS_NUMBER').AsString+'-'+udm1.fi_Img.FieldByName('WORK_ORDER').AsString+'.pdf';
            JvSaveDialog1.Execute;
            FileName := JvSaveDialog1.FileName;

            if FileName <> '' then
            begin
                ShowTempHourglass();
                PDf_TIT := udm1.fi_Img.FieldByName('REG').AsString+' - '+udm1.fi_Img.FieldByName('CHECKS_NUMBER').AsString+' - '+udm1.fi_Img.FieldByName('WORK_ORDER').AsString ;
                iev := IEVisionLib.createSearchablePDFGenerator(PAnsiChar(AnsiString(langPath)), PAnsiChar(AnsiString(langCode)) );
                iev.beginDocument( PWideChar( FileName ), PAnsiChar(AnsiString(PDf_TIT )));

                if length(ImageEnView1.MultiSelectedImagesList) = 0 then
                   ImageEnView1.SelectAll;

                if ImageEnView1.ImageCount > 1 then
                begin
                    TheList := TStringlist.Create;
                    for i :=0 to length(ImageEnView1.MultiSelectedImagesList)-1  do
                    begin
                       if fileexists(ImageEnView1.ImageFileName[ImageEnView1.MultiSelectedImages[i]]) then
                          TheList.Add('File found ' + ImageEnView1.ImageFileName[ImageEnView1.MultiSelectedImages[i]] )
                       else
                          TheList.Add('File not found ' + ImageEnView1.ImageFileName[ImageEnView1.MultiSelectedImages[i]] );
                    end;
                    for i :=0 to length(ImageEnView1.MultiSelectedImagesList) -1  do
                    begin
                       if fileexists(ImageEnView1.ImageFileName[ImageEnView1.MultiSelectedImages[i]]) then
                       begin
                          ImageEnView1.SelectedImage := i;
                          Application.ProcessMessages;
                          IEBitmap := ImageEnView1.IEBitmap.GetIEVisionImage();
                          iev.addPage(IEBitmap, ievPDFImgFmt_AUTO) ;
                          if cxMemo1.Visible then
                            cxMemo1.lines.Add(ImageEnView1.ImageFileName[ImageEnView1.MultiSelectedImages[i]] );
                       end;
                    end;
                    iev.endDocument();

                    iev := nil;
                    TheList.Free;
                end;
            end;
        end
        else
            showmessage('no image displayed');
        application.processmessages;
    except
        on E: Exception do
        begin
           if E is EAccessViolation then
            MessageDlg('An error was encountered processing this image. Ensure you are using the latest version of the IEVision plug-in.'+e.message+rc+TheList.text, mtError, [mbOK], 0)
          else
            MessageDlg('An error was encountered processing this image: ' + e.message, mtError, [mbOK], 0);
        end;
    end;
    SetCurrentDir(old_CurrentDir);
  FwaitForm.wait(False);
end;
xequte Posted - May 15 2024 : 21:35:06
Note that in the demos we've updated the language path code as follows:

  // look for ?.traineddata directory
  langCode := string(IEVisionLanguageNameToCode(cmbLanguage.Text));
  langPath := IncludeTrailingBackSlash(ExtractFilePath(Application.ExeName));
  if LanguageExistsInFolder(langCode, langPath) then
  begin
    // Language is in exe path. Pass as '' to support for paths with non-ansi characters
    SetCurrentDir( langPath );
    langPath := '';
  end
  ...


Nigel
Xequte Software
www.imageen.com
xequte Posted - May 14 2024 : 19:01:40
Hi

We cannot reproduce that here, but ensure that if you're not passing a full path to eng.traineddata (e.g. passing just "eng.traineddata" when you call CreateSearchablePDF) that the current directory is the path of eng.traineddata,

i.e.
SetCurrentDir( langPath );


Nigel
Xequte Software
www.imageen.com
jalbrecht Posted - May 10 2024 : 10:35:25
Hi Nigel,

thank you for your reply.
I have tried with the last versions of everything and the the project in the Demos.

It works only when the files are local.
As soon as the files are on a network (\\servername\d\) it throws an exception with the message :

[Window Title]
Error
[Content]
An error was encountered processing this image. Ensure you are using the latest version of the IEVision plug-in.
[OK]

PS: I work with 43.000.000.000 of jpeg files, so I can not afford to copy them elsewhere.


Many thanks for your help.
Best regards.


xequte Posted - May 07 2024 : 21:30:15
Hi

That is all as expected. Please create a small demo that shows the issue with the relevant sample files and email it to me.

You might also want to try 8.1.1 which fixes some issues with GenerateSearchablePDF.


Nigel
Xequte Software
www.imageen.com
jalbrecht Posted - May 07 2024 : 03:42:52
Hi Nigel,

here is the result of the loading :

IEVISION INITIALIZATION...
\\c5\G\GHSC\ADS\ievision.dll: 0
\\c5\G\GHSC\ADS\ievision32.dll: 222101504
IEVision Version: 8.1.0.0
IEVision Create: ok
IELIB INITIALIZATION...
\\c5\G\GHSC\ADS\ievision.dll: 0
\\c5\G\GHSC\ADS\ievision32.dll: 222101504
IELib Version: 8.1.0.0
IELib Create: ok
IELANG INITIALIZATION...
\\c5\G\GHSC\ADS\ielang32.dll: 2050555904
IELang Version: 8.1.0.0
IELang Create: ok
PDFIUM INITIALIZATION...
PDFium Loaded successfully...
IMAGEMAGICK INITIALIZATION...
Not found: \\c5\G\GHSC\ADS\CORE_RL_wand_.dll
CORE_RL_MagickWand_.dll: Loaded
CORE_RL_MagickCore_.dll: Loaded
SEVENZIP INITIALIZATION...
SevenZip Loaded successfully...

Best regards
xequte Posted - May 03 2024 : 22:18:47
Hi

Your code works fine when I test it here.

What is the value of DLLLoadingLog?

https://www.imageen.com/help/TIEGlobalSettings.DLLLoadingLog.html

Can you create a small demo that shows the issue with the relevant sample files and email it to me.


Nigel
Xequte Software
www.imageen.com