You are not logged in.
Pages: 1
Great help here !
Thanks !
HI,
I use the code :
procedure TForm1.btnPDFClick(Sender: TObject);
var
fichier: string;
testpdf:TPdfDocumentGDI;
page: TPdfPage;
bmp: TBitmap;
begin
if not PromptForFilename(fichier) then
Exit;
testpdf := TPdfDocumentGDI.Create;
try
testpdf.NewDoc;
testpdf.DefaultPaperSize := psA4;
try
page := testpdf.AddPage;
testpdf.ForceJPEGCompression := 75;
bmp := TBitmap.Create;
bmp.LoadFromFile(fichier);
testpdf.VCLCanvas.StretchDraw(Rect(10, 10, page.PageWidth - 20, page.PageWidth - 20), bmp);
bmp.free;
finally
testpdf.SaveToFile('d:\test.pdf');
end;
finally
testpdf.Free;
end;
end;
But the pageSize is not correct. The margins are not good. The image is only on a half part of page.
How can I get the real pagesize to adjust the picture to the page please ?
Papy
Pages: 1