domain

package
v2.0.0-alpha.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Col

type Col interface {
	Node
	Add(components ...Component) Col
	GetSize() int
	WithStyle(style *props.Style) Col
	Render(provider Provider, cell internal.Cell, createCell bool)
}

type Component

type Component interface {
	Node
	Render(provider Provider, cell internal.Cell)
}

type Document

type Document interface {
	GetBytes() []byte
	GetBase64() string
	Save(file string) error
	GetReport() *metrics.Report
}

func NewDocument

func NewDocument(bytes []byte, report *metrics.Report) Document

type Maroto

type Maroto interface {
	RegisterHeader(rows ...Row) error
	RegisterFooter(rows ...Row) error
	AddRows(rows ...Row)
	AddRow(rowHeight float64, cols ...Col) Row
	ForceAddPage(pages ...Page)
	GetStructure() *tree.Node[Structure]
	Generate() (Document, error)
}

type Node

type Node interface {
	SetConfig(config *config.Maroto)
	GetStructure() *tree.Node[Structure]
}

type Page

type Page interface {
	Node
	Add(rows ...Row) Page
	GetNumber() int
	SetNumber(number int)
	Render(provider Provider, cell internal.Cell)
}

type Provider

type Provider interface {
	// Grid
	CreateRow(height float64)
	CreateCol(width, height float64, config *config.Maroto, style *props.Style)

	// Features
	AddText(text string, cell internal.Cell, prop props.Text)
	AddSignature(text string, cell internal.Cell, prop props.Text)
	AddMatrixCode(code string, cell internal.Cell, prop props.Rect)
	AddQrCode(code string, cell internal.Cell, rect props.Rect)
	AddBarCode(code string, cell internal.Cell, prop props.Barcode)
	AddImage(value string, cell internal.Cell, prop props.Rect, extension consts.Extension)

	// General
	GetDimensions() (width float64, height float64)
	GetMargins() (left float64, top float64, right float64, bottom float64)
	GenerateFile(file string) error
	GenerateBytes() ([]byte, error)
	SetCache(cache cache.Cache)
}

type Row

type Row interface {
	Node
	Add(cols ...Col) Row
	GetHeight() float64
	WithStyle(style *props.Style) Row
	Render(provider Provider, cell internal.Cell)
}

type Structure

type Structure struct {
	Type  string
	Value string
	Props map[string]string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL