fastpdf

package module
v0.0.0-...-ff88440 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 9 Imported by: 0

README

fast-pdf

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FastPdf

type FastPdf struct {
	Header       []PdfItem //头部元素
	Body         []PdfItem // 正文元素
	Footer       []PdfItem //底部元素
	TemplatePath string    //底板路径
	// contains filtered or unexported fields
}

func New

func New(fontPath string, fastPdf FastPdf) FastPdf

新建F

func (*FastPdf) GetPdf

func (pdf *FastPdf) GetPdf() (fileBytes []byte, err error)

创建新PDF文件

type ItemType

type ItemType byte
const (
	Text ItemType = iota
	BarCode
	QrCode
	Line
	Grid
	Table
)

type PdfItem

type PdfItem struct {
	Type   ItemType `json:"type"`
	Left   float64  `json:"left"`
	Top    float64  `json:"top"`
	Size   int      `json:"size"`   //	大小
	Width  int      `json:"width"`  // 宽
	Height int      `json:"height"` // 高 在table里指的是行高,不指定总高
	//FontStyle string `json:"fontStyle"` //	字体样式 默认:Arial
	Text        string              `json:"text"`   // 文本内容
	Column      int                 `json:"column"` // 列数
	Row         int                 `json:"row"`    // 行数
	TableColumn []TableColumn       `json:"tableColumn"`
	TableData   []map[string]string `json:"tableData"` //行 列

}

type TableColumn

type TableColumn struct {
	Width int    `json:"width"` // 列宽
	Title string `json:"title"` // 标题内容
	Key   string `json:"key"`   // 数据key
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL