pdf

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetA4PDF

func GetA4PDF(fontMap map[string]string, leftMargin, rightMargin, topMargin, bottomMargin float64) pdf

func GetNormalTableIter

func GetNormalTableIter(h []string) *normalTableIter

func GetSensorDynamicHeaderTableIter

func GetSensorDynamicHeaderTableIter(h [][]string) *sensorDynamicHeaderTableIter

func GetSensorTableIter

func GetSensorTableIter(h []string) *sensorTableIter

Types

type AddPagePipe

type AddPagePipe interface {
	Before(p PDF)
	After(p PDF)
}

type PDF

type PDF interface {
	GetX() float64
	GetY() float64
	GetHeight() float64
	GetWidth() float64
	GetPage() uint8
	// 輸出檔案
	Write(w io.Writer) error
	// 直印頁面
	AddDirectPage(pp ...AddPagePipe)
	// 橫印頁面
	AddHorizontalPage(pp ...AddPagePipe)
	// 產生文字
	Text(text string, ts style.TextStyle, align int)
	// 指定位置產生文字
	TextWithPosition(text string, style style.TextStyle, x, y float64)
	// 二列文字說明
	TwoColumnText(text1, text2 string, ts style.TextStyle)
	// 換行
	Br(h float64)
	// 畫線
	Line(width float64)
	// 畫有顔色的綫
	LineWithColor(width float64, Color style.Color)
	// 指定 X,Y 畫線
	LineXY(width, x1, y1, x2, y2 float64)

	ImageReader(imageByte io.Reader)
	ImageReaderPosition(imageByte io.Reader, x, y float64)

	DrawSensorTable(nti *sensorTableIter, ts style.FixRowColumnTableStyle)
	DrawSensorMergeTable(nti *sensorTableIter, pageRows int, mergeRows int, ts style.FixRowColumnTableStyle, pp ...AddPagePipe)
	DrawSensorDynamicHeaderMergeTable(nti *sensorDynamicHeaderTableIter, pageRows int, mergeRows int, ts style.FixRowColumnTableStyle, pp ...AddPagePipe)

	DrawSenStateChartTable(nti *sensorTableIter, ts style.FixRowColumnTableStyle)
	DrawSenStateTable(nti *sensorTableIter, ts style.StateTableStyle, pp ...AddPagePipe)

	// 矩型填滿顏色
	RectFillColor(text string,
		ts style.TextBlockStyle,
		w, h float64,
		align, valign int,
	)
}

func NewPDFv2

func NewPDFv2(fontMap map[string]string, left, right, top, bottom float64) PDF

type SensorCell

type SensorCell struct {
	Value   string
	IsAlert int8
	// if overhigh, then 1;
	// if overlow, then -1;
	// if normal, then 0;
	IsHeader bool
}

type TableValueAryIter

type TableValueAryIter struct {
	Header string
	// contains filtered or unexported fields
}

func GetTableValueAryIter

func GetTableValueAryIter(header string, data []TimeValueAry) *TableValueAryIter

func (*TableValueAryIter) Next

func (vdai *TableValueAryIter) Next(tva *TimeValueAry) bool

type TimeValueAry

type TimeValueAry struct {
	Time   string
	Values []float64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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