Documentation ¶
Index ¶
- Constants
- type Layout
- type LinkType
- type Master
- type Placeholder
- type PlaceholderType
- type Presentation
- func (p *Presentation) AddSlide(layoutName string) (*Slide, error)
- func (p *Presentation) Close() error
- func (p *Presentation) DeleteSlide(index int) error
- func (p *Presentation) GetLayoutByName(name string) *Layout
- func (p *Presentation) GetMasterByName(name string) *Master
- func (p *Presentation) GetSlide(index int) (*Slide, error)
- func (p *Presentation) GetSlides() []*Slide
- func (p *Presentation) Save(filename string) error
- type Relationship
- type Slide
- type SlideSize
- type TextOption
- type TextOptions
- type TextSegment
Constants ¶
View Source
const ( // PPTX 相关的命名空间 NsRelationships = "http://schemas.openxmlformats.org/package/2006/relationships" NsPresentationML = "http://schemas.openxmlformats.org/presentationml/2006/main" NsDrawingML = "http://schemas.openxmlformats.org/drawingml/2006/main" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Placeholder ¶
type Placeholder struct { Type PlaceholderType Name string Index int Shape *etree.Element // contains filtered or unexported fields }
Placeholder 表示幻灯片中的占位符
func (*Placeholder) SetImage ¶
func (p *Placeholder) SetImage(imagePath string) error
SetImage 设置占位符的图片,支持本地文件路径和网络URL
func (*Placeholder) SetTable ¶
func (p *Placeholder) SetTable(data [][]string) error
SetTable 设置占位符的表格内容
func (*Placeholder) SetText ¶
func (p *Placeholder) SetText(text string, options ...TextOption) error
SetText 设置占位符的文本内容,支持普通文本、LaTeX 公式和超链接
type PlaceholderType ¶
type PlaceholderType int
PlaceholderType 定义占位符类型
const ( PlaceholderTitle PlaceholderType = iota PlaceholderSubTile PlaceholderCrtTitle PlaceholderBody PlaceholderImage PlaceholderChart PlaceholderTable PlaceholderShape PlaceholderHeader PlaceholderSlideNumber PlaceholderDate )
type Presentation ¶
type Presentation struct {
// contains filtered or unexported fields
}
Presentation 表示一个PPTX文件
func (*Presentation) AddSlide ¶
func (p *Presentation) AddSlide(layoutName string) (*Slide, error)
AddSlide 添加新的幻灯片
func (*Presentation) DeleteSlide ¶
func (p *Presentation) DeleteSlide(index int) error
DeleteSlide 删除指定索引的幻灯片
func (*Presentation) GetLayoutByName ¶
func (p *Presentation) GetLayoutByName(name string) *Layout
GetLayoutByName 通过名称获取布局
func (*Presentation) GetMasterByName ¶
func (p *Presentation) GetMasterByName(name string) *Master
GetMasterByName 通过名称获取母版
func (*Presentation) GetSlide ¶
func (p *Presentation) GetSlide(index int) (*Slide, error)
GetSlide 获取指定索引的幻灯片
func (*Presentation) GetSlides ¶ added in v0.0.2
func (p *Presentation) GetSlides() []*Slide
type Relationship ¶ added in v0.0.4
Relationship 定义了 PPTX 中的关系
type Slide ¶
type Slide struct {
// contains filtered or unexported fields
}
Slide 表示一个幻灯片
func (*Slide) GetPlaceholder ¶
func (s *Slide) GetPlaceholder(params ...interface{}) (*Placeholder, error)
GetPlaceholder 通过类型、名称、索引或文本内容获取占位符
func (*Slide) GetPlaceholders ¶
func (s *Slide) GetPlaceholders() ([]*Placeholder, error)
GetPlaceholders 获取幻灯片中所有占位符
type TextOption ¶ added in v0.0.4
type TextOption func(*TextOptions)
TextOption 定义文本设置的选项函数
func WithLink ¶ added in v0.0.4
func WithLink(url string, linkType LinkType) TextOption
WithLink 添加超链接
type TextOptions ¶ added in v0.0.4
TextOptions 定义文本设置的选项
type TextSegment ¶ added in v0.0.3
TextSegment 表示文本片段,可以是普通文本或LaTeX公式
Click to show internal directories.
Click to hide internal directories.