Documentation
¶
Index ¶
- func NewCode(pdf gofpdf.Pdf, math Math) *code
- func NewFont(pdf gofpdf.Pdf, size float64, family consts.Family, style consts.Style) *font
- func NewImage(pdf gofpdf.Pdf, math Math) *image
- func NewMath(pdf gofpdf.Pdf) *math
- func NewSignature(pdf gofpdf.Pdf, math Math, text Text) *signature
- func NewText(pdf gofpdf.Pdf, math Math, font Font) *text
- type Code
- type Font
- type Image
- 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, marginTop float64, indexCol float64, qtdCols float64, colHeight float64, percent float64)
AddBar(code string, marginTop float64, indexCol float64, qtdCols float64, colHeight float64, rectPercent float64, heightPercentFromWidth float64) (err error)
}
Code is the abstraction which deals of how to add QrCodes or Barcode in a PDF
type Font ¶
type Font interface {
SetFamily(family consts.Family)
SetStyle(style consts.Style)
SetSize(size float64)
SetFont(family consts.Family, style consts.Style, size float64)
GetFamily() consts.Family
GetStyle() consts.Style
GetSize() float64
GetFont() (consts.Family, consts.Style, float64)
}
Font is the abstraction which deals of how to set font configurations
type Image ¶
type Image interface {
AddFromFile(path string, marginTop float64, indexCol float64, qtdCols float64, colHeight float64, prop props.Rect)
AddFromBase64(b64 string, marginTop float64, indexCol float64, qtdCols float64, colHeight float64, prop props.Rect, extension consts.Extension)
}
Image is the abstraction which deals of how to add images in a PDF
type Math ¶
type Math interface {
GetWidthPerCol(qtdCols float64) float64
GetRectCenterColProperties(imageWidth float64, imageHeight float64, qtdCols float64, colHeight float64, indexCol float64, percent float64) (x float64, y float64, w float64, h float64)
GetRectNonCenterColProperties(imageWidth float64, imageHeight float64, qtdCols float64, colHeight float64, indexCol 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.