DynaPDF Manual - Page 332

Previous Page 331   Index   Next Page 333

Function Reference
Page 332 of 839
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: DeleteXFAForm, DrawArc

Next topic: DrawArcEx, DrawChord