From cb9b6b05fca2d3154237d94eae678b8c97a2604e Mon Sep 17 00:00:00 2001 From: Kurt Jung Date: Tue, 13 Aug 2013 18:28:16 -0400 Subject: =?UTF-8?q?Gradient=20support=20adapted=20from=20the=20FPDF=20grad?= =?UTF-8?q?ients=20script=20by=20Andreas=20W=C3=BCrmser.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fpdf_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'fpdf_test.go') 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 +} -- cgit v1.2.1-24-ge1ad