Documentation
¶
Index ¶
- Constants
- type App
- type Background
- func (b *Background) GetXmlBytes() ([]byte, error)
- func (b *Background) SetBackground(color, themeColor, themeShade, themeTint string) *Background
- func (b *Background) SetColor(color string) *Background
- func (b *Background) SetThemeColor(themeColor string) *Background
- func (b *Background) SetThemeShade(themeShade string) *Background
- func (b *Background) SetThemeTint(themeTint string) *Background
- type Core
- type Document
- func (d *Document) AddParagraph() *paragraph.Paragraph
- func (d *Document) AddTable() *table.Table
- func (d *Document) AddTableWithColumns(columns int) *table.Table
- func (d *Document) GetBackground() *Background
- func (d *Document) GetContents() []*DocumentContent
- func (d *Document) GetProperties() *StyleConfig
- func (d *Document) GetSection() *section.Section
- func (d *Document) Save(path string) error
- type DocumentContent
- type DocumentContentType
- type Style
- type StyleConfig
- type StyleType
Constants ¶
View Source
const ( DocumentContentTypeParagraph = DocumentContentType("paragraph") DocumentContentTypeTable = DocumentContentType("table") )
View Source
const ( StyleTypeParagraph = StyleType("paragraph") StyleTypeCharacter = StyleType("character") StyleTypeTable = StyleType("table") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { // Template 模板名称 Template string // Application 生产者应用的名称 Application string // Security 加密级别 Security int }
App app.xml
func (*App) GetXmlBytes ¶
type Background ¶
type Background struct {
// contains filtered or unexported fields
}
themeTint 文档的背景配置
func (*Background) GetXmlBytes ¶
func (b *Background) GetXmlBytes() ([]byte, error)
func (*Background) SetBackground ¶
func (b *Background) SetBackground(color, themeColor, themeShade, themeTint string) *Background
SetBackground 设置文档背景
func (*Background) SetThemeColor ¶
func (b *Background) SetThemeColor(themeColor string) *Background
SetThemeColor 设置主题颜色
func (*Background) SetThemeShade ¶
func (b *Background) SetThemeShade(themeShade string) *Background
SetThemeShade 设置主题阴影
func (*Background) SetThemeTint ¶
func (b *Background) SetThemeTint(themeTint string) *Background
SetThemeTint 设置主题的色调值 0-255的16进制字符串
type Core ¶
type Core struct { // CreateUser 创建文档的用户名称 CreateUser string // CreateTime 文档的创建时间 CreateTime time.Time // LastModifyUser 最后修改的用户名 LastModifyUser string // LastModifyTime 最后修改的时间 LastModifyTime time.Time // Version 版本号,每修改一次+1 Version int }
Core core.xml
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document 文档结构定义 该结构统一对.docx格式文档进行操作
func (*Document) AddParagraph ¶
AddParagraph 添加一个段落
func (*Document) AddTableWithColumns ¶
AddTableWithColumns 添加一个拥有指定列数量的表格
func (*Document) GetBackground ¶
func (d *Document) GetBackground() *Background
GetBackground 获取背景配置结构指针
func (*Document) GetContents ¶
func (d *Document) GetContents() []*DocumentContent
func (*Document) GetProperties ¶
func (d *Document) GetProperties() *StyleConfig
func (*Document) GetSection ¶
GetSection 获取节属性配置结构指针
type DocumentContent ¶
type DocumentContent struct {
// contains filtered or unexported fields
}
DocumentContent 文档内容
type DocumentContentType ¶
type DocumentContentType string
type Style ¶
type Style struct {
// contains filtered or unexported fields
}
Style 样式结构
func (*Style) GetXmlBytes ¶
func (*Style) SetStyleType ¶
SetStyleType 设置样式类型
type StyleConfig ¶
type StyleConfig struct {
// contains filtered or unexported fields
}
StyleConfig 样式配置结构
func (*StyleConfig) GetDefaultParagraphProperties ¶
func (s *StyleConfig) GetDefaultParagraphProperties() *paragraph.PPr
func (*StyleConfig) GetDefaultRunProperties ¶
func (s *StyleConfig) GetDefaultRunProperties() *run.RPr
func (*StyleConfig) GetXmlBytes ¶
func (s *StyleConfig) GetXmlBytes() ([]byte, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.