func ExampleFpdf_AddUTF8Font() {
	var fileStr string
	var txtStr []byte
	var err error

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

	pdf.AddPage()

	pdf.AddUTF8Font("dejavu", "", example.FontFile("DejaVuSansCondensed.ttf"))
	pdf.AddUTF8Font("dejavu", "B", example.FontFile("DejaVuSansCondensed-Bold.ttf"))
	pdf.AddUTF8Font("dejavu", "I", example.FontFile("DejaVuSansCondensed-Oblique.ttf"))
	pdf.AddUTF8Font("dejavu", "BI", example.FontFile("DejaVuSansCondensed-BoldOblique.ttf"))

	fileStr = example.Filename("Fpdf_AddUTF8Font")
	txtStr, err = ioutil.ReadFile(example.TextFile("utf-8test.txt"))
	if err == nil {

		pdf.SetFont("dejavu", "B", 17)
		pdf.MultiCell(100, 8, "Text in different languages :", "", "C", false)
		pdf.SetFont("dejavu", "", 14)
		pdf.MultiCell(100, 5, string(txtStr), "", "C", false)
		pdf.Ln(15)

		txtStr, err = ioutil.ReadFile(example.TextFile("utf-8test2.txt"))
		if err == nil {

			pdf.SetFont("dejavu", "BI", 17)
			pdf.MultiCell(100, 8, "Greek text with alignStr = \"J\":", "", "C", false)
			pdf.SetFont("dejavu", "I", 14)
			pdf.MultiCell(100, 5, string(txtStr), "", "J", false)
			err = pdf.OutputFileAndClose(fileStr)

		}
	}
	example.Summary(err, fileStr)
	// Output:
	// Successfully generated pdf/Fpdf_AddUTF8Font.pdf
}
// ExampleFpdf_AddUTF8Font demonstrates how use the font
// with utf-8 mode
ExampleFpdf_AddUTF8Font demonstrates how use the font
with utf-8 mode
// ExampleFpdf_AddUTF8Font demonstrates how use the font // with utf - 8 mode
func ExampleFpdf_AddUTF8Font() {
	var fileStr string
	var txtStr []byte
	var err error
	pdf := gofpdf.New("P", "mm", "A4", "")
	pdf.AddPage()
	pdf.AddUTF8Font("dejavu", "", example.FontFile("DejaVuSansCondensed.ttf"))
	pdf.AddUTF8Font("dejavu", "B", example.FontFile("DejaVuSansCondensed-Bold.ttf"))
	pdf.AddUTF8Font("dejavu", "I", example.FontFile("DejaVuSansCondensed-Oblique.ttf"))
	pdf.AddUTF8Font("dejavu", "BI", example.FontFile("DejaVuSansCondensed-BoldOblique.ttf"))
	fileStr = example.Filename("Fpdf_AddUTF8Font")
	txtStr, err = ioutil.ReadFile(example.TextFile("utf-8test.txt"))
	if err == nil {
		pdf.SetFont("dejavu", "B", 17)
		pdf.MultiCell(100, 8, "Text in different languages :", "", "C", false)
		pdf.SetFont("dejavu", "", 14)
		pdf.MultiCell(100, 5, string(txtStr), "", "C", false)
		pdf.Ln(15)
		txtStr, err = ioutil.ReadFile(example.TextFile("utf-8test2.txt"))
		if err == nil {
			pdf.SetFont("dejavu", "BI", 17)
			pdf.MultiCell(100, 8, "Greek text with alignStr = \"J\":", "", "C", false)
			pdf.SetFont("dejavu", "I", 14)
			pdf.MultiCell(100, 5, string(txtStr), "", "J", false)
			err = pdf.OutputFileAndClose(fileStr)
		}
	}
	example.Summary(err, fileStr)
}
func ExampleFpdf_AddUTF8Font ( ) { var fileStr string var txtStr [ ] byte var err error pdf := gofpdf . New ( " " , " " , " " , " " ) pdf . AddPage ( ) pdf . AddUTF8Font ( " " , " " , example . FontFile ( " " ) ) pdf . AddUTF8Font ( " " , " " , example . FontFile ( " " ) ) pdf . AddUTF8Font ( " " , " " , example . FontFile ( " " ) ) pdf . AddUTF8Font ( " " , " " , example . FontFile ( " " ) ) fileStr = example . Filename ( " " ) txtStr , err = ioutil . ReadFile ( example . TextFile ( " " ) ) if err == nil { pdf . SetFont ( " " , " " , 17 ) pdf . MultiCell ( 100 , 8 , " " , " " , " " , false ) pdf . SetFont ( " " , " " , 14 ) pdf . MultiCell ( 100 , 5 , string ( txtStr ) , " " , " " , false ) pdf . Ln ( 15 ) txtStr , err = ioutil . ReadFile ( example . TextFile ( " " ) ) if err == nil { pdf . SetFont ( " " , " " , 17 ) pdf . MultiCell ( 100 , 8 , " \" \" " , " " , " " , false ) pdf . SetFont ( " " , " " , 14 ) pdf . MultiCell ( 100 , 5 , string ( txtStr ) , " " , " " , false ) err = pdf . OutputFileAndClose ( fileStr ) } } example . Summary ( err , fileStr ) }
ExampleFpdf_AddUTF8Font demonstrates how use the font
with utf-8 mode
ExampleFpdf_AddUTF8Font demonstrates how use the font with utf - 8 mode
// Output: // Successfully generated pdf/Fpdf_AddUTF8Font.pdf