I use the following code to export a TBitmap image to PDF file.
Code
var WP: TWPCustomRTFEdit; WPDF: TWPPDFExport; res: word;
begin
WP:= TWPCustomRTFEdit.CreateDynamic;
WPDF:= TWPPDFExport.Create(nil);
wpe.Source:= wp;
wpe.AutoLaunch := TRUE;
wpe.Filename:= fn;
res:= Screen.PixelsPerInch;
wpe.BeginDoc();
wpe.StartPage(Bmp.Width, Bmp.Height, res, res, 0);
wpe.Canvas.StretchDraw(Rect(0, 0, Bmp.Width, Bmp.Height), Bmp);
wpe.EndPage();
WPE.Print();
wpe.endDoc();
end;
Alles anzeigen
The code works fine except a blank page is added to resulting document every time. How to get rid of that?
Component versions are WPTools 6 and WPDF 2