summaryrefslogtreecommitdiff
path: root/fpdf_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'fpdf_test.go')
-rw-r--r--fpdf_test.go20
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
+}