func ExampleFpdf_AddLayer() {

	pdf := gofpdf.New("P", "mm", "A4", "")
	pdf.AddPage()
	pdf.SetFont("Arial", "", 15)
	pdf.Write(8, "This line doesn't belong to any layer.\n")

	// Define layers
	l1 := pdf.AddLayer("Layer 1", true)
	l2 := pdf.AddLayer("Layer 2", true)

	// Open layer pane in PDF viewer
	pdf.OpenLayerPane()

	// First layer
	pdf.BeginLayer(l1)
	pdf.Write(8, "This line belongs to layer 1.\n")
	pdf.EndLayer()

	// Second layer
	pdf.BeginLayer(l2)
	pdf.Write(8, "This line belongs to layer 2.\n")
	pdf.EndLayer()

	// First layer again
	pdf.BeginLayer(l1)
	pdf.Write(8, "This line belongs to layer 1 again.\n")
	pdf.EndLayer()

	fileStr := example.Filename("Fpdf_AddLayer")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
	// Output:
	// Successfully generated pdf/Fpdf_AddLayer.pdf
}
// ExampleFpdf_AddLayer demonstrates document layers. The initial visibility of a layer
// is specified with the second parameter to AddLayer(). The layer list
// displayed by the document reader allows layer visibility to be controlled
// interactively.
ExampleFpdf_AddLayer demonstrates document layers. The initial visibility of a layer
is specified with the second parameter to AddLayer(). The layer list
displayed by the document reader allows layer visibility to be controlled
interactively.
// ExampleFpdf_AddLayer demonstrates document layers . The initial visibility of a layer // is specified with the second parameter to AddLayer () . The layer list // displayed by the document reader allows layer visibility to be controlled // interactively .
func ExampleFpdf_AddLayer() {
	pdf := gofpdf.New("P", "mm", "A4", "")
	pdf.AddPage()
	pdf.SetFont("Arial", "", 15)
	pdf.Write(8, "This line doesn't belong to any layer.\n")
	l1 := pdf.AddLayer("Layer 1", true)
	l2 := pdf.AddLayer("Layer 2", true)
	pdf.OpenLayerPane()
	pdf.BeginLayer(l1)
	pdf.Write(8, "This line belongs to layer 1.\n")
	pdf.EndLayer()
	pdf.BeginLayer(l2)
	pdf.Write(8, "This line belongs to layer 2.\n")
	pdf.EndLayer()
	 again
	pdf.BeginLayer(l1)
	pdf.Write(8, "This line belongs to layer 1 again.\n")
	pdf.EndLayer()
	fileStr := example.Filename("Fpdf_AddLayer")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
}
func ExampleFpdf_AddLayer ( ) { pdf := gofpdf . New ( " " , " " , " " , " " ) pdf . AddPage ( ) pdf . SetFont ( " " , " " , 15 ) pdf . Write ( 8 , " \n " ) l1 := pdf . AddLayer ( " " , true ) l2 := pdf . AddLayer ( " " , true ) pdf . OpenLayerPane ( ) pdf . BeginLayer ( l1 ) pdf . Write ( 8 , " \n " ) pdf . EndLayer ( ) pdf . BeginLayer ( l2 ) pdf . Write ( 8 , " \n " ) pdf . EndLayer ( ) pdf . BeginLayer ( l1 ) pdf . Write ( 8 , " \n " ) pdf . EndLayer ( ) fileStr := example . Filename ( " " ) err := pdf . OutputFileAndClose ( fileStr ) example . Summary ( err , fileStr ) }
ExampleFpdf_AddLayer demonstrates document layers.
ExampleFpdf_AddLayer demonstrates document layers .
// Define layers // Open layer pane in PDF viewer // First layer // Second layer // First layer again // Output: // Successfully generated pdf/Fpdf_AddLayer.pdf