Versions in this module Expand all Collapse all v0 v0.2.0 Jun 11, 2026 Changes in this version + type OutlineProvider interface + Bookmark func(title string, level int, y float64) + type WatermarkProvider interface + AddWatermark func(cell *entity.Cell, prop *props.Watermark) v0.1.0 Jun 10, 2026 Changes in this version + var ErrCannotMergeBytes = errors.New("cannot merge bytes") + var ErrCannotWriteFile = errors.New("cannot write file") + type AlphaProvider interface + WithAlpha func(a float64, fn func()) + type CharSpacingProvider interface + WithCharSpacing func(mm float64, fn func()) + type Checkbox interface + Add func(label string, cell *entity.Cell, prop *props.Checkbox) + type Code interface + GenBar func(code string, cell *entity.Cell, prop *props.Barcode) (*entity.Image, error) + GenDataMatrix func(code string) (*entity.Image, error) + GenQr func(code string) (*entity.Image, error) + type CodeProvider interface + AddBarCode func(code string, cell *entity.Cell, prop *props.Barcode) + AddMatrixCode func(code string, cell *entity.Cell, prop *props.Rect) + AddQrCode func(code string, cell *entity.Cell, rect *props.Rect) + GetDimensionsByMatrixCode func(code string) (*entity.Dimensions, error) + GetDimensionsByQrCode func(code string) (*entity.Dimensions, error) + type Col interface + Add func(components ...Component) Col + GetHeight func(provider Provider, cell *entity.Cell) float64 + GetSize func() int + Render func(provider Provider, cell entity.Cell, createCell bool) + WithStyle func(style *props.Cell) Col + type Component interface + GetHeight func(provider Provider, cell *entity.Cell) float64 + Render func(provider Provider, cell *entity.Cell) + type Document interface + GetBase64 func() string + GetBytes func() []byte + GetReport func() *metrics.Report + Merge func(bytes []byte) error + Save func(file string) error + Write func(w io.Writer) (int64, error) + type DocumentConfigProvider interface + SetCompression func(compression bool) + SetMetadata func(metadata *entity.Metadata) + SetProtection func(protection *entity.Protection) + type DocumentProvider interface + GenerateBytes func() ([]byte, error) + type Font interface + GetColor func() *props.Color + GetFamily func() string + GetFont func() (string, fontstyle.Type, float64) + GetHeight func(family string, style fontstyle.Type, size float64) float64 + GetSize func() float64 + GetStyle func() fontstyle.Type + SetColor func(color *props.Color) + SetFamily func(family string) + SetFont func(family string, style fontstyle.Type, size float64) + SetSize func(size float64) + SetStyle func(style fontstyle.Type) + type GradientProvider interface + DrawGradient func(cell *entity.Cell, g *props.Gradient, widthMM, heightMM float64) + type GridProvider interface + CreateCol func(width, height float64, config *entity.Config, prop *props.Cell) + CreateRow func(height float64) + type Image interface + Add func(img *entity.Image, cell *entity.Cell, margins *entity.Margins, ...) error + GetImageDimensions func(img *entity.Image, extension extension.Type) *entity.Dimensions + type ImageProvider interface + AddBackgroundImageFromBytes func(bytes []byte, cell *entity.Cell, prop *props.Rect, extension extension.Type) + AddImageFromBytes func(bytes []byte, cell *entity.Cell, prop *props.Rect, extension extension.Type) + AddImageFromFile func(value string, cell *entity.Cell, prop *props.Rect) + GetDimensionsByImage func(file string) (*entity.Dimensions, error) + GetDimensionsByImageByte func(bytes []byte, extension extension.Type) (*entity.Dimensions, error) + type LateFontProvider interface + RegisterFont func(family string, style fontstyle.Type, bytes []byte) + type Line interface + Add func(cell *entity.Cell, prop *props.Line) + type LineProvider interface + AddLine func(cell *entity.Cell, prop *props.Line) + type LinkProvider interface + AddLink func() int + Link func(x, y, w, h float64, linkID int) + SetLink func(linkID int, y float64, page int) + type Math interface + GetInnerCenterCell func(inner *entity.Dimensions, outer *entity.Dimensions) *entity.Cell + Resize func(inner *entity.Dimensions, outer *entity.Dimensions, percent float64, ...) *entity.Dimensions + type Node interface + GetStructure func() *node.Node[Structure] + SetConfig func(config *entity.Config) + type Page interface + Add func(rows ...Row) Page + GetNumber func() int + GetRows func() []Row + Render func(provider Provider, cell entity.Cell) + SetNumber func(number int, total int) + type PageBreaker interface + IsPageBreak func() bool + type PageProvider interface + EnsurePage func(pageNumber int) + type Paper interface + AddAutoRow func(cols ...Col) Row + AddHTML func(htmlStr string) error + AddHTMLCtx func(ctx context.Context, htmlStr string) error + AddPages func(pages ...Page) + AddRow func(rowHeight float64, cols ...Col) Row + AddRows func(rows ...Row) + FitInCurrentPage func(heightNewLine float64) bool + Generate func() (*Pdf, error) + GenerateCtx func(ctx context.Context) (*Pdf, error) + GetCurrentConfig func() *entity.Config + GetStructure func() *node.Node[Structure] + RegisterFooter func(rows ...Row) error + RegisterHeader func(rows ...Row) error + type Pdf struct + func NewPDF(bytes []byte, report *metrics.Report) *Pdf + func (p *Pdf) GetBase64() string + func (p *Pdf) GetBytes() []byte + func (p *Pdf) GetReport() *metrics.Report + func (p *Pdf) Merge(bytes []byte) error + func (p *Pdf) Save(file string) error + func (p *Pdf) Write(w io.Writer) (int64, error) + type PositionProvider interface + SetCursor func(x, y float64) + type Provider interface + type RenderIssueProvider interface + RenderIssues func() []metrics.RenderIssue + type RichTextMeasurer interface + MeasureRichText func(runs []props.RichRun, cell *entity.Cell, prop *props.RichText) float64 + type RichTextProvider interface + AddRichText func(runs []props.RichRun, cell *entity.Cell, prop *props.RichText) + AddTextAt func(x, y float64, text string, prop *props.Text) + MeasureString func(text string, prop *props.Text) float64 + type Row interface + Add func(cols ...Col) Row + GetColumns func() []Col + GetHeight func(provider Provider, cell *entity.Cell) float64 + Render func(provider Provider, cell entity.Cell) + WithStyle func(style *props.Cell) Row + type ShapeProvider interface + DrawFilledCircle func(cell *entity.Cell, fill *props.Color) + type Splittable interface + SplitAt func(provider Provider, remainingHeight float64) (first, rest Row, didSplit bool) + type Structure struct + Details map[string]any + Type string + Value any + type Text interface + Add func(text string, cell *entity.Cell, textProp *props.Text) + GetLinesQuantity func(text string, textProp *props.Text, colWidth float64) int + type TextProvider interface + AddCheckbox func(label string, cell *entity.Cell, prop *props.Checkbox) + AddText func(text string, cell *entity.Cell, prop *props.Text) + GetFontHeight func(prop *props.Font) float64 + GetLinesQuantity func(text string, textProp *props.Text, colWidth float64) int