From 7751c17f106d9d7d4c6c290b969ece1c8dab4371 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 12 Nov 2017 14:04:27 -0500 Subject: Add partial support for spot colors. This does not yet include gradients, etc --- fpdf_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'fpdf_test.go') diff --git a/fpdf_test.go b/fpdf_test.go index db46528..76ef558 100644 --- a/fpdf_test.go +++ b/fpdf_test.go @@ -2046,3 +2046,17 @@ func ExampleFpdf_SetJavascript() { // Output: // Successfully generated pdf/Fpdf_SetJavascript.pdf } + +// This example demonstrates spot color use +func ExampleFpdf_AddSpotColor() { + pdf := gofpdf.New("P", "mm", "A4", "") + pdf.AddSpotColor("PANTONE 145 CVC", 0, 42, 100, 25) + pdf.AddPage() + pdf.SetFillSpotColor("PANTONE 145 CVC", 90) + pdf.Rect(80, 40, 50, 50, "F") + fileStr := example.Filename("Fpdf_AddSpotColor") + err := pdf.OutputFileAndClose(fileStr) + example.Summary(err, fileStr) + // Output: + // Successfully generated pdf/Fpdf_AddSpotColor.pdf +} -- cgit v1.2.1-24-ge1ad