Xojo Conferences
MBSOct2019CologneDE

DynaPDF Manual - Page 297

Previous Page 296   Index   Next Page 298

Function Reference
Page 297 of 767
Example (Delphi):
implementation
uses dynapdf;
procedure TForm1.Button1Click(Sender: TObject);
var pdf: TPDF;
begin
pdf := nil;
try
pdf := TPDF.Create;
// Declaration of the error callback (see SetOnErrorProc())
pdf.SetOnErrorProc(nil, @ErrProc);
pdf.CreateNewPDF('c:\dout.pdf');
pdf.SetDocInfo(diCreator, 'Delphi sample project');
pdf.SetDocInfo(diSubject, 'How to draw an arc segment');
pdf.SetDocInfo(diTitle, 'Vector graphics');
pdf.Append;
pdf.SetStrokeColor(clBlue);
pdf.SetFillColor($00FFCFCF);
pdf.SetDrawDirection(ddClockwise);
pdf.MoveTo(250, 500);
pdf.DrawArc(250, 500, 50, 30, 60);
pdf.ClosePath(fmFillStroke);
pdf.SetDrawDirection(ddCounterClockwise);
pdf.SetStrokeColor($0000A600);
pdf.SetFillColor($00DDFFDD);
pdf.MoveTo(255, 505);
pdf.DrawArc(250, 500, 50, 33, 57);
pdf.ClosePath(fmFillStroke);
pdf.EndPage;
pdf.CloseFile;
except
on E: Exception do MessageDlg(E.Message, mtError, [mbOK], 0);
end;
if pdf <> nil then pdf.Free;
end;
Output:
 

Previous topic: DrawArc

Next topic: DrawCircle