pdf

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Bold = &table.Style{Format: "B"}
View Source
var Bordered = &table.Style{Border: "1"}
View Source
var Centered = &table.Style{Align: "C"}
View Source
var Reset = &table.Style{Format: "-"}

Functions

func AddPrintRoutes

func AddPrintRoutes(ctrl controller.CRUDSController, name string, printFunc func(*gin.Context) *gofpdf.Fpdf, pathFunc, fileFunc func(*gin.Context) string)

func Box

func Box(p *gofpdf.Fpdf, x, y, w, h float64, styleStr string, checked bool)

func GetPrintHandler

func GetPrintHandler(printFunc func(*gin.Context) *gofpdf.Fpdf, fileName string) gin.HandlerFunc

func GetReadWriteHandler

func GetReadWriteHandler(printFunc func(*gin.Context) *gofpdf.Fpdf, pathFunc, fileFunc func(*gin.Context) string) gin.HandlerFunc

func GetWriteHandler

func GetWriteHandler(printFunc func(*gin.Context) *gofpdf.Fpdf, pathFunc, fileFunc func(*gin.Context) string) gin.HandlerFunc

func LoadPngFromUrl

func LoadPngFromUrl(p *gofpdf.Fpdf, registerName, url string, wg *sync.WaitGroup)

func WritePdf

func WritePdf(c *gin.Context, p *gofpdf.Fpdf, folder, file string)

Types

type Document

type Document struct {
	HeaderFns          *orderedmap.OrderedMap
	FooterFns          *orderedmap.OrderedMap
	AcceptPageBreakFns *orderedmap.OrderedMap
}

func NewDocument

func NewDocument(p *gofpdf.Fpdf) *Document

func (Document) AddAcceptPageBreak

func (d Document) AddAcceptPageBreak(key string, value func() bool)

func (Document) AddFooter

func (d Document) AddFooter(key string, value func(*gofpdf.Fpdf))

func (Document) AddHeader

func (d Document) AddHeader(key string, value func(*gofpdf.Fpdf))

func (*Document) Init

func (d *Document) Init(p *gofpdf.Fpdf)

func (*Document) Register

func (d *Document) Register(reg Registrable)

func (Document) RemoveAcceptPageBreak

func (d Document) RemoveAcceptPageBreak(key string)

func (Document) RemoveFooter

func (d Document) RemoveFooter(key string)

func (Document) RemoveHeader

func (d Document) RemoveHeader(key string)

func (*Document) Unregister

func (d *Document) Unregister(reg Registrable)

type Registrable

type Registrable interface {
	Headers() map[string]func(*gofpdf.Fpdf)
	Footers() map[string]func(*gofpdf.Fpdf)
	AcceptPageBreak() map[string]func() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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