diff options
author | Stani <spe.stani.be@gmail.com> | 2015-06-23 11:23:31 +0200 |
---|---|---|
committer | Stani <spe.stani.be@gmail.com> | 2015-06-23 11:23:31 +0200 |
commit | ae8e6c604c3b6fdd21328cf7c58c5f28093f9cd3 (patch) | |
tree | 4cbf9c5417cd0b66804a0f20797f48702b0f2efe /fpdf_test.go | |
parent | 5ab948816dec877984e3c1c031f423cb7fccf30f (diff) |
Added path drawing methods:
- MoveTo
- LineTo
- CurveTo
- CurveBezierCubicTo
- ClosePath
- DrawPath
Diffstat (limited to 'fpdf_test.go')
-rw-r--r-- | fpdf_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fpdf_test.go b/fpdf_test.go index f8df0c3..a99fd2d 100644 --- a/fpdf_test.go +++ b/fpdf_test.go @@ -1425,3 +1425,21 @@ func ExampleFpdf_tutorial28() { // Successfully generated pdf/tutorial28.pdf } + +// This example demonstrates the Path Drawing functions, such as: +// MoveTo, LineTo, CurveTo, ..., ClosePath and DrawPath. +func ExampleFpdf_tutorial29() { + pdf := gofpdf.New("P", "mm", "A4", "") + pdf.AddPage() + pdf.MoveTo(20, 20) + pdf.LineTo(190, 20) + pdf.CurveTo(190, 100, 105, 100) + pdf.CurveBezierCubicTo(20, 100, 105, 200, 20, 200) + pdf.ClosePath() + pdf.SetFillColor(200, 200, 200) + pdf.SetLineWidth(3) + pdf.DrawPath("DF") + pdf.OutputAndClose(docWriter(pdf, 29)) + // Output: + // Successfully generated pdf/tutorial29.pdf +} |