#2 Re: PDF Engine » DrawBMP and multiple BMP´s ? » 2011-10-06 14:43:50

Here is a short testcode:

procedure TForm1.btn1Click(Sender: TObject);
var
  i, y: integer;
  test: TRect;
  TestImage: TImage;
begin

  with TGDIPages.Create(self) do
  try
    BeginDoc;

    for y := 0 to 4 do
    begin

      DrawTitle(edt1.Text, true);
      for i := 1 to 10 do
        DrawText('This is some text ' + IntToStr(i));
      NewLine;

      try
        TestImage := TImage.Create(self);
        TestImage.Width := 500;
        TestImage.Height := 500;

        TestImage.Canvas.Pen.Color := clRed;
        TestImage.Canvas.MoveTo(0, y * 80);
        TestImage.Canvas.LineTo(TestImage.Width, y * 80);

        DrawBMP(TestImage.Picture.Bitmap, maxInt, RightMarginPos);
      finally
        TestImage.Free;
      end;

      NewPage;
    end;

    EndDoc;
    ExportPDF('test.pdf', true, true);
  finally
    Free;
  end;
end;

As you can see the pdf should include 5 pages with 5 different bmp´s. If i use this code i have  different bmp´s on page 1,2 and 3. 4 and 5 have the same bmp as page 2.

Here is my SqLite3Pages.pas

http://willyou.typewith.me/ro/r.JECHaT7GRujDFJ6H

I modified it a little bit but i have changed nothin with the DrawBmp handling.

#3 PDF Engine » DrawBMP and multiple BMP´s ? » 2011-10-06 08:52:41

Blamaster
Replies: 4

Hello,

i have a little problem. I have 4 pages. If i draw a different BMP on each of the 4 pages the preview shows the pages correctly but if i save the pages as a pdf i have the same BMP on many pages.

Is there any solution to solve the problem ?

Thanks,
Yannic Wilkening

Board footer

Powered by FluxBB