func ExampleFpdf_RegisterAlias_utf8() {
	pdf := gofpdf.New("P", "mm", "A4", "")
	pdf.AddUTF8Font("dejavu", "", example.FontFile("DejaVuSansCondensed.ttf"))
	pdf.SetFont("dejavu", "", 12)
	pdf.AliasNbPages("{entute}")
	pdf.AddPage()

	// Write the table of contents. We use aliases instead of the page number
	// because we don't know which page the section will begin on.
	numSections := 3
	for i := 1; i <= numSections; i++ {
		pdf.Cell(0, 10, fmt.Sprintf("Sekcio %d komenciĝas ĉe paĝo {ĉi tiu marko %d}", i, i))
		pdf.Ln(10)
	}

	// Write the sections. Before we start writing, we use `RegisterAlias` to
	// ensure that the alias written in the table of contents will be replaced
	// by the current page number.
	for i := 1; i <= numSections; i++ {
		pdf.AddPage()
		pdf.RegisterAlias(fmt.Sprintf("{ĉi tiu marko %d}", i), fmt.Sprintf("%d", pdf.PageNo()))
		pdf.Write(10, fmt.Sprintf("Sekcio %d, paĝo %d de {entute}", i, pdf.PageNo()))
	}

	fileStr := example.Filename("Fpdf_RegisterAliasUTF8")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
	// Output:
	// Successfully generated pdf/Fpdf_RegisterAliasUTF8.pdf
}
// ExampleFpdf_RegisterAlias_utf8 demonstrates how to use `RegisterAlias` to
// create a table of contents. This particular example demonstrates the use of
// UTF-8 aliases.
ExampleFpdf_RegisterAlias_utf8 demonstrates how to use `RegisterAlias` to
create a table of contents. This particular example demonstrates the use of
UTF-8 aliases.
// ExampleFpdf_RegisterAlias_utf8 demonstrates how to use ` RegisterAlias ` to // create a table of contents . This particular example demonstrates the use of // UTF - 8 aliases .
func ExampleFpdf_RegisterAlias_utf8() {
	pdf := gofpdf.New("P", "mm", "A4", "")
	pdf.AddUTF8Font("dejavu", "", example.FontFile("DejaVuSansCondensed.ttf"))
	pdf.SetFont("dejavu", "", 12)
	pdf.AliasNbPages("{entute}")
	pdf.AddPage()
	numSections := 3
	for i := 1; i <= numSections; i++ {
		pdf.Cell(0, 10, fmt.Sprintf("Sekcio %d komenciĝas ĉe paĝo {ĉi tiu marko %d}", i, i))
		pdf.Ln(10)
	}
	for i := 1; i <= numSections; i++ {
		pdf.AddPage()
		pdf.RegisterAlias(fmt.Sprintf("{ĉi tiu marko %d}", i), fmt.Sprintf("%d", pdf.PageNo()))
		pdf.Write(10, fmt.Sprintf("Sekcio %d, paĝo %d de {entute}", i, pdf.PageNo()))
	}
	fileStr := example.Filename("Fpdf_RegisterAliasUTF8")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
}
func ExampleFpdf_RegisterAlias_utf8 ( ) { pdf := gofpdf . New ( " " , " " , " " , " " ) pdf . AddUTF8Font ( " " , " " , example . FontFile ( " " ) ) pdf . SetFont ( " " , " " , 12 ) pdf . AliasNbPages ( " " ) pdf . AddPage ( ) numSections := 3 for i := 1 ; i <= numSections ; i ++ { pdf . Cell ( 0 , 10 , fmt . Sprintf ( " , ) ) pdf . Ln ( 10 ) } for i := 1 ; i <= numSections ; i ++ { pdf . AddPage ( ) pdf . RegisterAlias ( fmt . Sprintf ( " , ) , mt. S printf( " % , df. P ageNo( ) ) ) pdf . Write ( 10 , fmt . Sprintf ( " , , df. P ageNo( ) ) ) } fileStr := example . Filename ( " " ) err := pdf . OutputFileAndClose ( fileStr ) example . Summary ( err , fileStr ) }
ExampleFpdf_RegisterAlias_utf8 demonstrates how to use `RegisterAlias` to
create a table of contents.
ExampleFpdf_RegisterAlias_utf8 demonstrates how to use ` RegisterAlias ` to create a table of contents .
// Write the table of contents. We use aliases instead of the page number // because we don't know which page the section will begin on. // Write the sections. Before we start writing, we use `RegisterAlias` to // ensure that the alias written in the table of contents will be replaced // by the current page number. // Output: // Successfully generated pdf/Fpdf_RegisterAliasUTF8.pdf