Documentation ¶
Index ¶
- Constants
- func ConvertPNG2JPEG(srcPath, dstPath string) (err error)
- func DrawPNG(srcPath string)
- func GetImageType(picturePath string) (pictureType string, err error)
- func GetImageWidthAndHeight(picturePath string) (w, h int)
- type Div
- func (div *Div) Copy(content string) *Div
- func (div *Div) GenerateAtomicCell() error
- func (div *Div) GetHeight() (height float64)
- func (div *Div) GetWidth() (width float64)
- func (div *Div) HorizontalCentered() *Div
- func (div *Div) RightAlign() *Div
- func (div *Div) SetBackColor(color string) *Div
- func (div *Div) SetBorder(border core.Scope) *Div
- func (div *Div) SetContent(content string) *Div
- func (div *Div) SetFont(font core.Font) *Div
- func (div *Div) SetFontColor(color string) *Div
- func (div *Div) SetFontWithColor(font core.Font, color string) *Div
- func (div *Div) SetFrameType(frameType int) *Div
- func (div *Div) SetLink(x, y float64, content, link string) *Div
- func (div *Div) SetMargin(margin core.Scope) *Div
- type HLine
- type Image
- type Span
- func (span *Span) Copy(content string) *Span
- func (span *Span) GenerateAtomicCell() error
- func (span *Span) GetHeight() (height float64)
- func (span *Span) GetWidth() (width float64)
- func (span *Span) HorizontalCentered() *Span
- func (span *Span) RightAlign() *Span
- func (span *Span) SetBorder(border core.Scope) *Span
- func (span *Span) SetContent(content string) *Span
- func (span *Span) SetFont(font core.Font) *Span
- func (span *Span) SetFontColor(color string) *Span
- func (span *Span) SetFontWithColor(font core.Font, color string) *Span
- func (span *Span) SetHeight(height float64) *Span
- func (span *Span) SetMarign(margin core.Scope) *Span
- func (span *Span) VerticalCentered() *Span
- type Table
- func (table *Table) GenerateAtomicCell() error
- func (table *Table) GetColWidth(row, col int) float64
- func (table *Table) NewCell() *TableCell
- func (table *Table) NewCellByRange(w, h int) *TableCell
- func (table *Table) SetLineHeight(lineHeight float64)
- func (table *Table) SetMargin(margin core.Scope)
- type TableCell
- type TextCell
- func (cell *TextCell) Copy(content string) *TextCell
- func (cell *TextCell) GenerateAtomicCell(maxheight float64) (int, int, error)
- func (cell *TextCell) GetHeight() float64
- func (cell *TextCell) GetLastHeight() float64
- func (cell *TextCell) HorizontalCentered() *TextCell
- func (cell *TextCell) RightAlign() *TextCell
- func (cell *TextCell) SetBackColor(color string) *TextCell
- func (cell *TextCell) SetBorder(border core.Scope) *TextCell
- func (cell *TextCell) SetContent(s string) *TextCell
- func (cell *TextCell) SetFont(font core.Font) *TextCell
- func (cell *TextCell) SetFontColor(color string) *TextCell
- func (cell *TextCell) SetFontWithColor(font core.Font, color string) *TextCell
- func (cell *TextCell) TryGenerateAtomicCell(maxheight float64) (int, int)
- func (cell *TextCell) VerticalCentered() *TextCell
Constants ¶
View Source
const ( DIVSTRAIGHT = 1 // 实线边框 DIVDASHED = 2 // 虚线边框 DIVDOTTED = 3 // 点状线的边框 DIVNONE = 4 // 无边框 )
Variables ¶
This section is empty.
Functions ¶
func ConvertPNG2JPEG ¶
func GetImageType ¶
func GetImageWidthAndHeight ¶
Types ¶
type Div ¶
type Div struct {
// contains filtered or unexported fields
}
带有各种边框的内容, 可以自动换行
func NewDivWithWidth ¶
NewDivWithWidth return a *div
func (*Div) HorizontalCentered ¶
func (*Div) RightAlign ¶
func (*Div) SetBackColor ¶
func (*Div) SetContent ¶
func (*Div) SetFontColor ¶
func (*Div) SetFrameType ¶
func (*Div) SetLink ¶
添加外部链接
func (div *Div) SetLink(x, y, th float64, content, link string) *Div { div.pdf.Font(div.font.Family, div.font.Size, div.font.Style) div.pdf.SetFontWithStyle(div.font.Family, div.font.Style, div.font.Size) div.pdf.ExternalLink(div.width, div.height, div.lineHeight, content, link) return div }
type HLine ¶
type HLine struct {
// contains filtered or unexported fields
}
func (*HLine) GenerateAtomicCell ¶
func (h *HLine) GenerateAtomicCell()
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
func NewImageFromServer ¶
NewImageFromServer 从远程请求图片
func NewServerImage ¶
NewServerImage 获取远程 图片
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
不会进行自动分页, 可以用于页眉, 页脚的内容.
func NewSpanWithWidth ¶
func (*Span) GenerateAtomicCell ¶
func (*Span) HorizontalCentered ¶
func (*Span) RightAlign ¶
func (*Span) SetContent ¶
func (*Span) SetFontColor ¶
func (*Span) SetFontWithColor ¶
func (*Span) VerticalCentered ¶
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
构建表格
func (*Table) GenerateAtomicCell ¶
func (*Table) SetLineHeight ¶
设置表的行高, 行高必须大于当前使用字体的行高
type TextCell ¶
type TextCell struct {
// contains filtered or unexported fields
}
func NewTextCell ¶
func (*TextCell) GenerateAtomicCell ¶
先涂背景颜色, 然后在背景颜色的基础上写入内容
func (*TextCell) GetLastHeight ¶
func (*TextCell) HorizontalCentered ¶
func (*TextCell) RightAlign ¶
func (*TextCell) SetBackColor ¶
func (*TextCell) SetContent ¶
func (*TextCell) SetFontColor ¶
func (*TextCell) SetFontWithColor ¶
func (*TextCell) TryGenerateAtomicCell ¶
func (*TextCell) VerticalCentered ¶
Click to show internal directories.
Click to hide internal directories.