Documentation ¶
Index ¶
- Variables
- type Document
- func (d *Document) LineBreak()
- func (d *Document) NewAddCellMarginOption(margin float64) func(style any) error
- func (d *Document) NewAddFontStyleOption(fontStyle string) func(style any) error
- func (d *Document) NewAddMarginOption(margin float64) func(style any) error
- func (d *Document) NewFillColorOption(color *color.Color) func(style any) error
- func (d *Document) NewFontFamilyOption(family string) func(style any) error
- func (d *Document) NewFontSizeOption(size float64) func(style any) error
- func (d *Document) NewPaddingOption(padding float64) func(style any) error
- func (d *Document) NewSetCellMarginOption(margin float64) func(style any) error
- func (d *Document) NewSetFontStyleOption(fontStyle string) func(style any) error
- func (d *Document) NewTextColorOption(color *color.Color) func(style any) error
- func (d *Document) ResetStyle()
- func (d *Document) SetLink(link string)
- func (d *Document) ThematicBreak()
- func (d *Document) WithStyle(opts ...func(style any) error)
- func (d *Document) Write(p []byte) (n int, err error)
- func (d *Document) WriteImage(path string, file io.Reader, _ ...ast.Attribute)
- func (d *Document) WriteTable(rows ...[]string)
- type Style
- type Styles
Constants ¶
This section is empty.
Variables ¶
var DefaultStyle = &Style{FontFamily: "Arial", FontStyle: "", FontSize: 12, TextColor: color.Black, FillColor: color.White, Padding: 2, CellMargin: 1}
Functions ¶
This section is empty.
Types ¶
type Document ¶
Document a layer between Markdown and PDF
func NewDocument ¶
NewDocument creates a new document
func (*Document) LineBreak ¶
func (d *Document) LineBreak()
LineBreak goes to the beginning of the next line
func (*Document) NewAddCellMarginOption ¶
NewAddCellMarginOption adds CellMargin
func (*Document) NewAddFontStyleOption ¶
NewAddFontStyleOption adds Font style to the current
func (*Document) NewAddMarginOption ¶
NewAddMarginOption adds Left Margin
func (*Document) NewFillColorOption ¶
NewFillColorOption sets Fill Color
func (*Document) NewFontFamilyOption ¶
NewFontFamilyOption sets Font Family
func (*Document) NewFontSizeOption ¶
NewFontSizeOption sets Font Size
func (*Document) NewPaddingOption ¶
NewPaddingOption Adds Left Margin
func (*Document) NewSetCellMarginOption ¶
NewSetCellMarginOption sets CellMargin
func (*Document) NewSetFontStyleOption ¶
NewSetFontStyleOption sets new Font Style
func (*Document) NewTextColorOption ¶
NewTextColorOption sets Text Color
func (*Document) ResetStyle ¶
func (d *Document) ResetStyle()
ResetStyle resets to previous style in PDF
func (*Document) Write ¶
Write writes a simple slice of bytes. Also needed to satisfy io.Writer interface for `goldmark`
func (*Document) WriteImage ¶
WriteImage draw an image in PDF
func (*Document) WriteTable ¶
WriteTable draw a table in PDF
type Style ¶
type Style struct { FontFamily string FontStyle string FontSize float64 TextColor *color.Color FillColor *color.Color Padding float64 LeftMargin float64 CellMargin float64 }
Style for styling texts on the doc