func ExampleFpdf_SetFillColor() {
	pdf := gofpdf.New("P", "mm", "A4", "")

	pdf.AddPage()
	pdf.SetFont("Arial", "", 8)

	draw := func(trX, trY float64) {
		pdf.TransformBegin()
		pdf.TransformTranslateX(trX)
		pdf.TransformTranslateY(trY)
		pdf.SetLineJoinStyle("round")
		pdf.SetLineWidth(0.5)
		pdf.SetDrawColor(128, 64, 0)
		pdf.SetFillColor(255, 127, 0)
		pdf.SetAlpha(0.5, "Normal")
		pdf.SetDashPattern([]float64{5, 10}, 0)
		pdf.Rect(0, 0, 40, 40, "FD")
		pdf.SetFontSize(12)
		pdf.SetXY(5, 5)
		pdf.Write(0, "Test")
		pdf.TransformEnd()
	}

	draw(5, 5)
	draw(50, 50)

	fileStr := example.Filename("Fpdf_SetFillColor")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
	// Output:
	// Successfully generated pdf/Fpdf_SetFillColor.pdf
}
// ExampleFpdf_SetFillColor demonstrates how graphic attributes are properly
// assigned within multiple transformations. See issue #234.
ExampleFpdf_SetFillColor demonstrates how graphic attributes are properly
assigned within multiple transformations.
// ExampleFpdf_SetFillColor demonstrates how graphic attributes are properly // assigned within multiple transformations . See issue #234 .
func ExampleFpdf_SetFillColor() {
	pdf := gofpdf.New("P", "mm", "A4", "")
	pdf.AddPage()
	pdf.SetFont("Arial", "", 8)
	draw := func(trX, trY float64) {
		pdf.TransformBegin()
		pdf.TransformTranslateX(trX)
		pdf.TransformTranslateY(trY)
		pdf.SetLineJoinStyle("round")
		pdf.SetLineWidth(0.5)
		pdf.SetDrawColor(128, 64, 0)
		pdf.SetFillColor(255, 127, 0)
		pdf.SetAlpha(0.5, "Normal")
		pdf.SetDashPattern([]float64{5, 10}, 0)
		pdf.Rect(0, 0, 40, 40, "FD")
		pdf.SetFontSize(12)
		pdf.SetXY(5, 5)
		pdf.Write(0, "Test")
		pdf.TransformEnd()
	}
	draw(5, 5)
	draw(50, 50)
	fileStr := example.Filename("Fpdf_SetFillColor")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
}
func ExampleFpdf_SetFillColor ( ) { pdf := gofpdf . New ( " " , " " , " " , " " ) pdf . AddPage ( ) pdf . SetFont ( " " , " " , 8 ) draw := func ( trX , trY float64 ) { pdf . TransformBegin ( ) pdf . TransformTranslateX ( trX ) pdf . TransformTranslateY ( trY ) pdf . SetLineJoinStyle ( " " ) pdf . SetLineWidth ( 0.5 ) pdf . SetDrawColor ( 128 , 64 , 0 ) pdf . SetFillColor ( 255 , 127 , 0 ) pdf . SetAlpha ( 0.5 , " " ) pdf . SetDashPattern ( [ ] float64 { 5 , 10 } , 0 ) pdf . Rect ( 0 , 0 , 40 , 40 , " " ) pdf . SetFontSize ( 12 ) pdf . SetXY ( 5 , 5 ) pdf . Write ( 0 , " " ) pdf . TransformEnd ( ) } draw ( 5 , 5 ) draw ( 50 , 50 ) fileStr := example . Filename ( " " ) err := pdf . OutputFileAndClose ( fileStr ) example . Summary ( err , fileStr ) }
ExampleFpdf_SetFillColor demonstrates how graphic attributes are properly
assigned within multiple transformations.
ExampleFpdf_SetFillColor demonstrates how graphic attributes are properly assigned within multiple transformations .
// Output: // Successfully generated pdf/Fpdf_SetFillColor.pdf