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