summaryrefslogtreecommitdiff
path: root/fpdf_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'fpdf_test.go')
-rw-r--r--fpdf_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/fpdf_test.go b/fpdf_test.go
index c121260..08dca43 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -721,3 +721,22 @@ func ExampleFpdf_tutorial12() {
// Output:
// Successfully generated pdf/tutorial12.pdf
}
+
+// Gradients
+func ExampleFpdf_tutorial13() {
+ pdf := New("", "", "", FONT_DIR)
+ pdf.SetFont("Helvetica", "", 12)
+ pdf.AddPage()
+ pdf.LinearGradient(0, 0, 210, 100, 250, 250, 255, 220, 220, 225, 0, 0, 0, .5)
+ pdf.LinearGradient(20, 25, 75, 75, 220, 220, 250, 80, 80, 220, 0, .2, 0, .8)
+ pdf.Rect(20, 25, 75, 75, "D")
+ pdf.LinearGradient(115, 25, 75, 75, 220, 220, 250, 80, 80, 220, 0, 0, 1, 1)
+ pdf.Rect(115, 25, 75, 75, "D")
+ pdf.RadialGradient(20, 120, 75, 75, 220, 220, 250, 80, 80, 220, 0.25, 0.75, 0.25, 0.75, 1)
+ pdf.Rect(20, 120, 75, 75, "D")
+ pdf.RadialGradient(115, 120, 75, 75, 220, 220, 250, 80, 80, 220, 0.25, 0.75, 0.75, 0.75, 0.75)
+ pdf.Rect(115, 120, 75, 75, "D")
+ pdf.OutputAndClose(docWriter(pdf, 13))
+ // Output:
+ // Successfully generated pdf/tutorial13.pdf
+}