internal

package
v0.15.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCode

func NewCode(pdf gofpdf.Pdf, math Math) *code

NewCode create a Code

func NewFont

func NewFont(pdf gofpdf.Pdf, size float64, family consts.Family, style consts.Style) *font

NewFont create a Font

func NewImage

func NewImage(pdf gofpdf.Pdf, math Math) *image

NewImage create an Image

func NewMath

func NewMath(pdf gofpdf.Pdf) *math

NewMath create a Math

func NewSignature

func NewSignature(pdf gofpdf.Pdf, math Math, text Text) *signature

NewSignature create a Signature

func NewText

func NewText(pdf gofpdf.Pdf, math Math, font Font) *text

NewText create a Text

Types

type Code

type Code interface {
	AddQr(code string, marginTop float64, indexCol float64, qtdCols float64, colHeight float64, prop props.Rect)
	AddBar(code string, marginTop float64, indexCol float64, qtdCols float64, colHeight float64, prop props.Barcode) (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) (err error)
	AddFromBase64(b64 string, marginTop float64, indexCol float64, qtdCols float64, colHeight float64, 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 {
	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

type Signature

type Signature interface {
	AddSpaceFor(label string, textProp props.Text, qtdCols float64, marginTop float64, actualCol float64)
}

Signature is the abstraction which deals of how to add a signature space inside PDF

type Text

type Text interface {
	Add(text string, fontFamily props.Text, marginTop float64, actualCol float64, qtdCols float64)
}

Text is the abstraction which deals of how to add text inside PDF

Directories

Path Synopsis
examples
zpl

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL