Documentation
¶
Overview ¶
Package text implements creation of texts.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New is responsible to create an instance of a Text.
Example ¶
ExampleNew demonstrates how to create a text component.
package main
import (
"github.com/johnfercher/maroto/v2"
"github.com/johnfercher/maroto/v2/pkg/components/col"
"github.com/johnfercher/maroto/v2/pkg/components/text"
)
func main() {
m := maroto.New()
text := text.New("text")
col := col.New(12).Add(text)
m.AddRow(10, col)
// generate document
}
Output:
func NewAutoRow ¶ added in v2.1.0
NewAutoRow is responsible for creating an instance of Text grouped in a Line with automatic height.
func NewCol ¶
NewCol is responsible to create an instance of a Text wrapped in a Col.
Example ¶
ExampleNewCol demonstrates how to create a text component wrapped into a column.
package main
import (
"github.com/johnfercher/maroto/v2"
"github.com/johnfercher/maroto/v2/pkg/components/text"
)
func main() {
m := maroto.New()
textCol := text.NewCol(12, "text")
m.AddRow(10, textCol)
// generate document
}
Output:
func NewRow ¶
NewRow is responsible to create an instance of a Text wrapped in a Row.
Example ¶
ExampleNewRow demonstrates how to create a text component wrapped into a row.
package main
import (
"github.com/johnfercher/maroto/v2"
"github.com/johnfercher/maroto/v2/pkg/components/text"
)
func main() {
m := maroto.New()
textRow := text.NewRow(10, "text")
m.AddRows(textRow)
// generate document
}
Output:
Types ¶
type Text ¶
type Text struct {
// contains filtered or unexported fields
}
func (*Text) GetHeight ¶ added in v2.1.0
GetHeight returns the height that the text will have in the PDF
func (*Text) GetStructure ¶
GetStructure returns the Structure of a Text.