Documentation ¶
Index ¶
- Constants
- type Background
- func (b *Background) GetBackgroundColor() string
- func (b *Background) GetColor() string
- func (b *Background) GetXmlBytes() ([]byte, error)
- func (b *Background) SetBackgroundColor(color string) *Background
- func (b *Background) SetColor(color string) *Background
- func (b *Background) SetMask(val string) *Background
- type Border
- type BorderManager
- func (b *BorderManager) GetXmlBytes() ([]byte, error)
- func (b *BorderManager) SetBetween(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager
- func (b *BorderManager) SetBorder(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager
- func (b *BorderManager) SetBottom(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager
- func (b *BorderManager) SetLeft(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager
- func (b *BorderManager) SetRight(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager
- func (b *BorderManager) SetTop(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager
- type BorderStyle
- type HorizontalAlignmentType
- type Identity
- type LineRuleType
- type PPr
- func (p *PPr) GetBackground() *Background
- func (p *PPr) GetBorder() *BorderManager
- func (p *PPr) GetDefaultXmlBytes() ([]byte, error)
- func (p *PPr) GetExtraXmlBytes() ([]byte, error)
- func (p *PPr) GetId() string
- func (p *PPr) GetIdentity() *Identity
- func (p *PPr) GetInnerXmlBytes() ([]byte, error)
- func (p *PPr) GetSection() *section.Section
- func (p *PPr) GetSpacing() *Spacing
- func (p *PPr) SetHorizontalAlignment(alignment HorizontalAlignmentType) *PPr
- func (p *PPr) SetKeepLines(keepLines bool) *PPr
- func (p *PPr) SetKeepNext(keepNext bool) *PPr
- type Paragraph
- func (p *Paragraph) AddBreakLine(breakLineType run.BreakLineType, breakLineClearType run.BreakLineClearType)
- func (p *Paragraph) AddRun() *run.Run
- func (p *Paragraph) GetProperties() *PPr
- func (p *Paragraph) GetRunProperties() *run.RPr
- func (p *Paragraph) GetRuns() []*run.Run
- func (p *Paragraph) GetXmlBytes() ([]byte, error)
- type Spacing
- func (s *Spacing) GetXmlBytes() ([]byte, error)
- func (s *Spacing) SetAfter(after int) *Spacing
- func (s *Spacing) SetAfterAutoSpacing(auto bool) *Spacing
- func (s *Spacing) SetBefore(before int) *Spacing
- func (s *Spacing) SetBeforeAutoSpacing(auto bool) *Spacing
- func (s *Spacing) SetLine(line int) *Spacing
- func (s *Spacing) SetLineRule(rule LineRuleType) *Spacing
- func (s *Spacing) SetSpace(space int) *Spacing
Constants ¶
View Source
const ( // HorizontalAlignmentStart 左对齐 HorizontalAlignmentStart = HorizontalAlignmentType("start") // HorizontalAlignmentEnd 右对齐 HorizontalAlignmentEnd = HorizontalAlignmentType("end") // HorizontalAlignmentCenter 居中对齐 HorizontalAlignmentCenter = HorizontalAlignmentType("center") // HorizontalAlignmentBoth 左右对齐,不改变字符间距 HorizontalAlignmentBoth = HorizontalAlignmentType("both") // HorizontalAlignmentDistribute 左右对齐,改变字符间距 HorizontalAlignmentDistribute = HorizontalAlignmentType("distribute") )
View Source
const ( BorderStyleNil = BorderStyle("nil") BorderStyleNone = BorderStyle("none") BorderStyleSingle = BorderStyle("single") BorderStyleDashDotStroked = BorderStyle("dashDotStroked") BorderStyleDashed = BorderStyle("dashed") BorderStyleDashSmallGap = BorderStyle("dashSmallGap") BorderStyleDotDash = BorderStyle("dotDash") BorderStyleDotDotDash = BorderStyle("dotDotDash") BorderStyleDotted = BorderStyle("dotted") BorderStyleDouble = BorderStyle("double") BorderStyleDoubleWave = BorderStyle("doubleWave") BorderStyleInset = BorderStyle("inset") BorderStyleOutset = BorderStyle("outset") BorderStyleThick = BorderStyle("thick") BorderStyleThickThinLargeGap = BorderStyle("thickThinLargeGap") BorderStyleThickThinMediumGap = BorderStyle("thickThinMediumGap") BorderStyleThickThinSmallGap = BorderStyle("thickThinSmallGap") BorderStyleThinThickLargeGap = BorderStyle("thinThickLargeGap") BorderStyleThinThickMediumGap = BorderStyle("thinThickMediumGap") BorderStyleThinThickSmallGap = BorderStyle("thinThickSmallGap") BorderStyleThinThickThinLargeGap = BorderStyle("thinThickThinLargeGap") BorderStyleThinThickThinMediumGap = BorderStyle("thinThickThinMediumGap") BorderStyleThinThickThinSmallGap = BorderStyle("thinThickThinSmallGap") BorderStyleThreeDEmboss = BorderStyle("threeDEmboss") BorderStyleThreeDEngrave = BorderStyle("threeDEngrave") BorderStyleTriple = BorderStyle("triple") BorderStyleWave = BorderStyle("wave") )
View Source
const ( LineRuleTypeAtLeast = LineRuleType("atLeast") LineRuleTypeExactly = LineRuleType("exactly") LineRuleTypeAuto = LineRuleType("auto") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Background ¶
type Background struct {
// contains filtered or unexported fields
}
Background 背景配置结构
func (*Background) GetBackgroundColor ¶
func (b *Background) GetBackgroundColor() string
GetBackgroundColor 获取背景色
func (*Background) GetXmlBytes ¶
func (b *Background) GetXmlBytes() ([]byte, error)
func (*Background) SetBackgroundColor ¶
func (b *Background) SetBackgroundColor(color string) *Background
SetBackgroundColor 设置背景色,不包含#号
func (*Background) SetColor ¶
func (b *Background) SetColor(color string) *Background
SetColor 设置前景色,不包含#号
type Border ¶
type Border struct { // Color 颜色值,以十六进制字符串设置,不包含#号,例如FF0000 Color string // Shadow 是否显示阴影 Shadow bool // Space 间距偏移量,以磅(1/72英寸)为单位 Space uint // Size 边框宽度 // 最小值是2,最大值是96 Size uint8 // Style 边框样式 // 段落边框只能是线条边框 Style BorderStyle }
Border 边框结构定义
type BorderManager ¶
type BorderManager struct {
// contains filtered or unexported fields
}
BorderManager 边框管理器
func (*BorderManager) GetXmlBytes ¶
func (b *BorderManager) GetXmlBytes() ([]byte, error)
func (*BorderManager) SetBetween ¶
func (b *BorderManager) SetBetween(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager
SetBetween 设置重合边框
func (*BorderManager) SetBorder ¶
func (b *BorderManager) SetBorder(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager
SetBorder 统一设置边框样式
func (*BorderManager) SetBottom ¶
func (b *BorderManager) SetBottom(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager
SetBottom 设置底部边框
func (*BorderManager) SetLeft ¶
func (b *BorderManager) SetLeft(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager
SetLeft 设置左侧边框
func (*BorderManager) SetRight ¶
func (b *BorderManager) SetRight(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager
SetRight 设置右侧边框
func (*BorderManager) SetTop ¶
func (b *BorderManager) SetTop(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager
SetTop 设置顶部边框
type BorderStyle ¶
type BorderStyle string
type HorizontalAlignmentType ¶
type HorizontalAlignmentType string
type Identity ¶
type Identity struct {
// contains filtered or unexported fields
}
func (*Identity) GetXmlBytes ¶
func (*Identity) SetFirstLine ¶
SetFirstLine 设置首行缩进
type LineRuleType ¶
type LineRuleType string
type PPr ¶
type PPr struct {
// contains filtered or unexported fields
}
PPr 段落的样式属性定义
func (*PPr) GetDefaultXmlBytes ¶
func (*PPr) GetExtraXmlBytes ¶
GetExtraXmlBytes 获取外部样式
func (*PPr) GetInnerXmlBytes ¶
GetInnerXmlBytes 获取内联样式
func (*PPr) SetHorizontalAlignment ¶
func (p *PPr) SetHorizontalAlignment(alignment HorizontalAlignmentType) *PPr
SetHorizontalAlignment 设置水平对齐方式
type Paragraph ¶
type Paragraph struct {
// contains filtered or unexported fields
}
Paragraph 段落结构 每个段落都包含自己的样式属性定义以及任意个 Run 结构
func (*Paragraph) AddBreakLine ¶
func (p *Paragraph) AddBreakLine(breakLineType run.BreakLineType, breakLineClearType run.BreakLineClearType)
AddBreakLine 添加换行符
func (*Paragraph) GetProperties ¶
func (*Paragraph) GetRunProperties ¶
func (*Paragraph) GetXmlBytes ¶
type Spacing ¶
type Spacing struct {
// contains filtered or unexported fields
}
Spacing 段落间距配置
func (*Spacing) GetXmlBytes ¶
func (*Spacing) SetAfterAutoSpacing ¶
SetAfterAutoSpacing 设置段落后间距自动
func (*Spacing) SetBeforeAutoSpacing ¶
SetBeforeAutoSpacing 设置段落前间距自动
func (*Spacing) SetLineRule ¶
func (s *Spacing) SetLineRule(rule LineRuleType) *Spacing
SetLineRule 设置段落内行间距规则
Click to show internal directories.
Click to hide internal directories.