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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Crash when using LoadFromFile with pdf files
 New Topic  Reply to Topic
Author  Topic Next Topic  

Coenenp

Belgium
2 Posts

Posted - Nov 20 2025 :  11:37:26  Show Profile  Reply
Hi,

I'm using the latest version 14.2.7 and received feedback from a customer that my tool crashes regurlarly. He uses my tool to adjust pdf parameters and it seems to happen when loading the pdf file.

Log information from my tool when the problem starts:

2025-11-20 10:50:22 OutputIMG, Load Image from R:\ttlev\in\sudoko_scale\2-easy_sol.pdf error, FileType: Adobe PDF (PDF)

I'm using the following code:



      // Load IMG file
      tmpIEBmp := TIEBitmap.Create;
      tmpEnIO := TImageEnIO.CreateFromBitmap(tmpIEBmp);
      Try
        // https://www.imageen.com/help/index.php?topic=TIOParams.IPTC_Info&m=11
        // Load From File
        Try
          // Init FileType
          tmpInputfType := 'Unknown';
          // Do LoadFromFile
          tmpEnIO.LoadFromFile(tmpInputf, True);
          tmpInputfType := tmpEnIO.Params.FileTypeStr;
          // Check FileType
          If Trim(tmpInputfType) = '' Then
            tmpInputfType := 'Unknown';
          // Aborting can also be read after loading or saving to determine if an error or abort occured
          If Not tmpEnIO.Aborting Then
          Begin
            // Debug
            tmpInfo := Format('OutputIMG, Load Image from %s successful, FileType: %s', [tmpInputf, tmpInputfType]);
            UpdateLogging(0, IdLogLevInf, DefLogIMGPut, tmpInfo);
          End
          Else
          Begin
            tmpSuccess := False;
            // check
            tmpOSError := Winapi.Windows.GetLastError;
            // Debug
            If tmpOSError = 0 Then
              tmpInfo := Format('OutputIMG, Load Image from %s error, FileType: %s', [tmpInputf, tmpInputfType])
            Else
              tmpInfo := Format('OutputIMG, Load Image from %s error: %s, FileType: %s', [tmpInputf, SysErrorMessage(tmpOSError), tmpInputfType]);
            UpdateLogging(0, IdLogLevErr, DefLogIMGPut, tmpInfo);
          End;
        Except
          On e: Exception Do
          Begin
            tmpSuccess := False;
            // Debug
            tmpInfo := Format('OutputIMG, Load Image from %s exception: %s', [tmpInputf, Trim(e.Message)]);
            UpdateLogging(0, IdLogLevErr, DefLogIMGPut, tmpInfo);
          End;
        End;



It seems to happen in the iepdf64.dll



Any idea what I'm doing wrong?

Regards,
Pascal

xequte

39255 Posts

Posted - Nov 20 2025 :  14:39:44  Show Profile  Reply
Hi Pascal

Your code looks fine. Does the issue happen randomly, or always with certain PDF files? If so, please forward or post a sample.

Also, please confirm what version of iepdf64.dll you are using:

ShowMessage( IEGlobalSettings().ImageEnVersion.Status );

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Coenenp

Belgium
2 Posts

Posted - Nov 21 2025 :  03:43:20  Show Profile  Reply
Hi,

Happens randomly.

Also, please confirm what version of iepdf64.dll you are using: 140.0.7269.0 (06/07/2025 14:40)

I received the following information from the customer. He added an extra option to check if the source pdf file in still in use before loading the pdf files using LoadFromFile. Since then no crash anymore. But ImageEn should never crash even if a source file is still in use by another process, not?

Regards,
Pascal
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
Jump To: