Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
Cell represents a cell inside the PDF.
func NewRootContext ¶
func (*Cell) GetDimensions ¶
func (c *Cell) GetDimensions() *config.Dimensions
type Code ¶
type Code interface {
GenQr(code string) ([]byte, error)
GenDataMatrix(code string) ([]byte, error)
GenBar(code string, cell *Cell, prop *props.Barcode) ([]byte, error)
}
Code is the abstraction which deals of how to add QrCodes or Barcode in a PDF.
type Document ¶
type Document interface {
GetBytes() []byte
GetType() documenttype.DocumentType
GetBase64() string
Save(file string) error
GetReport() *metrics.Report
To(documenttype.DocumentType) (Document, error)
}
func NewZPLFromPDF ¶
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)
GetScaleFactor() (scaleFactor 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(imgBytes []byte, cell *Cell, margins *config.Margins, prop *props.Rect, extension extension.Type) error
}
Image is the abstraction which deals of how to add images in a PDF.
type Math ¶
type Math interface {
GetInnerCenterCell(inner *config.Dimensions, outer *config.Dimensions, percent float64) *Cell
GetInnerNonCenterCell(inner *config.Dimensions, outer *config.Dimensions, prop *props.Rect) *Cell
GetCenterCorrection(outerSize, innerSize float64) float64
}
Math is the abstraction which deals with useful calc.
type Provider ¶
type Provider interface {
// Grid
CreateRow(height float64)
CreateCol(width, height float64, config *config.Config, prop *props.Cell)
// Features
AddLine(cell *Cell, prop *props.Line)
AddText(text string, cell *Cell, prop *props.Text)
AddSignature(text string, cell *Cell, prop *props.Text)
AddMatrixCode(code string, cell *Cell, prop *props.Rect)
AddQrCode(code string, cell *Cell, rect *props.Rect)
AddBarCode(code string, cell *Cell, prop *props.Barcode)
AddImageFromFile(value string, cell *Cell, prop *props.Rect)
AddImageFromBase64(base64 string, cell *Cell, prop *props.Rect, extension extension.Type)
AddImageFromBytes(bytes []byte, cell *Cell, prop *props.Rect, extension extension.Type)
// General
GenerateBytes() ([]byte, error)
SetCache(cache cache.Cache)
SetProtection(protection *config.Protection)
SetCompression(compression bool)
SetMetadata(metadata *config.Metadata)
}
Click to show internal directories.
Click to hide internal directories.