summaryrefslogtreecommitdiff
path: root/fpdf_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'fpdf_test.go')
-rw-r--r--fpdf_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/fpdf_test.go b/fpdf_test.go
index 494d281..c121260 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -704,3 +704,20 @@ func ExampleFpdf_tutorial11() {
// Output:
// Successfully generated pdf/tutorial11.pdf
}
+
+// Transparency
+func ExampleFpdf_tutorial12() {
+ pdf := New("", "", "", FONT_DIR)
+ pdf.SetFont("Helvetica", "", 48)
+ pdf.SetLineWidth(4)
+ pdf.SetFillColor(180, 180, 180)
+ pdf.AddPage()
+ pdf.SetXY(55, 60)
+ pdf.CellFormat(100, 40, "Go", "1", 0, "C", true, 0, "")
+ pdf.SetAlpha(0.5, "Normal")
+ pdf.Image(IMG_DIR+"/golang-gopher.png", 30, 10, 150, 0, false, "", 0, "")
+ pdf.SetAlpha(1.0, "Normal")
+ pdf.OutputAndClose(docWriter(pdf, 12))
+ // Output:
+ // Successfully generated pdf/tutorial12.pdf
+}