Documentation
¶
Index ¶
- Variables
- func FormatValue(amount *big.Int, decimals int) string
- func Value2Float(v *big.Int, decimals int) float64
- type Color
- type Doc
- func (doc *Doc) AddBlankPage()
- func (doc *Doc) AssureVertialSpace(h float64)
- func (doc *Doc) DrawBigImage(img image.Image) error
- func (doc *Doc) DrawImageCover(img image.Image, x, y, targetW, targetH float64) error
- func (doc *Doc) EclipseToWidth(s string, width float64) (string, float64)
- func (doc *Doc) EclipseToWidthWithStyle(s string, width float64, style *Style) (string, float64)
- func (doc *Doc) Footer()
- func (doc *Doc) FormatFiat(value float64) string
- func (doc *Doc) FormatValue(amount *big.Int, decimals int) string
- func (doc *Doc) GetMarginHeight() float64
- func (doc *Doc) GetMarginWidth() float64
- func (doc *Doc) Header()
- func (doc *Doc) MarkDownToPdf(md string) error
- func (doc *Doc) MarkDownToPdfEx(md string, x, y, w, h float64, auto_page bool) error
- func (doc *Doc) NewLine()
- func (doc *Doc) NewNLines(n int)
- func (doc *Doc) NewSection(title string)
- func (doc *Doc) NewSubSection(title string)
- func (doc *Doc) NewSubSubSection(title string)
- func (doc *Doc) NextPage()
- func (doc *Doc) SetColor(c *Color)
- func (doc *Doc) SetDocFont(fontName string, size float64)
- func (doc *Doc) T(key string) string
- func (doc *Doc) TextCentered(text string, x, y float64)
- func (doc *Doc) TextLeft(text string, x, y float64)
- func (doc *Doc) TextRight(text string, x, y float64)
- func (doc *Doc) TextWidthStyle(text string, x, y, w float64, style *Style)
- func (doc *Doc) WriteTable(t *Table)
- type PaddingDescription
- type Section
- type Style
- type Table
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultStyle = &Style{ FontName: "Arial", FontSize: 12, FontColor: &Color{0, 0, 0}, Padding: PaddingDescription{Left: 5, Top: 4, Right: 0, Bottom: 6}, Align: 'L', }
View Source
var HeaderStyle = &Style{ FontName: "DejaVuBold", FontSize: 12, FontColor: &Color{0xf7, 0xf7, 0xf7}, BGColor: &SAVVA_DARK_COLOR, Align: 'C', Padding: PaddingDescription{Left: 5, Top: 4, Right: 5, Bottom: 6}, }
Functions ¶
Types ¶
type Doc ¶
type Doc struct {
*gopdf.GoPdf
Locale string
CurentPage int
UserAddress string
Sections []*Section
Margins PaddingDescription
PageWidth, PageHeight float64
Section, SubSection, SubSubSection int
PrintHeader bool
// data
History []data.HistoryRecord
Sponsored []data.Sponsored
GetImage func(string) (image.Image, error)
// contains filtered or unexported fields
}
func (*Doc) AddBlankPage ¶
func (doc *Doc) AddBlankPage()
func (*Doc) AssureVertialSpace ¶
func (*Doc) DrawImageCover ¶
DrawImageCover crops and scales the image to cover the given area.
func (*Doc) EclipseToWidth ¶
func (*Doc) EclipseToWidthWithStyle ¶
func (*Doc) FormatFiat ¶
func (*Doc) GetMarginHeight ¶
func (*Doc) GetMarginWidth ¶
func (*Doc) MarkDownToPdf ¶
MarkDownToPdf converts Markdown text into PDF content.
func (*Doc) MarkDownToPdfEx ¶
func (*Doc) NewSection ¶
func (*Doc) NewSubSection ¶
func (*Doc) NewSubSubSection ¶
func (*Doc) SetDocFont ¶
func (*Doc) TextCentered ¶
func (*Doc) TextWidthStyle ¶
func (*Doc) WriteTable ¶
type PaddingDescription ¶
type PaddingDescription struct {
Left, Top, Right, Bottom float64
}
Click to show internal directories.
Click to hide internal directories.