You are not logged in.
Pages: 1
I modify the code :
procedure TForm1.Button2Click(Sender: TObject);
var
testpdf:TPdfDocumentGDI;
tmprect:TRect;
begin
testpdf:=TPdfDocumentGDI.Create;
try
testpdf.NewDoc;
try
testpdf.AddPage;
image1.Picture.LoadFromFile('c:\pictest.jpg'); //Image1: TImage;
testpdf.ForceJPEGCompression:=30;
tmprect.Left:=0;
tmprect.Top:=0;
tmprect.Bottom:=image1.Height;
tmprect.Right:=image1.Width;
testpdf.VCLCanvas.StretchDraw(tmprect,image1.Picture.Graphic);
finally
testpdf.SaveToFile('test.pdf');
end;
finally
testpdf.Free;
end;
end;
the file of test.pdf isn't correct(The size of test.pdf is only 1k and Adobe Reader 9 can't open test.pdf);
I want to append a page to an exists pdf file ,how can i do?
Hello:
My software need convet some jpg file to a pdf file,i try it to use the code:
procedure TForm1.Button2Click(Sender: TObject);
var
testpdf:TPdfDocumentGDI;
begin
testpdf:=TPdfDocumentGDI.Create;
try
testpdf.NewDoc;
try
testpdf.AddPage;
image1.Picture.LoadFromFile('c:\pictest.jpg'); //Image1: TImage;
testpdf.VCLCanvas.Draw(0,0,image1.Picture.Graphic);
finally
testpdf.SaveToFile('test.pdf');
end;
finally
testpdf.Free;
end;
end;
but i don't know the way is correct?
btw: should write more example to show how to use the componet
Pages: 1