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 file will shown automatically

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

HPDF.BeginDoc;                                             // ایجاد فایل PDF

HPDF.Canvas.Font.Size := 15;                         // Set canvas font size

I :=20;

Y := 40;

HPDF.Canvas.TextOut(10, 10, 'Canvas Ellipses');        //  Print text

while I <= 520 do                                                   //  ترسیم

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;                                                // بستن فایل PDF

finally

HPDF.Free;

   end;

end.