program CanvasDraw;

{$APPTYPE CONSOLE}

uses

SysUtils, Graphics, Classes, HPDFDoc;

 

var

I, Y: Integer;

HPDF: THotPDF;

 

begin

HPDF:= THotPDF.Create(nil);

try

Randomize;

HPDF.AutoLaunch := true; // PDF-tiedosto näytetään automaattisesti

HPDF.FileName := 'Canvas Drawing.pdf';

HPDF.BeginDoc; // Create PDF file

HPDF.Canvas.Font.Size := 15; // Aseta kankaan fonttikoko

I :=20;

Y := 40;

HPDF.Canvas.TextOut(10, 10, 'Canvas Ellipses'); // Tulosta teksti

while I <= 520 do // Draw color

begin // ellipses

HPDF.Canvas.Brush.Color := random($FFFFFF) //

HPDF.Canvas.Ellipse(I, Y, I+90, Y + 160);

Inc(I, 30);

Inc( Y, 3 );

end;

HPDF.EndDoc; // Close PDF file

finally

HPDF.Free;

end;

end