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
 Crash when using LoadFromFile with pdf files

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
Coenenp Posted - Nov 20 2025 : 11:37:26
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
2   L A T E S T    R E P L I E S    (Newest First)
Coenenp Posted - Nov 21 2025 : 03:43:20
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
xequte Posted - Nov 20 2025 : 14:39:44
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