Versions in this module Expand all Collapse all v0 v0.0.4 Jul 21, 2021 Changes in this version type LayoutNode + ID string type LayoutNodeProps + ID string v0.0.3 Jul 20, 2021 Changes in this version type DocumentRenderer + GetInherentTextRect func(textNode TextNode) Rect type PDFRenderer + func (r *PDFRenderer) GetInherentTextRect(textNode TextNode) Rect v0.0.2 Jul 19, 2021 Changes in this version type LayoutNode + func (n *LayoutNode) Clone() *LayoutNode v0.0.1 Jul 15, 2021 Changes in this version + const Center + const DocumentSizeLetter + const End + const FlowHorizontal + const FlowVertical + const FontBold + const FontItalic + const FontRegular + const FontStrikeOut + const FontUnderscore + const ImageCenter + const ImageEnd + const ImagePreserve + const ImageStart + const ImageStretch + const Start + func NoChildren(parent *LayoutNode) + type BooleanQuad struct + func NewBooleanQuad(top, right, bottom, left bool) BooleanQuad + func NewSingletonBooleanQuad(value bool) BooleanQuad + type Color struct + func NewColor(red, green, blue int) Color + type Document struct + Children []*Page + type DocumentBuilder struct + func NewDocumentBuilder(renderer DocumentRenderer, size documentSize, margin Size) *DocumentBuilder + func (d *DocumentBuilder) CreateDocumentTree(nodeList []*LayoutNode) error + func (d *DocumentBuilder) PrettyPrintDocumentTree() + func (d *DocumentBuilder) RenderToWriter(writer io.Writer) error + type DocumentRenderer interface + Render func(root *Document) (result interface{}, err error) + Save func(renderResult interface{}, writer io.Writer) error + SplitText func(targetRect Rect, textNode TextNode) []string + type FontConfig struct + File string + Name string + Style string + type Future struct + func HeightAsChildren() Future + func HeightFill() Future + func HeightPercentage(percentage Size) Future + func StaticSize(size Size) Future + func WidthAsChildren() Future + func WidthFill() Future + func WidthPercentage(percentage Size) Future + type ImageNode struct + Alignment imageAlignment + RatioBehavior imageFit + Src string + type LayoutChildAlignment struct + Horizontal childAlignment + Vertical childAlignment + type LayoutNode struct + Border BooleanQuad + BorderColor Color + ChildAlignment LayoutChildAlignment + ChildFlowDirection childFlowDirection + Children []*LayoutNode + FillColor Color + Height Future + Margin SizesQuad + Padding SizesQuad + Page *Page + Parent *LayoutNode + ShowFill bool + VisualNode interface{} + Width Future + X Size + Y Size + func CreateNodeList(nodes ...*LayoutNode) []*LayoutNode + func Div(parent *LayoutNode, options LayoutNodeProps, cb func(*LayoutNode)) *LayoutNode + func Image(parent *LayoutNode, options LayoutNodeProps, imageProps ImageNode) *LayoutNode + func Text(parent *LayoutNode, options LayoutNodeProps, textProps TextNode) *LayoutNode + type LayoutNodeProps struct + Border BooleanQuad + BorderColor Color + ChildAlignment LayoutChildAlignment + ChildFlowDirection childFlowDirection + FillColor Color + Height Future + Margin SizesQuad + Padding SizesQuad + ShowFill bool + Width Future + type PDF = *gofpdf.Fpdf + type PDFRenderer struct + func NewPDFRenderer(ds documentSize, fontsDir string, fonts ...FontConfig) (*PDFRenderer, error) + func (r *PDFRenderer) Render(document *Document) (result interface{}, err error) + func (r *PDFRenderer) Save(renderResult interface{}, writer io.Writer) error + func (r *PDFRenderer) SplitText(targetRect Rect, textNode TextNode) []string + type Page struct + Children []*LayoutNode + Height Size + Margin SizesQuad + Width Size + type Rect struct + type Size = float64 + type SizesQuad struct + func NewSingletonSizeQuad(value Size) SizesQuad + func NewSizeQuad(top, right, bottom, left Size) SizesQuad + type TextNode struct + Alignment textAlignment + Color Color + FontFamily string + FontSize Size + FontStyle fontStyle + LineHeight Size + Link string + OverflowBehavior overflowBehavior + Text string