summaryrefslogtreecommitdiff
path: root/fpdf_test.go
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@gmail.com>2015-07-04 14:29:05 -0400
committerKurt Jung <kurt.w.jung@gmail.com>2015-07-04 14:29:05 -0400
commit530dba8469726219691bbb3d72c283d3bb233922 (patch)
tree0a910b223f8bc1e82e88ab0fd182c610aea3d78f /fpdf_test.go
parentfc0728dfdeebace8a2ea23d62fa05fa2cbadbe98 (diff)
parentae8e6c604c3b6fdd21328cf7c58c5f28093f9cd3 (diff)
Multi-segment path drawing routines by stanim
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
+}