func ExampleFpdf_CellFormat_align() {
	type recType struct {
		align, txt string
	}
	recList := []recType{
		{"TL", "top left"},
		{"TC", "top center"},
		{"TR", "top right"},
		{"LM", "middle left"},
		{"CM", "middle center"},
		{"RM", "middle right"},
		{"BL", "bottom left"},
		{"BC", "bottom center"},
		{"BR", "bottom right"},
	}
	recListBaseline := []recType{
		{"AL", "baseline left"},
		{"AC", "baseline center"},
		{"AR", "baseline right"},
	}
	var formatRect = func(pdf *gofpdf.Fpdf, recList []recType) {
		linkStr := ""
		for pageJ := 0; pageJ < 2; pageJ++ {
			pdf.AddPage()
			pdf.SetMargins(10, 10, 10)
			pdf.SetAutoPageBreak(false, 0)
			borderStr := "1"
			for _, rec := range recList {
				pdf.SetXY(20, 20)
				pdf.CellFormat(170, 257, rec.txt, borderStr, 0, rec.align, false, 0, linkStr)
				borderStr = ""
			}
			linkStr = "https://github.com/missmp/gofpdf"
		}
	}
	pdf := gofpdf.New("P", "mm", "A4", "") // A4 210.0 x 297.0
	pdf.SetFont("Helvetica", "", 16)
	formatRect(pdf, recList)
	formatRect(pdf, recListBaseline)
	var fr fontResourceType
	pdf.SetFontLoader(fr)
	pdf.AddFont("Calligrapher", "", "calligra.json")
	pdf.SetFont("Calligrapher", "", 16)
	formatRect(pdf, recListBaseline)
	fileStr := example.Filename("Fpdf_CellFormat_align")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
	// Output:
	// Generalized font loader reading calligra.json
	// Generalized font loader reading calligra.z
	// Successfully generated pdf/Fpdf_CellFormat_align.pdf
}
// ExampleFpdf_CellFormat_align demonstrates Stefan Schroeder's code to control vertical
// alignment.
ExampleFpdf_CellFormat_align demonstrates Stefan Schroeder's code to control vertical
alignment.
// ExampleFpdf_CellFormat_align demonstrates Stefan Schroeder ' s code to control vertical // alignment .
func ExampleFpdf_CellFormat_align() {
	type recType struct {
		align, txt string
	}
	recList := []recType{
		{"TL", "top left"},
		{"TC", "top center"},
		{"TR", "top right"},
		{"LM", "middle left"},
		{"CM", "middle center"},
		{"RM", "middle right"},
		{"BL", "bottom left"},
		{"BC", "bottom center"},
		{"BR", "bottom right"},
	}
	recListBaseline := []recType{
		{"AL", "baseline left"},
		{"AC", "baseline center"},
		{"AR", "baseline right"},
	}
	var formatRect = func(pdf *gofpdf.Fpdf, recList []recType) {
		linkStr := ""
		for pageJ := 0; pageJ < 2; pageJ++ {
			pdf.AddPage()
			pdf.SetMargins(10, 10, 10)
			pdf.SetAutoPageBreak(false, 0)
			borderStr := "1"
			for _, rec := range recList {
				pdf.SetXY(20, 20)
				pdf.CellFormat(170, 257, rec.txt, borderStr, 0, rec.align, false, 0, linkStr)
				borderStr = ""
			}
			linkStr = "https://github.com/missmp/gofpdf"
		}
	}
	pdf := gofpdf.New("P", "mm", "A4", "") 
	pdf.SetFont("Helvetica", "", 16)
	formatRect(pdf, recList)
	formatRect(pdf, recListBaseline)
	var fr fontResourceType
	pdf.SetFontLoader(fr)
	pdf.AddFont("Calligrapher", "", "calligra.json")
	pdf.SetFont("Calligrapher", "", 16)
	formatRect(pdf, recListBaseline)
	fileStr := example.Filename("Fpdf_CellFormat_align")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
}
func ExampleFpdf_CellFormat_align ( ) { type recType struct { align , txt string } recList := [ ] recType { { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , } recListBaseline := [ ] recType { { " " , " " } , { " " , " " } , { " " , " " } , } var formatRect = func ( pdf * gofpdf . Fpdf , recList [ ] recType ) { linkStr := " " for pageJ := 0 ; pageJ < 2 ; pageJ ++ { pdf . AddPage ( ) pdf . SetMargins ( 10 , 10 , 10 ) pdf . SetAutoPageBreak ( false , 0 ) borderStr := " " for _ , rec := range recList { pdf . SetXY ( 20 , 20 ) pdf . CellFormat ( 170 , 257 , rec . txt , borderStr , 0 , rec . align , false , 0 , linkStr ) borderStr = " " } linkStr = " " } } pdf := gofpdf . New ( " " , " " , " " , " " ) pdf . SetFont ( " " , " " , 16 ) formatRect ( pdf , recList ) formatRect ( pdf , recListBaseline ) var fr fontResourceType pdf . SetFontLoader ( fr ) pdf . AddFont ( " " , " " , " " ) pdf . SetFont ( " " , " " , 16 ) formatRect ( pdf , recListBaseline ) fileStr := example . Filename ( " " ) err := pdf . OutputFileAndClose ( fileStr ) example . Summary ( err , fileStr ) }
ExampleFpdf_CellFormat_align demonstrates Stefan Schroeder's code to control vertical
alignment.
ExampleFpdf_CellFormat_align demonstrates Stefan Schroeder ' s code to control vertical alignment .
// A4 210.0 x 297.0 // Output: // Generalized font loader reading calligra.json // Generalized font loader reading calligra.z // Successfully generated pdf/Fpdf_CellFormat_align.pdf