Documentation ¶
Overview ¶
Package core contains all core interfaces and basic implementations.
Package core contains all core interfaces and basic implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code interface { GenQr(code string) (*entity.Image, error) GenDataMatrix(code string) (*entity.Image, error) GenBar(code string, cell *entity.Cell, prop *props.Barcode) (*entity.Image, error) }
Code is the abstraction which deals of how to add QrCodes or Barcode in a PDF.
type Col ¶
type Col interface { Node Add(components ...Component) Col GetSize() int WithStyle(style *props.Cell) Col Render(provider Provider, cell entity.Cell, createCell bool) }
Col is the interface that wraps the basic methods of a col.
type Document ¶
type Document interface { GetBytes() []byte GetBase64() string Save(file string) error GetReport() *metrics.Report Merge([]byte) error }
Document is the interface that wraps the basic methods of a document.
type Font ¶
type Font interface { SetFamily(family string) SetStyle(style fontstyle.Type) SetSize(size float64) SetFont(family string, style fontstyle.Type, size float64) GetFamily() string GetStyle() fontstyle.Type GetSize() float64 GetFont() (string, fontstyle.Type, float64) GetHeight(family string, style fontstyle.Type, size float64) float64 SetColor(color *props.Color) GetColor() *props.Color }
Font is the abstraction which deals of how to set fontstyle configurations.
type Image ¶
type Image interface {
Add(img *entity.Image, cell *entity.Cell, margins *entity.Margins, prop *props.Rect, extension extension.Type, flow bool) error
}
Image is the abstraction which deals of how to add images in a PDF.
type Maroto ¶
type Maroto interface { RegisterHeader(rows ...Row) error AddRows(rows ...Row) AddRow(rowHeight float64, cols ...Col) Row FitlnCurrentPage(heightNewLine float64) bool AddPages(pages ...Page) GetStructure() *node.Node[Structure] Generate() (Document, error) }
Maroto is the interface that wraps the basic methods of maroto.
type Math ¶
type Math interface { GetInnerCenterCell(inner *entity.Dimensions, outer *entity.Dimensions, percent float64) *entity.Cell GetInnerNonCenterCell(inner *entity.Dimensions, outer *entity.Dimensions, prop *props.Rect) *entity.Cell }
Math is the abstraction which deals with useful calc.
type Page ¶
type Page interface { Node Add(rows ...Row) Page GetRows() []Row GetNumber() int SetNumber(number int, total int) Render(provider Provider, cell entity.Cell) }
Page is the interface that wraps the basic methods of a page.
type Pdf ¶
type Pdf struct {
// contains filtered or unexported fields
}
type Provider ¶
type Provider interface { // Grid CreateRow(height float64) CreateCol(width, height float64, config *entity.Config, prop *props.Cell) // Features AddLine(cell *entity.Cell, prop *props.Line) AddText(text string, cell *entity.Cell, prop *props.Text) GetTextHeight(prop *props.Font) float64 AddMatrixCode(code string, cell *entity.Cell, prop *props.Rect) AddQrCode(code string, cell *entity.Cell, rect *props.Rect) AddBarCode(code string, cell *entity.Cell, prop *props.Barcode) AddImageFromFile(value string, cell *entity.Cell, prop *props.Rect) AddImageFromBytes(bytes []byte, cell *entity.Cell, prop *props.Rect, extension extension.Type) AddBackgroundImageFromBytes(bytes []byte, cell *entity.Cell, prop *props.Rect, extension extension.Type) // General GenerateBytes() ([]byte, error) SetProtection(protection *entity.Protection) SetCompression(compression bool) SetMetadata(metadata *entity.Metadata) }
Provider is the abstraction of a document creator provider.
type Row ¶
type Row interface { Node Add(cols ...Col) Row GetHeight() float64 GetColumns() []Col WithStyle(style *props.Cell) Row Render(provider Provider, cell entity.Cell) }
Row is the interface that wraps the basic methods of a row.