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
 Inserting an empty white image
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

lorife

Italy
51 Posts

Posted - Jan 12 2026 :  04:02:57  Show Profile  Reply
Hello,
I have a file (which can be a PDF or a TIF). I need to open it, add an empty white page in a specific position (at the moment is at the end) and then save it.
I tried this:

iemv_OUT.Clear;
iemv_OUT.MIO.LoadFromFile(FullPathIN);
iemv_OUT.InsertImage(0);
iemv_OUT.MIO.SaveToFile(FullPathOUT, 0, False);

but aborting returns true and saves an empty file.

Could you please help me?
thank you

xequte

39327 Posts

Posted - Jan 12 2026 :  15:59:12  Show Profile  Reply
Hi

This works fine when I test it here with a multipage TIFF file (let's resolve TIFFs first, as PDF documents work differently than images).

Does the TIFF content look correct in the TImageEnMView? Maybe also post or forward us your test TIFF file.



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

lorife

Italy
51 Posts

Posted - Jan 15 2026 :  02:36:03  Show Profile  Reply
Hello,
I sent the tiff file in the email because it contains some personal data.
Thanks.
Go to Top of Page

xequte

39327 Posts

Posted - Jan 16 2026 :  00:02:38  Show Profile  Reply
Thanks, I've received your code. If I'm understanding it correctly, the better method is:

      iemv_OUT.Clear();
      iemv_OUT.MIO.LoadFromFile(FullPathIN);

      if posIn >= 9998 then
        posIn := iemv_OUT.ImageCount;

      var x := (if posIn > 0 then posIn - 1 else posIn + 1);

      ww := iemv_OUT.ImageWidth[ x ];
      hh := iemv_OUT.ImageWidth[ x ];
      bmp := TIEBitmap.Create( ww, hh, clWhite );
      iemv_OUT.InsertImage( posIn, bmp );
      bmp.Free();


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

xequte

39327 Posts

Posted - Jan 16 2026 :  00:04:01  Show Profile  Reply
Or in the coming February release, you can just use:

      iemv_OUT.Clear();
      iemv_OUT.MIO.LoadFromFile(FullPathIN);

      if posIn >= 9998 then
        posIn := iemv_OUT.ImageCount;

      var x := (if posIn > 0 then posIn - 1 else posIn + 1);

      ww := iemv_OUT.ImageWidth[ x ];
      hh := iemv_OUT.ImageWidth[ x ];
      iemv_OUT.InsertImage( posIn, ww, hh, ie24RGB, clWhite );


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

lorife

Italy
51 Posts

Posted - Jan 16 2026 :  04:09:46  Show Profile  Reply
Ok it works great, thank you very much!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: