Documentation ¶
Index ¶
- type Anchor
- type ClanBookPrinter
- func (cbp *ClanBookPrinter) DrawHorizontalLine(currentX, currentY, toX float64)
- func (cbp *ClanBookPrinter) DrawLongitudeLine(currentX, currentY float64)
- func (cbp *ClanBookPrinter) MemberConv(member *Member, offsetStatus int32, p *PrintProgress) *PdfMember
- func (cbp *ClanBookPrinter) PrintMember(pm *PdfMember, currentX, currentY float64, pageIndex int, ...)
- func (cbp *ClanBookPrinter) Write(path string, member *Member) error
- func (cbp *ClanBookPrinter) WriteWithProgress(path string, pm *PdfMember, p *PrintProgress) error
- type FontStyle
- type Member
- type MemberRelationship
- type Padding
- type PdfMember
- type Person
- type PrintProgress
- type ProgressMessage
- type Size
- type StyleType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClanBookPrinter ¶
type ClanBookPrinter struct { // perStatusHeight float64 // MinStyle minimal font style MinStyle *FontStyle // NorStyle normal font style NorStyle *FontStyle // MaxStyle max font style MaxStyle *FontStyle FontSizeForNum int //用于打印页码 // offsetStatus int32 //代数偏移 WifeNamesIndent float64 //配偶姓名缩进 LineHeight float64 //竖线长度 Padding Padding //内间距 PagePadding Padding //页面内边距,同时用于族谱块内边距 // contains filtered or unexported fields }
ClanBookPrinter 族谱书籍打印
func NewClanBook ¶
func NewClanBook(fromStatus int32, statusName string, startPageNum int, fontPath string) *ClanBookPrinter
NewClanBook create new clan book
func (*ClanBookPrinter) DrawHorizontalLine ¶
func (cbp *ClanBookPrinter) DrawHorizontalLine(currentX, currentY, toX float64)
DrawHorizontalLine 画横线
func (*ClanBookPrinter) DrawLongitudeLine ¶
func (cbp *ClanBookPrinter) DrawLongitudeLine(currentX, currentY float64)
DrawLongitudeLine 往回画竖线
func (*ClanBookPrinter) MemberConv ¶
func (cbp *ClanBookPrinter) MemberConv(member *Member, offsetStatus int32, p *PrintProgress) *PdfMember
MemberConv convert member to pdf's member
func (*ClanBookPrinter) PrintMember ¶
func (cbp *ClanBookPrinter) PrintMember(pm *PdfMember, currentX, currentY float64, pageIndex int, statusHeight map[int32]float64, stopStatus int32, typ StyleType)
PrintMember 打印设计好的族人信息
func (*ClanBookPrinter) Write ¶
func (cbp *ClanBookPrinter) Write(path string, member *Member) error
func (*ClanBookPrinter) WriteWithProgress ¶
func (cbp *ClanBookPrinter) WriteWithProgress(path string, pm *PdfMember, p *PrintProgress) error
WriteWithProgress 附带进度提示
type Member ¶
type Member struct { ID int64 Name string Surname string Status int32 Spouse *MemberRelationship Spouses []*MemberRelationship Children []*Member }
type MemberRelationship ¶
type MemberRelationship struct { ID int64 `xorm:"not null pk autoincr INTEGER id" json:"id"` MemberID int64 `xorm:"not null unique(main) INTEGER member_id" json:"-"` PersonID int64 `xorm:"not null unique(main) INTEGER person_id" json:"-"` Person *Person `xorm:"-" json:"person"` Main bool `xorm:"not null BOOL" json:"main"` IsNormalForm bool `xorm:"not null default true BOOL" json:"isNormalForm"` //婚姻形式 }
MemberRelationship 成员关系
type PdfMember ¶
type Person ¶
type Person struct { ID int64 `xorm:"not null pk autoincr INTEGER id" json:"id"` Name string `xorm:"not null VARCHAR(16)" json:"name"` Birthday *time.Time `xorm:"DATE" json:"birthday"` BirthRecord string `xorm:"VARCHAR(64)" json:"birth_record"` BirthPlace string `xorm:"VARCHAR(256)" json:"birthPlace"` Brief string `xorm:"not null TEXT" json:"brief"` }
Person 人 一些与族谱有关的人
type PrintProgress ¶
type PrintProgress struct { Total int Message chan ProgressMessage // contains filtered or unexported fields }
PrintProgress 打印进度
func CreatePrintProgress ¶
func CreatePrintProgress() *PrintProgress
CreatePrintProgress for clan book making
func (*PrintProgress) Done ¶
func (pp *PrintProgress) Done() <-chan struct{}
type ProgressMessage ¶
Click to show internal directories.
Click to hide internal directories.