Documentation
¶
Index ¶
- func NewCode(pdf fpdf.Fpdf, math Math) *code
- func NewFont(pdf fpdf.Fpdf, size float64, family string, style consts.Style) *font
- func NewImage(pdf fpdf.Fpdf, math Math) *image
- func NewLine(pdf fpdf.Fpdf) *line
- func NewMath(pdf fpdf.Fpdf) *math
- func NewSignature(pdf fpdf.Fpdf, math Math, text Text) *signature
- func NewText(pdf fpdf.Fpdf, math Math, font Font) *text
- type Cell
- type Code
- type Font
- type Image
- type Line
- type Math
- type Signature
- type Text
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSignature ¶
NewSignature create a Signature.
Types ¶
type Code ¶
type Code interface {
AddQr(code string, cell Cell, prop props.Rect)
AddBar(code string, cell Cell, prop props.Barcode) (err error)
AddDataMatrix(code string, cell Cell, prop props.Rect)
}
Code is the abstraction which deals of how to add QrCodes or Barcode in a PDF.
type Font ¶
type Font interface {
SetFamily(family string)
SetStyle(style consts.Style)
SetSize(size float64)
SetFont(family string, style consts.Style, size float64)
GetFamily() string
GetStyle() consts.Style
GetSize() float64
GetFont() (string, consts.Style, float64)
GetScaleFactor() (scaleFactor float64)
SetColor(color color.Color)
GetColor() color.Color
}
Font is the abstraction which deals of how to set font configurations.
type Image ¶
type Image interface {
AddFromFile(path string, cell Cell, prop props.Rect) (err error)
AddFromBase64(stringBase64 string, cell Cell, prop props.Rect, extension consts.Extension) (err error)
}
Image is the abstraction which deals of how to add images in a PDF.
type Math ¶
type Math interface {
GetRectCenterColProperties(imageWidth float64, imageHeight float64, colWidth float64, colHeight float64,
xColOffset float64, percent float64) (x float64, y float64, w float64, h float64)
GetRectNonCenterColProperties(imageWidth float64, imageHeight float64, colWidth float64, colHeight float64,
xColOffset float64, prop props.Rect) (x float64, y float64, w float64, h float64)
GetCenterCorrection(outerSize, innerSize float64) float64
}
Math is the abstraction which deals with useful calc.
Click to show internal directories.
Click to hide internal directories.