Documentation
¶
Index ¶
- Constants
- func GetHeight(row *Row) float64
- type Color
- type Column
- func (r *Column) DataField(title, content string, aspectRatio, titleHeight, fieldHeight float64, ...) *Column
- func (r *Column) EmptyField(aspectRatio float64, configs ...ConfigFunc) *Column
- func (r *Column) Image(image []byte, imageType string, aspectRatio float64, configs ...ConfigFunc) *Column
- func (r *Column) ImageFixed(image []byte, imageType string, width, height float64, configs ...ConfigFunc) *Column
- func (r *Column) Row(padding Padding, spacing float64, aspectRatio float64, builder func(*Row), ...) *Column
- func (r *Column) SignatureField(image []byte, imageType, date, subtitle string, ...) *Column
- func (r *Column) TextField(content string, aspectRatio, textHeight float64, alignment string, ...) *Column
- func (r *Column) TextFieldFixed(content string, height, width, textHeight float64, alignment string, ...) *Column
- type Config
- type ConfigFont
- type ConfigFunc
- type Document
- func (d *Document) AddFirstPageHeader(padding Padding, spacing float64, builder func(*Row)) *Document
- func (d *Document) AddFooter(padding Padding, spacing float64, builder func(*Row)) *Document
- func (d *Document) AddHeader(padding Padding, spacing float64, builder func(*Row)) *Document
- func (d *Document) AddPage()
- func (d *Document) PageBreak() *Document
- func (d *Document) Render() ([]byte, error)
- func (d *Document) Row(padding Padding, spacing float64, builder func(*Row), configs ...ConfigFunc) *Document
- type Font
- type Header
- type Padding
- type Row
- func (r *Row) Column(padding Padding, spacing, height float64, aspectRatio float64, ...) *Row
- func (r *Row) DataField(title, content string, aspectRatio, titleHeight, fieldHeight float64, ...) *Row
- func (r *Row) EmptyField(aspectRatio float64, configs ...ConfigFunc) *Row
- func (r *Row) Image(image []byte, imageType string, aspectRatio float64, configs ...ConfigFunc) *Row
- func (r *Row) ImageFixed(image []byte, imageType string, width, height float64, configs ...ConfigFunc) *Row
- func (r *Row) SignatureField(image []byte, imageType, date, subtitle string, ...) *Row
- func (r *Row) TextField(content string, aspectRatio, textHeight float64, alignment string, ...) *Row
- func (r *Row) TextFieldFixed(content string, width, height, textHeight float64, alignment string, ...) *Row
- type Widget
Constants ¶
View Source
const AlignmentCenter = "C"
View Source
const AlignmentLeft = "L"
View Source
const AlignmentRight = "R"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Column ¶
type Column struct {
Rows []Widget `json:"columns"`
Padding Padding `json:"padding"`
Height float64 `json:"height"`
Spacing float64 `json:"spacing"`
AspectRatio float64 `json:"aspect_ratio"`
// contains filtered or unexported fields
}
func (*Column) DataField ¶
func (r *Column) DataField(title, content string, aspectRatio, titleHeight, fieldHeight float64, configs ...ConfigFunc) *Column
func (*Column) EmptyField ¶
func (r *Column) EmptyField(aspectRatio float64, configs ...ConfigFunc) *Column
func (*Column) ImageFixed ¶ added in v1.1.0
func (*Column) SignatureField ¶
func (*Column) TextFieldFixed ¶ added in v1.1.0
type Config ¶
type Config struct {
Padding Padding `json:"padding"`
Spacing float64 `json:"spacing"`
Fonts []*ConfigFont `json:"fonts"`
}
type ConfigFont ¶
type ConfigFunc ¶ added in v1.1.0
func UseBackgroundColor ¶ added in v1.1.0
func UseBackgroundColor(color Color) ConfigFunc
func UseColor ¶
func UseColor(color Color) ConfigFunc
func UseFillColor ¶
func UseFillColor(color Color) ConfigFunc
func UseFont ¶
func UseFont(font Font) ConfigFunc
func UseFontSize ¶
func UseFontSize(size float64) ConfigFunc
type Document ¶
type Document struct {
Padding Padding `json:"padding"`
Rows []*Row `json:"rows"`
FirstPageHeader []*Row `json:"first_page_header"`
Header []*Row `json:"header"`
Spacing float64 `json:"spacing"`
*gofpdf.Fpdf
// contains filtered or unexported fields
}
func NewDocument ¶
func (*Document) AddFirstPageHeader ¶
type Padding ¶
type Padding struct {
Left float64 `json:"left"`
Top float64 `json:"top"`
Right float64 `json:"right"`
Bottom float64 `json:"bottom"`
}
func PaddingAll ¶
func PaddingLTRB ¶
type Row ¶
type Row struct {
Columns []Widget `json:"columns"`
Padding Padding `json:"padding"`
Spacing float64 `json:"spacing"`
IsPageBreak bool `json:"is_page_break"`
AspectRatio float64 `json:"aspect_ratio"`
// contains filtered or unexported fields
}
func (*Row) DataField ¶
func (r *Row) DataField(title, content string, aspectRatio, titleHeight, fieldHeight float64, configs ...ConfigFunc) *Row
func (*Row) EmptyField ¶
func (r *Row) EmptyField(aspectRatio float64, configs ...ConfigFunc) *Row
func (*Row) ImageFixed ¶ added in v1.1.0
func (*Row) SignatureField ¶
func (*Row) TextFieldFixed ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.