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
 TBitmap to PDF File

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
jeffp Posted - Aug 02 2026 : 09:34:00
I'm trying to quickly turn a TBitmap into a PDF file with the code below.

However, the resulting PDF file contains my bitmap BUT IT'S BLANK. What am I missing here?


function EN_BitmapToPDFFile2(ABitmap: TBitmap; AFileName: String; const AInchesW: Double = cLetterWidth; const AInchesH: Double = cLetterHeight): String;
var
  B: TIEBitmap;
begin
  B := TIEBitmap.Create;
  try
    B.CopyFromTBitmap(ABitmap, TRUE);
    B.IO.CreatePDFFile(AFileName);
    B.IO.Params.PDF_PaperWidth := Ceil(I2P(AInchesW));
    B.IO.Params.PDF_PaperHeight := Ceil(I2P(AInchesH));
    B.IO.Params.PDF_ImageOptions := [iepioShrinkOnly, iepioCentered];
    B.IO.Params.JPEG_Quality := 75;
    B.IO.Params.PDF_Compression := ioPDF_JPEG;

    B.IO.SaveToPDF;
    B.IO.ClosePDFFile;
  finally
    B.Free;
  end;
end;


jp
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 03 2026 : 00:34:07
Hi Jeff

Your code works fine for me (with and without iepdf32.dll). What is the ABitmap.PixelFormat? It should be a valid format, like pf24bit, not pfDevice.

Try saving B (or using our debugging visualizer) to ensure it is valid after B.CopyFromTBitmap().

Nigel
Xequte Software
www.imageen.com