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 GetHeight(provider Provider, cell *entity.Cell) float64 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 Component ¶
type Component interface { Node Render(provider Provider, cell *entity.Cell) GetHeight(provider Provider, cell *entity.Cell) float64 }
Component is the interface that wraps the basic methods of a component.
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 GetImageInfo(img *entity.Image, extension extension.Type) (*gofpdf.ImageInfoType, uuid.UUID) }
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 AddAutoRow(cols ...Col) Row FitlnCurrentPage(heightNewLine float64) bool GetCurrentConfig() *entity.Config 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) *entity.Cell Resize(inner *entity.Dimensions, outer *entity.Dimensions, percent float64, justReferenceWidth bool) *entity.Dimensions }
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) GetFontHeight(prop *props.Font) float64 GetLinesQuantity(text string, textProp *props.Text, colWidth float64) int 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) GetDimensionsByMatrixCode(code string) (*entity.Dimensions, error) GetDimensionsByImageByte(bytes []byte, extension extension.Type) (*entity.Dimensions, error) GetDimensionsByImage(file string) (*entity.Dimensions, error) GetDimensionsByQrCode(code string) (*entity.Dimensions, error) 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(provider Provider, cell *entity.Cell) 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.