diff options
author | Kurt Jung <kurt.w.jung@gmail.com> | 2015-07-04 14:29:28 -0400 |
---|---|---|
committer | Kurt Jung <kurt.w.jung@gmail.com> | 2015-07-04 14:29:28 -0400 |
commit | c511ba94fa811ac07496f2ec8858f62f7bf2a7e4 (patch) | |
tree | 0a910b223f8bc1e82e88ab0fd182c610aea3d78f /fpdf_test.go | |
parent | fc0728dfdeebace8a2ea23d62fa05fa2cbadbe98 (diff) | |
parent | 530dba8469726219691bbb3d72c283d3bb233922 (diff) |
Merge branch 'stanim-master'
Multi-segment path drawing with context-aware joins. Contributed by
stanim.
Diffstat (limited to 'fpdf_test.go')
-rw-r--r-- | fpdf_test.go | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/fpdf_test.go b/fpdf_test.go index 3439f91..8959ece 100644 --- a/fpdf_test.go +++ b/fpdf_test.go @@ -1451,10 +1451,28 @@ func ExampleFpdf_tutorial29() { pdf.AddFont("Calligrapher", "", "calligra.json") pdf.AddPage() pdf.SetFont("Calligrapher", "", 35) - pdf.Cell(0, 10, "Enjoy new fonts with FPDF!") + pdf.Cell(0, 10, "Load fonts from any source") pdf.OutputAndClose(docWriter(pdf, 29)) // Output: // Generalized font loader reading calligra.json // Generalized font loader reading calligra.z // Successfully generated pdf/tutorial29.pdf } + +// This example demonstrates the Path Drawing functions, such as: MoveTo, +// LineTo, CurveTo, ..., ClosePath and DrawPath. +func ExampleFpdf_tutorial30() { + 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, 30)) + // Output: + // Successfully generated pdf/tutorial30.pdf +} |