Documentation
¶
Overview ¶
Package gopresentation provides a pure Go library for reading and writing PowerPoint presentation files (.pptx) following the Office Open XML (OOXML) standard.
It is inspired by PHPOffice/PHPPresentation and provides an idiomatic Go API for creating, manipulating, and saving presentation documents.
See the Version variable for the current library version.
Index ¶
- Constants
- Variables
- func Centimeter(n float64) int64
- func DecodeEMFForTest(data []byte) image.Image
- func EMUToCentimeter(emu int64) float64
- func EMUToInch(emu int64) float64
- func EMUToMillimeter(emu int64) float64
- func EMUToPoint(emu int64) float64
- func Inch(n float64) int64
- func Millimeter(n float64) int64
- func Point(n float64) int64
- type Alignment
- type Animation
- type AreaChart
- type ArrowSize
- type ArrowType
- type AutoFitType
- type AutoShape
- func (a *AutoShape) GetAdjustValues() map[string]int
- func (a *AutoShape) GetAutoShapeType() AutoShapeType
- func (a *AutoShape) GetHeadEnd() *LineEnd
- func (a *AutoShape) GetParagraphs() []*Paragraph
- func (a *AutoShape) GetTailEnd() *LineEnd
- func (a *AutoShape) GetText() string
- func (a *AutoShape) GetType() ShapeType
- func (a *AutoShape) SetAutoShapeType(t AutoShapeType) *AutoShape
- func (a *AutoShape) SetGeometry(t AutoShapeType) *AutoShape
- func (a *AutoShape) SetSolidFill(c Color) *AutoShape
- func (a *AutoShape) SetText(text string) *AutoShape
- type AutoShapeType
- type Bar3DChart
- type BarChart
- type BaseShape
- func (b *BaseShape) GetBorder() *Border
- func (b *BaseShape) GetDescription() string
- func (b *BaseShape) GetFill() *Fill
- func (b *BaseShape) GetFlipHorizontal() bool
- func (b *BaseShape) GetFlipVertical() bool
- func (b *BaseShape) GetHeight() int64
- func (b *BaseShape) GetHyperlink() *Hyperlink
- func (b *BaseShape) GetName() string
- func (b *BaseShape) GetOffsetX() int64
- func (b *BaseShape) GetOffsetY() int64
- func (b *BaseShape) GetRotation() int
- func (b *BaseShape) GetShadow() *Shadow
- func (b *BaseShape) GetWidth() int64
- func (b *BaseShape) SetBorder(border *Border)
- func (b *BaseShape) SetDescription(d string)
- func (b *BaseShape) SetFill(f *Fill)
- func (b *BaseShape) SetFlipHorizontal(flip bool) *BaseShape
- func (b *BaseShape) SetFlipVertical(flip bool) *BaseShape
- func (b *BaseShape) SetHeight(h int64) *BaseShape
- func (b *BaseShape) SetHyperlink(h *Hyperlink)
- func (b *BaseShape) SetName(n string) *BaseShape
- func (b *BaseShape) SetOffsetX(x int64) *BaseShape
- func (b *BaseShape) SetOffsetY(y int64) *BaseShape
- func (b *BaseShape) SetPosition(x, y int64) *BaseShape
- func (b *BaseShape) SetRotation(r int) *BaseShape
- func (b *BaseShape) SetShadow(s *Shadow)
- func (b *BaseShape) SetSize(w, h int64) *BaseShape
- func (b *BaseShape) SetWidth(w int64) *BaseShape
- type Border
- type BorderStyle
- type BreakElement
- type Bullet
- type BulletType
- type CellBorders
- type ChartAxis
- func (a *ChartAxis) ClearMaxBounds() *ChartAxis
- func (a *ChartAxis) ClearMinBounds() *ChartAxis
- func (a *ChartAxis) SetCrossesAt(v string) *ChartAxis
- func (a *ChartAxis) SetMajorGridlines(g *Gridlines) *ChartAxis
- func (a *ChartAxis) SetMajorTickMark(v string) *ChartAxis
- func (a *ChartAxis) SetMajorUnit(v float64) *ChartAxis
- func (a *ChartAxis) SetMaxBounds(v float64) *ChartAxis
- func (a *ChartAxis) SetMinBounds(v float64) *ChartAxis
- func (a *ChartAxis) SetMinorGridlines(g *Gridlines) *ChartAxis
- func (a *ChartAxis) SetMinorTickMark(v string) *ChartAxis
- func (a *ChartAxis) SetMinorUnit(v float64) *ChartAxis
- func (a *ChartAxis) SetReversedOrder(v bool) *ChartAxis
- func (a *ChartAxis) SetTickLabelPosition(v string) *ChartAxis
- func (a *ChartAxis) SetTitle(title string) *ChartAxis
- func (a *ChartAxis) SetTitleRotation(deg int) *ChartAxis
- func (a *ChartAxis) SetVisible(v bool) *ChartAxis
- type ChartLegend
- type ChartSeries
- type ChartShape
- func (c *ChartShape) GetDisplayBlankAs() string
- func (c *ChartShape) GetLegend() *ChartLegend
- func (c *ChartShape) GetPlotArea() *PlotArea
- func (c *ChartShape) GetTitle() *ChartTitle
- func (c *ChartShape) GetType() ShapeType
- func (c *ChartShape) GetView3D() *View3D
- func (c *ChartShape) SetDisplayBlankAs(mode string)
- type ChartTitle
- type ChartType
- type Color
- type Comment
- type CommentAuthor
- type CustomGeomPath
- type CustomProperty
- type DocumentLayout
- type DocumentProperties
- func (dp *DocumentProperties) GetCustomProperties() []string
- func (dp *DocumentProperties) GetCustomPropertyType(name string) PropertyType
- func (dp *DocumentProperties) GetCustomPropertyValue(name string) interface{}
- func (dp *DocumentProperties) IsCustomPropertySet(name string) bool
- func (dp *DocumentProperties) SetCustomProperty(name string, value interface{}, propType PropertyType)
- type DoughnutChart
- type DrawingShape
- func (d *DrawingShape) GetAlphaValue() int
- func (d *DrawingShape) GetCropBottom() int
- func (d *DrawingShape) GetCropLeft() int
- func (d *DrawingShape) GetCropRight() int
- func (d *DrawingShape) GetCropTop() int
- func (d *DrawingShape) GetImageData() []byte
- func (d *DrawingShape) GetMimeType() string
- func (d *DrawingShape) GetPath() string
- func (d *DrawingShape) GetType() ShapeType
- func (d *DrawingShape) SetHeight(h int64) *DrawingShape
- func (d *DrawingShape) SetImageData(data []byte, mimeType string) *DrawingShape
- func (d *DrawingShape) SetImageFromFile(path string) error
- func (d *DrawingShape) SetOffsetX(x int64) *DrawingShape
- func (d *DrawingShape) SetOffsetY(y int64) *DrawingShape
- func (d *DrawingShape) SetPath(path string) *DrawingShape
- func (d *DrawingShape) SetWidth(w int64) *DrawingShape
- type Fill
- type FillType
- type Font
- func (f *Font) SetBold(bold bool) *Font
- func (f *Font) SetColor(color Color) *Font
- func (f *Font) SetItalic(italic bool) *Font
- func (f *Font) SetName(name string) *Font
- func (f *Font) SetSize(size int) *Font
- func (f *Font) SetStrikethrough(s bool) *Font
- func (f *Font) SetUnderline(u UnderlineType) *Font
- type FontCache
- func (fc *FontCache) GetFace(name string, sizePt float64, bold, italic bool) font.Face
- func (fc *FontCache) GetMeasureFace(name string, sizePt float64, bold, italic bool) font.Face
- func (fc *FontCache) LoadFont(name string, path string) error
- func (fc *FontCache) LoadFontData(name string, data []byte) error
- type Gridlines
- type GroupShape
- type HorizontalAlignment
- type Hyperlink
- type ImageFormat
- type LegendPosition
- type LineChart
- type LineEnd
- type LineShape
- func (l *LineShape) GetAdjustValues() map[string]int
- func (l *LineShape) GetConnectorType() string
- func (l *LineShape) GetHeadEnd() *LineEnd
- func (l *LineShape) GetLineColor() Color
- func (l *LineShape) GetLineStyle() BorderStyle
- func (l *LineShape) GetLineWidth() int
- func (l *LineShape) GetLineWidthEMU() int
- func (l *LineShape) GetTailEnd() *LineEnd
- func (l *LineShape) GetType() ShapeType
- func (l *LineShape) SetHeadEnd(e *LineEnd) *LineShape
- func (l *LineShape) SetLineColor(c Color) *LineShape
- func (l *LineShape) SetLineStyle(s BorderStyle) *LineShape
- func (l *LineShape) SetLineWidth(w int) *LineShape
- func (l *LineShape) SetTailEnd(e *LineEnd) *LineShape
- type PPTXReader
- type PPTXWriter
- type Paragraph
- func (p *Paragraph) CreateBreak() *BreakElement
- func (p *Paragraph) CreateTextRun(text string) *TextRun
- func (p *Paragraph) GetAlignment() *Alignment
- func (p *Paragraph) GetBullet() *Bullet
- func (p *Paragraph) GetElements() []ParagraphElement
- func (p *Paragraph) GetLineSpacing() int
- func (p *Paragraph) GetSpaceAfter() int
- func (p *Paragraph) GetSpaceBefore() int
- func (p *Paragraph) SetAlignment(a *Alignment)
- func (p *Paragraph) SetBullet(b *Bullet)
- func (p *Paragraph) SetLineSpacing(spacing int)
- func (p *Paragraph) SetSpaceAfter(v int)
- func (p *Paragraph) SetSpaceBefore(v int)
- type ParagraphElement
- type PathCommand
- type PathPoint
- type Pie3DChart
- type PieChart
- type PlaceholderShape
- func (p *PlaceholderShape) Clear()
- func (p *PlaceholderShape) ClearAll()
- func (p *PlaceholderShape) GetPlaceholderIndex() int
- func (p *PlaceholderShape) GetPlaceholderType() PlaceholderType
- func (p *PlaceholderShape) GetType() ShapeType
- func (p *PlaceholderShape) Remove(slide *Slide) bool
- func (p *PlaceholderShape) SetPlaceholderIndex(idx int)
- func (p *PlaceholderShape) SetText(text string)
- type PlaceholderType
- type PlotArea
- type Presentation
- func (p *Presentation) AddDefaultSlideWithLayout(layoutName string) (*Slide, error)
- func (p *Presentation) AddSlide(slide *Slide) *Slide
- func (p *Presentation) AddSlideWithLayout(layoutName string) (*Slide, error)
- func (p *Presentation) Close() error
- func (p *Presentation) CopySlide(index int) (*Slide, error)
- func (p *Presentation) CreateSlide() *Slide
- func (p *Presentation) CreateSlideMaster() *SlideMaster
- func (p *Presentation) ExtractText() string
- func (p *Presentation) GetActiveSlide() *Slide
- func (p *Presentation) GetActiveSlideIndex() int
- func (p *Presentation) GetAllSlides() []*Slide
- func (p *Presentation) GetDocumentProperties() *DocumentProperties
- func (p *Presentation) GetLayout() *DocumentLayout
- func (p *Presentation) GetLayoutByName(name string) (*SlideLayout, error)
- func (p *Presentation) GetPresentationProperties() *PresentationProperties
- func (p *Presentation) GetSlide(index int) (*Slide, error)
- func (p *Presentation) GetSlideCount() int
- func (p *Presentation) GetSlideLayouts() []*SlideLayout
- func (p *Presentation) GetSlideMasters() []*SlideMaster
- func (p *Presentation) MoveSlide(fromIndex, toIndex int) error
- func (p *Presentation) RemoveSlideByIndex(index int) error
- func (p *Presentation) Save(path string) error
- func (p *Presentation) SaveAsTemplate(path string) error
- func (p *Presentation) SaveSlideAsImage(slideIndex int, path string, opts *RenderOptions) error
- func (p *Presentation) SaveSlidesAsImages(pattern string, opts *RenderOptions) error
- func (p *Presentation) SaveToFile(path string) error
- func (p *Presentation) SaveToFileAsTemplate(path string) error
- func (p *Presentation) SetActiveSlideIndex(index int) error
- func (p *Presentation) SetDocumentProperties(props *DocumentProperties)
- func (p *Presentation) SetLayout(layout *DocumentLayout)
- func (p *Presentation) SlideToImage(slideIndex int, opts *RenderOptions) (image.Image, error)
- func (p *Presentation) Slides() []*Slide
- func (p *Presentation) SlidesToImages(opts *RenderOptions) ([]image.Image, error)
- func (p *Presentation) Validate() error
- func (p *Presentation) WriteTo(w io.Writer) error
- type PresentationProperties
- func (pp *PresentationProperties) GetLastView() ViewType
- func (pp *PresentationProperties) GetSlideshowType() SlideshowType
- func (pp *PresentationProperties) GetThumbnailData() []byte
- func (pp *PresentationProperties) GetThumbnailPath() string
- func (pp *PresentationProperties) GetZoom() float64
- func (pp *PresentationProperties) IsCommentVisible() bool
- func (pp *PresentationProperties) IsMarkedAsFinal() bool
- func (pp *PresentationProperties) MarkAsFinal(final ...bool)
- func (pp *PresentationProperties) SetCommentVisible(visible bool)
- func (pp *PresentationProperties) SetLastView(view ViewType)
- func (pp *PresentationProperties) SetSlideshowType(t SlideshowType)
- func (pp *PresentationProperties) SetThumbnailData(data []byte)
- func (pp *PresentationProperties) SetThumbnailPath(path string)
- func (pp *PresentationProperties) SetZoom(zoom float64)
- type PropertyType
- type RadarChart
- type Reader
- type ReaderType
- type RenderOptions
- type RichTextShape
- func (r *RichTextShape) CreateBreak() *BreakElement
- func (r *RichTextShape) CreateParagraph() *Paragraph
- func (r *RichTextShape) CreateTextRun(text string) *TextRun
- func (r *RichTextShape) GetActiveParagraph() *Paragraph
- func (r *RichTextShape) GetAutoFit() AutoFitType
- func (r *RichTextShape) GetColumns() int
- func (r *RichTextShape) GetCustomPath() *CustomGeomPath
- func (r *RichTextShape) GetParagraphs() []*Paragraph
- func (r *RichTextShape) GetTextAnchor() TextAnchorType
- func (r *RichTextShape) GetType() ShapeType
- func (r *RichTextShape) GetWordWrap() bool
- func (r *RichTextShape) SetAutoFit(fit AutoFitType)
- func (r *RichTextShape) SetColumns(cols int)
- func (r *RichTextShape) SetHeight(h int64) *RichTextShape
- func (r *RichTextShape) SetOffsetX(x int64) *RichTextShape
- func (r *RichTextShape) SetOffsetY(y int64) *RichTextShape
- func (r *RichTextShape) SetTextAnchor(anchor TextAnchorType)
- func (r *RichTextShape) SetWidth(w int64) *RichTextShape
- func (r *RichTextShape) SetWordWrap(wrap bool)
- type ScatterChart
- type SeriesMarker
- type SeriesOutline
- type Shadow
- type Shape
- type ShapeType
- type Slide
- func (s *Slide) AddAnimation(a *Animation)
- func (s *Slide) AddAutoShape() *AutoShape
- func (s *Slide) AddComment(c *Comment)
- func (s *Slide) AddImage(path string) (*DrawingShape, error)
- func (s *Slide) AddImageData(data []byte, mimeType string) *DrawingShape
- func (s *Slide) AddShape(shape Shape)
- func (s *Slide) AddTable(rows, cols int) *TableShape
- func (s *Slide) AddTextBox() *RichTextShape
- func (s *Slide) CreateAutoShape() *AutoShape
- func (s *Slide) CreateChartShape() *ChartShape
- func (s *Slide) CreateDrawingShape() *DrawingShape
- func (s *Slide) CreateGroupShape() *GroupShape
- func (s *Slide) CreateLineShape() *LineShape
- func (s *Slide) CreatePlaceholderShape(phType PlaceholderType) *PlaceholderShape
- func (s *Slide) CreateRichTextShape() *RichTextShape
- func (s *Slide) CreateTableShape(rows, cols int) *TableShape
- func (s *Slide) ExtractText() string
- func (s *Slide) GetAnimations() []*Animation
- func (s *Slide) GetBackground() *Fill
- func (s *Slide) GetCommentCount() int
- func (s *Slide) GetComments() []*Comment
- func (s *Slide) GetName() string
- func (s *Slide) GetNotes() string
- func (s *Slide) GetPlaceholder(phType PlaceholderType) *PlaceholderShape
- func (s *Slide) GetPlaceholderByIndex(idx int) *PlaceholderShape
- func (s *Slide) GetPlaceholders() []*PlaceholderShape
- func (s *Slide) GetShapeCount() int
- func (s *Slide) GetShapes() []Shape
- func (s *Slide) GetTextBoxes() []*RichTextShape
- func (s *Slide) GetTransition() *Transition
- func (s *Slide) IsVisible() bool
- func (s *Slide) RemoveShape(index int) error
- func (s *Slide) RemoveShapeByPointer(target Shape) bool
- func (s *Slide) SetBackground(f *Fill)
- func (s *Slide) SetName(name string)
- func (s *Slide) SetNotes(notes string)
- func (s *Slide) SetTransition(t *Transition)
- func (s *Slide) SetVisible(visible bool)
- type SlideLayout
- type SlideMaster
- type SlideshowType
- type TableCell
- func (tc *TableCell) GetBorders() *CellBorders
- func (tc *TableCell) GetColSpan() int
- func (tc *TableCell) GetFill() *Fill
- func (tc *TableCell) GetParagraphs() []*Paragraph
- func (tc *TableCell) GetRowSpan() int
- func (tc *TableCell) SetColSpan(span int)
- func (tc *TableCell) SetFill(f *Fill)
- func (tc *TableCell) SetRowSpan(span int)
- func (tc *TableCell) SetText(text string) *TableCell
- type TableShape
- func (t *TableShape) GetCell(row, col int) *TableCell
- func (t *TableShape) GetNumCols() int
- func (t *TableShape) GetNumRows() int
- func (t *TableShape) GetRows() [][]*TableCell
- func (t *TableShape) GetType() ShapeType
- func (t *TableShape) SetHeight(h int64) *TableShape
- func (t *TableShape) SetWidth(w int64) *TableShape
- type TextAnchorType
- type TextRun
- type Transition
- type TransitionSpeed
- type TransitionType
- type UnderlineType
- type VerticalAlignment
- type View3D
- type ViewType
- type Writer
- type WriterType
Constants ¶
const ( NumFormatArabicPeriod = "arabicPeriod" NumFormatArabicParen = "arabicParenR" NumFormatRomanUcPeriod = "romanUcPeriod" NumFormatRomanLcPeriod = "romanLcPeriod" NumFormatAlphaUcPeriod = "alphaUcPeriod" NumFormatAlphaLcPeriod = "alphaLcPeriod" NumFormatAlphaLcParen = "alphaLcParenR" )
Numeric format constants.
const ( ChartBlankAsGap = "gap" ChartBlankAsZero = "zero" ChartBlankAsSpan = "span" )
Chart display blank constants.
const ( AxisCrossesAuto = "autoZero" AxisCrossesMin = "min" AxisCrossesMax = "max" )
Axis crossing constants.
const ( TickMarkNone = "none" TickMarkInside = "in" TickMarkOutside = "out" TickMarkCross = "cross" )
Tick mark constants.
const ( TickLabelPosNextTo = "nextTo" TickLabelPosHigh = "high" TickLabelPosLow = "low" )
Tick label position constants.
const ( LabelInsideEnd = "inEnd" LabelOutsideEnd = "outEnd" LabelCenter = "ctr" LabelInsideBase = "inBase" LabelBestFit = "bestFit" )
Series label position constants.
const ( MarkerCircle = "circle" MarkerDash = "dash" MarkerDiamond = "diamond" MarkerDot = "dot" MarkerPlus = "plus" MarkerSquare = "square" MarkerStar = "star" MarkerTriangle = "triangle" MarkerX = "x" MarkerNone = "none" )
Marker symbol constants.
const ( BarGroupingClustered = "clustered" BarGroupingStacked = "stacked" BarGroupingPercentStacked = "percentStacked" )
Bar grouping constants.
const ( BarDirectionVertical = "col" BarDirectionHorizontal = "bar" )
Bar direction constants.
const ( LayoutScreen4x3 = "screen4x3" LayoutScreen16x9 = "screen16x9" LayoutScreen16x10 = "screen16x10" LayoutA4 = "A4" LayoutLetter = "letter" LayoutCustom = "custom" )
Standard layout constants (in EMU: 1 inch = 914400 EMU).
const ( VersionMajor = 1 VersionMinor = 0 VersionPatch = 0 )
Version information for the GoPresentation library.
Variables ¶
var ( ColorBlack = Color{ARGB: "FF000000"} ColorWhite = Color{ARGB: "FFFFFFFF"} ColorRed = Color{ARGB: "FFFF0000"} ColorGreen = Color{ARGB: "FF00FF00"} ColorBlue = Color{ARGB: "FF0000FF"} ColorYellow = Color{ARGB: "FFFFFF00"} )
Predefined colors.
var Version = fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
Version is the full version string of the GoPresentation library.
Functions ¶
func DecodeEMFForTest ¶
DecodeEMFForTest is an exported wrapper for testing EMF decoding.
func EMUToCentimeter ¶
EMUToCentimeter converts EMU to centimeters.
func EMUToMillimeter ¶
EMUToMillimeter converts EMU to millimeters.
Types ¶
type Alignment ¶
type Alignment struct {
Horizontal HorizontalAlignment
Vertical VerticalAlignment
MarginLeft int64 // in EMU
MarginRight int64
MarginTop int64
MarginBottom int64
Indent int64
Level int
}
Alignment represents text alignment properties.
func NewAlignment ¶
func NewAlignment() *Alignment
NewAlignment creates a new Alignment with defaults.
func (*Alignment) SetHorizontal ¶
func (a *Alignment) SetHorizontal(h HorizontalAlignment) *Alignment
SetHorizontal sets horizontal alignment.
func (*Alignment) SetVertical ¶
func (a *Alignment) SetVertical(v VerticalAlignment) *Alignment
SetVertical sets vertical alignment.
type Animation ¶
type Animation struct {
ShapeIndexes []int // indexes of shapes in this animation group
}
Animation represents a slide animation.
func (*Animation) GetShapeIndexes ¶
GetShapeIndexes returns the shape indexes.
type AreaChart ¶
type AreaChart struct {
Series []*ChartSeries
}
AreaChart represents an area chart.
func (*AreaChart) AddSeries ¶
func (a *AreaChart) AddSeries(s *ChartSeries) *AreaChart
AddSeries adds a data series.
func (*AreaChart) GetChartTypeName ¶
type AutoFitType ¶
type AutoFitType int
AutoFitType represents the auto-fit behavior.
const ( AutoFitNone AutoFitType = iota AutoFitNormal AutoFitShape )
type AutoShape ¶
type AutoShape struct {
BaseShape
// contains filtered or unexported fields
}
AutoShape represents a predefined shape (rectangle, ellipse, etc.).
func (*AutoShape) GetAdjustValues ¶
func (*AutoShape) GetAutoShapeType ¶
func (a *AutoShape) GetAutoShapeType() AutoShapeType
GetAutoShapeType returns the auto shape type.
func (*AutoShape) GetHeadEnd ¶
GetAdjustValues returns the adjustment values map. GetHeadEnd returns the head end arrow.
func (*AutoShape) GetParagraphs ¶
GetParagraphs returns the rich text paragraphs (if any).
func (*AutoShape) GetTailEnd ¶
GetTailEnd returns the tail end arrow.
func (*AutoShape) SetAutoShapeType ¶
func (a *AutoShape) SetAutoShapeType(t AutoShapeType) *AutoShape
SetAutoShapeType sets the auto shape type.
func (*AutoShape) SetGeometry ¶
func (a *AutoShape) SetGeometry(t AutoShapeType) *AutoShape
SetGeometry sets the shape geometry type (alias for SetAutoShapeType). This matches the unioffice naming convention.
func (*AutoShape) SetSolidFill ¶
SetSolidFill sets a solid fill on the auto shape.
type AutoShapeType ¶
type AutoShapeType string
AutoShapeType represents the type of auto shape.
const ( AutoShapeRectangle AutoShapeType = "rect" AutoShapeRoundedRect AutoShapeType = "roundRect" AutoShapeEllipse AutoShapeType = "ellipse" AutoShapeTriangle AutoShapeType = "triangle" AutoShapeDiamond AutoShapeType = "diamond" AutoShapeParallelogram AutoShapeType = "parallelogram" AutoShapeTrapezoid AutoShapeType = "trapezoid" AutoShapePentagon AutoShapeType = "pentagon" AutoShapeHexagon AutoShapeType = "hexagon" AutoShapeArrowRight AutoShapeType = "rightArrow" AutoShapeArrowLeft AutoShapeType = "leftArrow" AutoShapeArrowUp AutoShapeType = "upArrow" AutoShapeArrowDown AutoShapeType = "downArrow" AutoShapeStar4 AutoShapeType = "star4" AutoShapeStar5 AutoShapeType = "star5" AutoShapeStar10 AutoShapeType = "star10" AutoShapeStar12 AutoShapeType = "star12" AutoShapeStar16 AutoShapeType = "star16" AutoShapeStar24 AutoShapeType = "star24" AutoShapeStar32 AutoShapeType = "star32" AutoShapeHeart AutoShapeType = "heart" AutoShapeLightningBolt AutoShapeType = "lightningBolt" AutoShapeChevron AutoShapeType = "chevron" AutoShapeCloud AutoShapeType = "cloud" AutoShapePlus AutoShapeType = "mathPlus" AutoShapeMinus AutoShapeType = "mathMinus" AutoShapeFlowchartProcess AutoShapeType = "flowChartProcess" AutoShapeFlowchartDecision AutoShapeType = "flowChartDecision" AutoShapeFlowchartPreparation AutoShapeType = "flowChartPreparation" AutoShapeCallout1 AutoShapeType = "wedgeRoundRectCallout" AutoShapeCallout2 AutoShapeType = "wedgeEllipseCallout" AutoShapeRibbon AutoShapeType = "ribbon2" AutoShapeSmileyFace AutoShapeType = "smileyFace" AutoShapeDonut AutoShapeType = "donut" AutoShapeNoSmoking AutoShapeType = "noSmoking" AutoShapeBlockArc AutoShapeType = "blockArc" AutoShapeCube AutoShapeType = "cube" AutoShapeCan AutoShapeType = "can" AutoShapeBevel AutoShapeType = "bevel" AutoShapeFoldedCorner AutoShapeType = "foldedCorner" AutoShapeFrame AutoShapeType = "frame" AutoShapePlaque AutoShapeType = "plaque" AutoShapeLeftRightArrow AutoShapeType = "leftRightArrow" AutoShapeRtTriangle AutoShapeType = "rtTriangle" AutoShapeHomePlate AutoShapeType = "homePlate" AutoShapeSnip2SameRect AutoShapeType = "snip2SameRect" AutoShapePie AutoShapeType = "pie" AutoShapeArc AutoShapeType = "arc" AutoShapeBentArrow AutoShapeType = "bentArrow" AutoShapeUturnArrow AutoShapeType = "uturnArrow" AutoShapeMathEqual AutoShapeType = "mathEqual" AutoShapeCurvedRightArrow AutoShapeType = "curvedRightArrow" AutoShapeCurvedLeftArrow AutoShapeType = "curvedLeftArrow" AutoShapeCurvedUpArrow AutoShapeType = "curvedUpArrow" AutoShapeCurvedDownArrow AutoShapeType = "curvedDownArrow" )
type Bar3DChart ¶
type Bar3DChart struct {
BarChart
}
Bar3DChart represents a 3D bar chart.
func (*Bar3DChart) GetChartTypeName ¶
func (b *Bar3DChart) GetChartTypeName() string
type BarChart ¶
type BarChart struct {
Series []*ChartSeries
BarGrouping string
BarDirection string
GapWidthPercent int
OverlapPercent int
}
BarChart represents a bar/column chart.
func (*BarChart) AddSeries ¶
func (b *BarChart) AddSeries(s *ChartSeries) *BarChart
AddSeries adds a data series.
func (*BarChart) GetChartTypeName ¶
func (*BarChart) SetBarGrouping ¶
SetBarGrouping sets the bar grouping type.
func (*BarChart) SetGapWidthPercent ¶
SetGapWidthPercent sets the gap width percentage (0-500).
func (*BarChart) SetOverlapPercent ¶
SetOverlapPercent sets the overlap percentage (-100 to 100).
type BaseShape ¶
type BaseShape struct {
// contains filtered or unexported fields
}
BaseShape contains common shape properties.
func (*BaseShape) GetDescription ¶
func (*BaseShape) GetFlipHorizontal ¶
GetFlipHorizontal returns whether the shape is flipped horizontally.
func (*BaseShape) GetFlipVertical ¶
GetFlipVertical returns whether the shape is flipped vertically.
func (*BaseShape) GetHyperlink ¶
func (*BaseShape) GetOffsetX ¶
func (*BaseShape) GetOffsetY ¶
func (*BaseShape) GetRotation ¶
func (*BaseShape) SetDescription ¶
func (*BaseShape) SetFlipHorizontal ¶
SetFlipHorizontal controls horizontal flipping.
func (*BaseShape) SetFlipVertical ¶
SetFlipVertical controls vertical flipping.
func (*BaseShape) SetHyperlink ¶
func (*BaseShape) SetOffsetX ¶
func (*BaseShape) SetOffsetY ¶
func (*BaseShape) SetPosition ¶
SetPosition sets both offset X and Y in EMU.
func (*BaseShape) SetRotation ¶
type Border ¶
type Border struct {
Style BorderStyle
Width int // in points (1 pt = 12700 EMU)
Color Color
}
Border represents a shape border.
func (*Border) SetSolidFill ¶
SetSolidFill sets a solid border with the given color.
type BorderStyle ¶
type BorderStyle string
BorderStyle represents the border line style.
const ( BorderNone BorderStyle = "none" BorderSolid BorderStyle = "solid" BorderDash BorderStyle = "dash" BorderDot BorderStyle = "dot" )
type BreakElement ¶
type BreakElement struct{}
BreakElement represents a line break.
func (*BreakElement) GetElementType ¶
func (br *BreakElement) GetElementType() string
type Bullet ¶
type Bullet struct {
Type BulletType
Style string // character for BulletChar, e.g. "•", "–"
Font string // font name for BulletChar
StartAt int // starting number for BulletNumeric
NumFormat string // numeric format: "arabicPeriod", "romanUcPeriod", etc.
Color *Color
Size int // percentage of text size (25-400)
}
Bullet represents a paragraph bullet style.
func (*Bullet) SetCharBullet ¶
SetCharBullet sets a character bullet.
func (*Bullet) SetNumericBullet ¶
SetNumericBullet sets a numeric bullet.
type BulletType ¶
type BulletType int
BulletType represents the type of bullet.
const ( BulletTypeNone BulletType = iota BulletTypeChar // character bullet BulletTypeNumeric // numbered bullet BulletTypeAutoNum // auto-numbered )
type CellBorders ¶
CellBorders represents borders for a table cell.
type ChartAxis ¶
type ChartAxis struct {
Title string
TitleRotation int
Visible bool
MinBounds *float64
MaxBounds *float64
MinorUnit *float64
MajorUnit *float64
CrossesAt string
ReversedOrder bool
Font *Font
MajorGridlines *Gridlines
MinorGridlines *Gridlines
MajorTickMark string
MinorTickMark string
TickLabelPos string
OutlineWidth int
OutlineColor Color
}
ChartAxis represents a chart axis.
func (*ChartAxis) ClearMaxBounds ¶
ClearMaxBounds clears the maximum bounds.
func (*ChartAxis) ClearMinBounds ¶
ClearMinBounds clears the minimum bounds.
func (*ChartAxis) SetCrossesAt ¶
SetCrossesAt sets where the axis crosses.
func (*ChartAxis) SetMajorGridlines ¶
SetMajorGridlines sets the major gridlines.
func (*ChartAxis) SetMajorTickMark ¶
SetMajorTickMark sets the major tick mark style.
func (*ChartAxis) SetMajorUnit ¶
SetMajorUnit sets the major unit.
func (*ChartAxis) SetMaxBounds ¶
SetMaxBounds sets the maximum bounds.
func (*ChartAxis) SetMinBounds ¶
SetMinBounds sets the minimum bounds.
func (*ChartAxis) SetMinorGridlines ¶
SetMinorGridlines sets the minor gridlines.
func (*ChartAxis) SetMinorTickMark ¶
SetMinorTickMark sets the minor tick mark style.
func (*ChartAxis) SetMinorUnit ¶
SetMinorUnit sets the minor unit.
func (*ChartAxis) SetReversedOrder ¶
SetReversedOrder sets whether the axis is reversed.
func (*ChartAxis) SetTickLabelPosition ¶
SetTickLabelPosition sets the tick label position.
func (*ChartAxis) SetTitleRotation ¶
SetTitleRotation sets the axis title rotation in degrees.
func (*ChartAxis) SetVisible ¶
SetVisible sets axis visibility.
type ChartLegend ¶
type ChartLegend struct {
Visible bool
Position LegendPosition
Font *Font
}
ChartLegend represents a chart legend.
type ChartSeries ¶
type ChartSeries struct {
Title string
Values map[string]float64 // category -> value
Categories []string // ordered category names
FillColor Color
ShowCategoryName bool
ShowLegendKey bool
ShowPercentage bool
ShowSeriesName bool
ShowValue bool
Separator string
LabelPosition string
Font *Font
Outline *SeriesOutline
Marker *SeriesMarker
}
ChartSeries represents a data series in a chart.
func NewChartSeries ¶
func NewChartSeries(title string, data map[string]float64) *ChartSeries
NewChartSeries creates a new chart series. Note: map iteration order is non-deterministic in Go, so category order may vary. Use NewChartSeriesOrdered for deterministic ordering.
func NewChartSeriesOrdered ¶
func NewChartSeriesOrdered(title string, categories []string, values []float64) *ChartSeries
NewChartSeriesOrdered creates a series with ordered categories. If len(values) < len(categories), missing values default to 0. Extra values beyond len(categories) are ignored.
func (*ChartSeries) SetFillColor ¶
func (s *ChartSeries) SetFillColor(c Color) *ChartSeries
SetFillColor sets the series fill color.
func (*ChartSeries) SetLabelPosition ¶
func (s *ChartSeries) SetLabelPosition(pos string) *ChartSeries
SetLabelPosition sets the data label position.
type ChartShape ¶
type ChartShape struct {
BaseShape
// contains filtered or unexported fields
}
ChartShape represents a chart embedded in a slide.
func (*ChartShape) GetDisplayBlankAs ¶
func (c *ChartShape) GetDisplayBlankAs() string
GetDisplayBlankAs returns how blank values are displayed.
func (*ChartShape) GetLegend ¶
func (c *ChartShape) GetLegend() *ChartLegend
GetLegend returns the chart legend.
func (*ChartShape) GetPlotArea ¶
func (c *ChartShape) GetPlotArea() *PlotArea
GetPlotArea returns the plot area.
func (*ChartShape) GetTitle ¶
func (c *ChartShape) GetTitle() *ChartTitle
GetTitle returns the chart title.
func (*ChartShape) GetType ¶
func (c *ChartShape) GetType() ShapeType
func (*ChartShape) GetView3D ¶
func (c *ChartShape) GetView3D() *View3D
GetView3D returns the 3D view settings.
func (*ChartShape) SetDisplayBlankAs ¶
func (c *ChartShape) SetDisplayBlankAs(mode string)
SetDisplayBlankAs sets how blank values are displayed.
type ChartTitle ¶
ChartTitle represents a chart title.
func (*ChartTitle) SetText ¶
func (ct *ChartTitle) SetText(text string) *ChartTitle
SetText sets the title text.
func (*ChartTitle) SetVisible ¶
func (ct *ChartTitle) SetVisible(v bool) *ChartTitle
SetVisible sets the title visibility.
type ChartType ¶
type ChartType interface {
GetChartTypeName() string
}
ChartType is the interface for chart types.
type Color ¶
type Color struct {
ARGB string // 8-character hex string, e.g., "FF000000" for black
}
Color represents an ARGB color.
func NewColor ¶
NewColor creates a new Color from an ARGB hex string. Accepts 6-char RGB (e.g. "FF0000") or 8-char ARGB (e.g. "FFFF0000"). A leading "#" is stripped automatically.
type Comment ¶
type Comment struct {
Author *CommentAuthor
Text string
Date time.Time
PositionX int // in 1/100th of a point
PositionY int
}
Comment represents a slide comment.
func (*Comment) SetAuthor ¶
func (c *Comment) SetAuthor(a *CommentAuthor) *Comment
SetAuthor sets the comment author.
func (*Comment) SetPosition ¶
SetPosition sets the comment position.
type CommentAuthor ¶
CommentAuthor represents a comment author.
func NewCommentAuthor ¶
func NewCommentAuthor(name, initials string) *CommentAuthor
NewCommentAuthor creates a new comment author.
type CustomGeomPath ¶
type CustomGeomPath struct {
Width int64 // path coordinate space width
Height int64 // path coordinate space height
Commands []PathCommand // path commands (moveTo, lineTo, close, etc.)
}
CustomGeomPath represents a custom geometry path for freeform shapes.
type CustomProperty ¶
type CustomProperty struct {
Name string
Value interface{}
Type PropertyType
}
CustomProperty represents a custom document property.
type DocumentLayout ¶
type DocumentLayout struct {
CX int64 // width in EMU (English Metric Units)
CY int64 // height in EMU
Name string
}
DocumentLayout represents the slide dimensions.
func NewDocumentLayout ¶
func NewDocumentLayout() *DocumentLayout
NewDocumentLayout creates a default 4:3 layout.
func (*DocumentLayout) SetCustomLayout ¶
func (dl *DocumentLayout) SetCustomLayout(cx, cy int64)
SetCustomLayout sets custom dimensions in EMU. Both values must be positive.
func (*DocumentLayout) SetLayout ¶
func (dl *DocumentLayout) SetLayout(name string)
SetLayout sets a predefined layout.
type DocumentProperties ¶
type DocumentProperties struct {
Creator string
LastModifiedBy string
Created time.Time
Modified time.Time
Title string
Description string
Subject string
Keywords string
Category string
Company string
Status string
Revision string
// contains filtered or unexported fields
}
DocumentProperties holds standard and custom document properties.
func NewDocumentProperties ¶
func NewDocumentProperties() *DocumentProperties
NewDocumentProperties creates new document properties with defaults.
func (*DocumentProperties) GetCustomProperties ¶
func (dp *DocumentProperties) GetCustomProperties() []string
GetCustomProperties returns all custom property names.
func (*DocumentProperties) GetCustomPropertyType ¶
func (dp *DocumentProperties) GetCustomPropertyType(name string) PropertyType
GetCustomPropertyType returns the type of a custom property.
func (*DocumentProperties) GetCustomPropertyValue ¶
func (dp *DocumentProperties) GetCustomPropertyValue(name string) interface{}
GetCustomPropertyValue returns the value of a custom property.
func (*DocumentProperties) IsCustomPropertySet ¶
func (dp *DocumentProperties) IsCustomPropertySet(name string) bool
IsCustomPropertySet checks if a custom property exists.
func (*DocumentProperties) SetCustomProperty ¶
func (dp *DocumentProperties) SetCustomProperty(name string, value interface{}, propType PropertyType)
SetCustomProperty sets a custom property.
type DoughnutChart ¶
type DoughnutChart struct {
Series []*ChartSeries
HoleSize int // percentage 10-90
}
DoughnutChart represents a doughnut chart.
func NewDoughnutChart ¶
func NewDoughnutChart() *DoughnutChart
NewDoughnutChart creates a new doughnut chart.
func (*DoughnutChart) AddSeries ¶
func (d *DoughnutChart) AddSeries(s *ChartSeries) *DoughnutChart
AddSeries adds a data series.
func (*DoughnutChart) GetChartTypeName ¶
func (d *DoughnutChart) GetChartTypeName() string
type DrawingShape ¶
type DrawingShape struct {
BaseShape
// contains filtered or unexported fields
}
DrawingShape represents an image/drawing shape.
func NewDrawingShape ¶
func NewDrawingShape() *DrawingShape
NewDrawingShape creates a new drawing shape.
func (*DrawingShape) GetAlphaValue ¶
func (d *DrawingShape) GetAlphaValue() int
GetAlphaValue returns the alphaModFix amount (0-100000).
func (*DrawingShape) GetCropBottom ¶
func (d *DrawingShape) GetCropBottom() int
GetCropBottom returns the bottom crop percentage (in 1/1000 of a percent).
func (*DrawingShape) GetCropLeft ¶
func (d *DrawingShape) GetCropLeft() int
GetCropLeft returns the left crop percentage (in 1/1000 of a percent).
func (*DrawingShape) GetCropRight ¶
func (d *DrawingShape) GetCropRight() int
GetCropRight returns the right crop percentage (in 1/1000 of a percent).
func (*DrawingShape) GetCropTop ¶
func (d *DrawingShape) GetCropTop() int
GetCropTop returns the top crop percentage (in 1/1000 of a percent).
func (*DrawingShape) GetImageData ¶
func (d *DrawingShape) GetImageData() []byte
GetImageData returns the raw image data.
func (*DrawingShape) GetMimeType ¶
func (d *DrawingShape) GetMimeType() string
GetMimeType returns the image MIME type.
func (*DrawingShape) GetPath ¶
func (d *DrawingShape) GetPath() string
GetPath returns the image file path.
func (*DrawingShape) GetType ¶
func (d *DrawingShape) GetType() ShapeType
func (*DrawingShape) SetHeight ¶
func (d *DrawingShape) SetHeight(h int64) *DrawingShape
SetHeight sets the height and returns for chaining.
func (*DrawingShape) SetImageData ¶
func (d *DrawingShape) SetImageData(data []byte, mimeType string) *DrawingShape
SetImageData sets the raw image data.
func (*DrawingShape) SetImageFromFile ¶
func (d *DrawingShape) SetImageFromFile(path string) error
SetImageFromFile loads an image from a file path and sets the data and MIME type. Returns an error if the file exceeds maxImageFileSize or cannot be read.
func (*DrawingShape) SetOffsetX ¶
func (d *DrawingShape) SetOffsetX(x int64) *DrawingShape
SetOffsetX sets the X offset and returns for chaining.
func (*DrawingShape) SetOffsetY ¶
func (d *DrawingShape) SetOffsetY(y int64) *DrawingShape
SetOffsetY sets the Y offset and returns for chaining.
func (*DrawingShape) SetPath ¶
func (d *DrawingShape) SetPath(path string) *DrawingShape
SetPath sets the image file path.
func (*DrawingShape) SetWidth ¶
func (d *DrawingShape) SetWidth(w int64) *DrawingShape
SetWidth sets the width and returns for chaining.
type Fill ¶
type Fill struct {
Type FillType
Color Color
EndColor Color // for gradient fills
Rotation int // gradient rotation in degrees
}
Fill represents a shape fill.
func (*Fill) SetGradientLinear ¶
SetGradientLinear sets a linear gradient fill. Rotation is normalized to 0–359.
type Font ¶
type Font struct {
Name string
NameEA string // East Asian font name (from <a:ea> element)
Size int // in points
Bold bool
Italic bool
Underline UnderlineType
Strikethrough bool
Color Color
Superscript bool
Subscript bool
}
Font represents text font properties.
func (*Font) SetStrikethrough ¶
SetStrikethrough sets the strikethrough property.
func (*Font) SetUnderline ¶
func (f *Font) SetUnderline(u UnderlineType) *Font
SetUnderline sets the underline type.
type FontCache ¶
type FontCache struct {
// contains filtered or unexported fields
}
FontCache manages TrueType font loading and face caching. It searches system font directories and user-specified directories for .ttf and .otf files, then caches parsed fonts and rendered faces.
func NewFontCache ¶
NewFontCache creates a FontCache that searches the given directories plus the OS default font directories.
func (*FontCache) GetFace ¶
GetFace returns a font.Face for the given font properties. It tries to find a matching TrueType font; returns nil if not found.
func (*FontCache) GetMeasureFace ¶
GetMeasureFace returns a font.Face with HintingNone for text measurement. PowerPoint's text layout engine uses unhinted (ideal) glyph metrics for line wrapping and text measurement. Using HintingNone produces glyph advances that match PowerPoint's DirectWrite layout, so wrapping occurs at the same character positions.
type GroupShape ¶
type GroupShape struct {
BaseShape
// contains filtered or unexported fields
}
GroupShape represents a group of shapes.
func (*GroupShape) AddShape ¶
func (g *GroupShape) AddShape(s Shape) *GroupShape
AddShape adds a shape to the group.
func (*GroupShape) GetGroupFill ¶
func (g *GroupShape) GetGroupFill() *Fill
GetGroupFill returns the group-level fill (from grpSpPr), if any.
func (*GroupShape) GetShapeCount ¶
func (g *GroupShape) GetShapeCount() int
GetShapeCount returns the number of shapes in the group.
func (*GroupShape) GetShapes ¶
func (g *GroupShape) GetShapes() []Shape
GetShapes returns all shapes in the group.
func (*GroupShape) GetType ¶
func (g *GroupShape) GetType() ShapeType
func (*GroupShape) RemoveShape ¶
func (g *GroupShape) RemoveShape(index int) error
RemoveShape removes a shape by index.
type HorizontalAlignment ¶
type HorizontalAlignment string
HorizontalAlignment represents horizontal text alignment.
const ( HorizontalLeft HorizontalAlignment = "l" HorizontalCenter HorizontalAlignment = "ctr" HorizontalRight HorizontalAlignment = "r" HorizontalJustify HorizontalAlignment = "just" HorizontalDistributed HorizontalAlignment = "dist" )
type Hyperlink ¶
Hyperlink represents a hyperlink.
func NewHyperlink ¶
NewHyperlink creates a new external hyperlink. The URL must use an allowed scheme (http, https, mailto, ftp, ftps). Returns nil if the URL scheme is not allowed.
func NewInternalHyperlink ¶
NewInternalHyperlink creates a hyperlink to another slide.
type ImageFormat ¶
type ImageFormat int
ImageFormat represents the output image format.
const ( ImageFormatPNG ImageFormat = iota ImageFormatJPEG )
type LegendPosition ¶
type LegendPosition string
LegendPosition represents the legend position.
const ( LegendBottom LegendPosition = "b" LegendTop LegendPosition = "t" LegendLeft LegendPosition = "l" LegendRight LegendPosition = "r" LegendTopRight LegendPosition = "tr" )
type LineChart ¶
type LineChart struct {
Series []*ChartSeries
IsSmooth bool
}
LineChart represents a line chart.
func (*LineChart) AddSeries ¶
func (l *LineChart) AddSeries(s *ChartSeries) *LineChart
AddSeries adds a data series.
func (*LineChart) GetChartTypeName ¶
type LineShape ¶
type LineShape struct {
BaseShape
// contains filtered or unexported fields
}
LineShape represents a line shape.
func (*LineShape) GetAdjustValues ¶
GetAdjustValues returns the adjustment values for connector geometry.
func (*LineShape) GetConnectorType ¶
GetConnectorType returns the connector type (prstGeom value).
func (*LineShape) GetHeadEnd ¶
GetHeadEnd returns the head end.
func (*LineShape) GetLineColor ¶
GetLineColor returns the line color.
func (*LineShape) GetLineStyle ¶
func (l *LineShape) GetLineStyle() BorderStyle
GetLineStyle returns the line style.
func (*LineShape) GetLineWidth ¶
GetLineWidth returns the line width.
func (*LineShape) GetLineWidthEMU ¶
GetLineWidthEMU returns the line width in EMU for precise rendering. If the raw EMU value was not set, it falls back to lineWidth * 12700.
func (*LineShape) GetTailEnd ¶
GetTailEnd returns the tail end.
func (*LineShape) SetHeadEnd ¶
SetHeadEnd sets the head end (arrow at start of line).
func (*LineShape) SetLineColor ¶
SetLineColor sets the line color.
func (*LineShape) SetLineStyle ¶
func (l *LineShape) SetLineStyle(s BorderStyle) *LineShape
SetLineStyle sets the line style.
func (*LineShape) SetLineWidth ¶
SetLineWidth sets the line width.
func (*LineShape) SetTailEnd ¶
SetTailEnd sets the tail end (arrow at end of line).
type PPTXReader ¶
type PPTXReader struct{}
PPTXReader reads PPTX files.
func (*PPTXReader) Read ¶
func (r *PPTXReader) Read(path string) (*Presentation, error)
Read reads a presentation from a file path.
func (*PPTXReader) ReadFromReader ¶
func (r *PPTXReader) ReadFromReader(reader io.ReaderAt, size int64) (*Presentation, error)
ReadFromReader reads a presentation from an io.ReaderAt.
type PPTXWriter ¶
type PPTXWriter struct {
// contains filtered or unexported fields
}
PPTXWriter writes presentations in PPTX format.
func (*PPTXWriter) Save ¶
func (w *PPTXWriter) Save(path string) error
Save writes the presentation to a file.
type Paragraph ¶
type Paragraph struct {
// contains filtered or unexported fields
}
Paragraph represents a text paragraph.
func (*Paragraph) CreateBreak ¶
func (p *Paragraph) CreateBreak() *BreakElement
CreateBreak creates a line break element.
func (*Paragraph) CreateTextRun ¶
CreateTextRun creates a new text run.
func (*Paragraph) GetAlignment ¶
GetAlignment returns the paragraph alignment.
func (*Paragraph) GetElements ¶
func (p *Paragraph) GetElements() []ParagraphElement
GetElements returns all paragraph elements.
func (*Paragraph) GetLineSpacing ¶
GetLineSpacing returns the line spacing.
func (*Paragraph) GetSpaceAfter ¶
GetSpaceAfter returns the space after the paragraph.
func (*Paragraph) GetSpaceBefore ¶
GetSpaceBefore returns the space before the paragraph.
func (*Paragraph) SetAlignment ¶
SetAlignment sets the paragraph alignment.
func (*Paragraph) SetLineSpacing ¶
SetLineSpacing sets the line spacing.
func (*Paragraph) SetSpaceAfter ¶
SetSpaceAfter sets the space after the paragraph.
func (*Paragraph) SetSpaceBefore ¶
SetSpaceBefore sets the space before the paragraph.
type ParagraphElement ¶
type ParagraphElement interface {
GetElementType() string
}
ParagraphElement is the interface for paragraph content.
type PathCommand ¶
type PathCommand struct {
Type string // "moveTo", "lnTo", "close", "cubicBezTo", "quadBezTo", "arcTo"
Pts []PathPoint
// Arc parameters (only for arcTo): radii and angles in OOXML 60000ths of a degree
WR, HR int64 // ellipse radii in path coordinate units
StAng, SwAng int64 // start angle and sweep angle (60000ths of a degree)
}
PathCommand represents a single path command.
type PathPoint ¶
type PathPoint struct {
X, Y int64
}
PathPoint represents a point in path coordinates.
type Pie3DChart ¶
type Pie3DChart struct {
PieChart
}
Pie3DChart represents a 3D pie chart.
func (*Pie3DChart) GetChartTypeName ¶
func (p *Pie3DChart) GetChartTypeName() string
type PieChart ¶
type PieChart struct {
Series []*ChartSeries
}
PieChart represents a pie chart.
func (*PieChart) AddSeries ¶
func (p *PieChart) AddSeries(s *ChartSeries) *PieChart
AddSeries adds a data series.
func (*PieChart) GetChartTypeName ¶
type PlaceholderShape ¶
type PlaceholderShape struct {
RichTextShape
// contains filtered or unexported fields
}
PlaceholderShape represents a placeholder shape (title, body, etc.).
func NewPlaceholderShape ¶
func NewPlaceholderShape(phType PlaceholderType) *PlaceholderShape
NewPlaceholderShape creates a new placeholder shape.
func (*PlaceholderShape) Clear ¶
func (p *PlaceholderShape) Clear()
Clear clears the placeholder content and adds a single empty paragraph. An empty paragraph is required by PowerPoint for the file to be valid.
func (*PlaceholderShape) ClearAll ¶
func (p *PlaceholderShape) ClearAll()
ClearAll completely removes all paragraphs from the placeholder. You must add at least one paragraph via CreateParagraph before saving.
func (*PlaceholderShape) GetPlaceholderIndex ¶
func (p *PlaceholderShape) GetPlaceholderIndex() int
GetPlaceholderIndex returns the placeholder index.
func (*PlaceholderShape) GetPlaceholderType ¶
func (p *PlaceholderShape) GetPlaceholderType() PlaceholderType
GetPlaceholderType returns the placeholder type.
func (*PlaceholderShape) GetType ¶
func (p *PlaceholderShape) GetType() ShapeType
func (*PlaceholderShape) Remove ¶
func (p *PlaceholderShape) Remove(slide *Slide) bool
Remove removes this placeholder from the given slide. Returns true if the placeholder was found and removed.
func (*PlaceholderShape) SetPlaceholderIndex ¶
func (p *PlaceholderShape) SetPlaceholderIndex(idx int)
SetPlaceholderIndex sets the placeholder index.
func (*PlaceholderShape) SetText ¶
func (p *PlaceholderShape) SetText(text string)
SetText sets the placeholder text, replacing all existing content with a single paragraph.
type PlaceholderType ¶
type PlaceholderType string
PlaceholderType represents the type of placeholder.
const ( PlaceholderTitle PlaceholderType = "title" PlaceholderBody PlaceholderType = "body" PlaceholderCtrTitle PlaceholderType = "ctrTitle" PlaceholderSubTitle PlaceholderType = "subTitle" PlaceholderDate PlaceholderType = "dt" PlaceholderSlideNum PlaceholderType = "sldNum" )
type PlotArea ¶
type PlotArea struct {
// contains filtered or unexported fields
}
PlotArea represents the chart plot area.
type Presentation ¶
type Presentation struct {
// contains filtered or unexported fields
}
Presentation represents an in-memory PowerPoint presentation.
func Open ¶
func Open(path string) (*Presentation, error)
Open reads a PPTX file from disk and returns a Presentation. This is a convenience wrapper around NewReader + Read.
func OpenTemplate ¶
func OpenTemplate(path string) (*Presentation, error)
OpenTemplate opens a PPTX template file and returns a Presentation. Unlike Open, this removes all existing slides so you can add new ones using the template's layouts. The slide layouts and masters are preserved.
func ReadFrom ¶
func ReadFrom(r io.ReaderAt, size int64) (*Presentation, error)
ReadFrom reads a PPTX from an io.ReaderAt with the given size.
func (*Presentation) AddDefaultSlideWithLayout ¶
func (p *Presentation) AddDefaultSlideWithLayout(layoutName string) (*Slide, error)
AddDefaultSlideWithLayout creates a new slide with the given layout, similar to what PowerPoint does when inserting a slide with a layout. The slide starts empty with no placeholder content. This matches unioffice's AddDefaultSlideWithLayout behavior.
func (*Presentation) AddSlide ¶
func (p *Presentation) AddSlide(slide *Slide) *Slide
AddSlide adds an existing slide to the presentation.
func (*Presentation) AddSlideWithLayout ¶
func (p *Presentation) AddSlideWithLayout(layoutName string) (*Slide, error)
AddSlideWithLayout creates a new slide associated with the given layout name. The layout name is stored for reference but the slide starts empty.
func (*Presentation) Close ¶
func (p *Presentation) Close() error
Close releases resources held by the presentation. It clears internal references to allow garbage collection.
func (*Presentation) CopySlide ¶
func (p *Presentation) CopySlide(index int) (*Slide, error)
CopySlide creates a deep copy of the slide at the given index and appends it. Note: shapes are shallow-copied (reference types). Modify the returned slide's shapes independently by replacing them rather than mutating in place.
func (*Presentation) CreateSlide ¶
func (p *Presentation) CreateSlide() *Slide
CreateSlide creates a new slide and adds it to the presentation.
func (*Presentation) CreateSlideMaster ¶
func (p *Presentation) CreateSlideMaster() *SlideMaster
CreateSlideMaster creates a new slide master and adds it.
func (*Presentation) ExtractText ¶
func (p *Presentation) ExtractText() string
ExtractText returns all text content from the presentation as a single string. Useful for search/indexing.
func (*Presentation) GetActiveSlide ¶
func (p *Presentation) GetActiveSlide() *Slide
GetActiveSlide returns the currently active slide.
func (*Presentation) GetActiveSlideIndex ¶
func (p *Presentation) GetActiveSlideIndex() int
GetActiveSlideIndex returns the active slide index.
func (*Presentation) GetAllSlides ¶
func (p *Presentation) GetAllSlides() []*Slide
GetAllSlides returns all slides.
func (*Presentation) GetDocumentProperties ¶
func (p *Presentation) GetDocumentProperties() *DocumentProperties
GetDocumentProperties returns the document properties.
func (*Presentation) GetLayout ¶
func (p *Presentation) GetLayout() *DocumentLayout
GetLayout returns the document layout.
func (*Presentation) GetLayoutByName ¶
func (p *Presentation) GetLayoutByName(name string) (*SlideLayout, error)
GetLayoutByName returns a SlideLayout by name from the first slide master. Returns an error if no layout with the given name is found.
func (*Presentation) GetPresentationProperties ¶
func (p *Presentation) GetPresentationProperties() *PresentationProperties
GetPresentationProperties returns the presentation properties.
func (*Presentation) GetSlide ¶
func (p *Presentation) GetSlide(index int) (*Slide, error)
GetSlide returns a slide by index.
func (*Presentation) GetSlideCount ¶
func (p *Presentation) GetSlideCount() int
GetSlideCount returns the number of slides.
func (*Presentation) GetSlideLayouts ¶
func (p *Presentation) GetSlideLayouts() []*SlideLayout
GetSlideLayouts returns all slide layouts from all slide masters.
func (*Presentation) GetSlideMasters ¶
func (p *Presentation) GetSlideMasters() []*SlideMaster
GetSlideMasters returns all slide masters.
func (*Presentation) MoveSlide ¶
func (p *Presentation) MoveSlide(fromIndex, toIndex int) error
MoveSlide moves a slide from one index to another.
func (*Presentation) RemoveSlideByIndex ¶
func (p *Presentation) RemoveSlideByIndex(index int) error
RemoveSlideByIndex removes a slide by index. Returns an error if the index is out of range or if it would remove the last slide.
func (*Presentation) Save ¶
func (p *Presentation) Save(path string) error
Save writes the presentation to a PPTX file. This is a convenience wrapper around NewWriter + Save.
func (*Presentation) SaveAsTemplate ¶
func (p *Presentation) SaveAsTemplate(path string) error
SaveAsTemplate writes the presentation as a .potx template to a writer. The only difference from Save is the content type used.
func (*Presentation) SaveSlideAsImage ¶
func (p *Presentation) SaveSlideAsImage(slideIndex int, path string, opts *RenderOptions) error
SaveSlideAsImage renders a slide and saves it to a file.
func (*Presentation) SaveSlidesAsImages ¶
func (p *Presentation) SaveSlidesAsImages(pattern string, opts *RenderOptions) error
SaveSlidesAsImages renders all slides and saves them to files. The pattern should contain %d for the slide number (1-based), e.g. "slide_%d.png".
func (*Presentation) SaveToFile ¶
func (p *Presentation) SaveToFile(path string) error
SaveToFile is an alias for Save for compatibility with unioffice naming.
func (*Presentation) SaveToFileAsTemplate ¶
func (p *Presentation) SaveToFileAsTemplate(path string) error
SaveToFileAsTemplate is an alias for SaveAsTemplate.
func (*Presentation) SetActiveSlideIndex ¶
func (p *Presentation) SetActiveSlideIndex(index int) error
SetActiveSlideIndex sets the active slide by index.
func (*Presentation) SetDocumentProperties ¶
func (p *Presentation) SetDocumentProperties(props *DocumentProperties)
SetDocumentProperties sets the document properties.
func (*Presentation) SetLayout ¶
func (p *Presentation) SetLayout(layout *DocumentLayout)
SetLayout sets the document layout.
func (*Presentation) SlideToImage ¶
func (p *Presentation) SlideToImage(slideIndex int, opts *RenderOptions) (image.Image, error)
SlideToImage renders a single slide to an image.
func (*Presentation) Slides ¶
func (p *Presentation) Slides() []*Slide
Slides returns all slides. This is an alias for GetAllSlides matching unioffice naming convention.
func (*Presentation) SlidesToImages ¶
func (p *Presentation) SlidesToImages(opts *RenderOptions) ([]image.Image, error)
SlidesToImages renders all slides to images.
func (*Presentation) Validate ¶
func (p *Presentation) Validate() error
Validate checks the presentation for structural issues and returns an error describing all problems found, or nil if the presentation is valid. This is analogous to unioffice's Validate() method.
type PresentationProperties ¶
type PresentationProperties struct {
// contains filtered or unexported fields
}
PresentationProperties holds presentation-level properties.
func NewPresentationProperties ¶
func NewPresentationProperties() *PresentationProperties
NewPresentationProperties creates new presentation properties with defaults.
func (*PresentationProperties) GetLastView ¶
func (pp *PresentationProperties) GetLastView() ViewType
GetLastView returns the last view type.
func (*PresentationProperties) GetSlideshowType ¶
func (pp *PresentationProperties) GetSlideshowType() SlideshowType
GetSlideshowType returns the slideshow type.
func (*PresentationProperties) GetThumbnailData ¶
func (pp *PresentationProperties) GetThumbnailData() []byte
GetThumbnailData returns the thumbnail data.
func (*PresentationProperties) GetThumbnailPath ¶
func (pp *PresentationProperties) GetThumbnailPath() string
GetThumbnailPath returns the thumbnail path.
func (*PresentationProperties) GetZoom ¶
func (pp *PresentationProperties) GetZoom() float64
GetZoom returns the zoom level.
func (*PresentationProperties) IsCommentVisible ¶
func (pp *PresentationProperties) IsCommentVisible() bool
IsCommentVisible returns whether comments are visible.
func (*PresentationProperties) IsMarkedAsFinal ¶
func (pp *PresentationProperties) IsMarkedAsFinal() bool
IsMarkedAsFinal returns whether the presentation is marked as final.
func (*PresentationProperties) MarkAsFinal ¶
func (pp *PresentationProperties) MarkAsFinal(final ...bool)
MarkAsFinal marks the presentation as final.
func (*PresentationProperties) SetCommentVisible ¶
func (pp *PresentationProperties) SetCommentVisible(visible bool)
SetCommentVisible sets comment visibility.
func (*PresentationProperties) SetLastView ¶
func (pp *PresentationProperties) SetLastView(view ViewType)
SetLastView sets the last view type.
func (*PresentationProperties) SetSlideshowType ¶
func (pp *PresentationProperties) SetSlideshowType(t SlideshowType)
SetSlideshowType sets the slideshow type.
func (*PresentationProperties) SetThumbnailData ¶
func (pp *PresentationProperties) SetThumbnailData(data []byte)
SetThumbnailData sets the thumbnail from raw data.
func (*PresentationProperties) SetThumbnailPath ¶
func (pp *PresentationProperties) SetThumbnailPath(path string)
SetThumbnailPath sets the thumbnail from a file path.
func (*PresentationProperties) SetZoom ¶
func (pp *PresentationProperties) SetZoom(zoom float64)
SetZoom sets the zoom level (clamped to 0.1–4.0).
type PropertyType ¶
type PropertyType int
PropertyType represents the type of a custom property.
const ( PropertyTypeString PropertyType = iota PropertyTypeBoolean PropertyTypeInteger PropertyTypeFloat PropertyTypeDate PropertyTypeUnknown )
type RadarChart ¶
type RadarChart struct {
Series []*ChartSeries
}
RadarChart represents a radar chart.
func (*RadarChart) AddSeries ¶
func (r *RadarChart) AddSeries(s *ChartSeries) *RadarChart
AddSeries adds a data series.
func (*RadarChart) GetChartTypeName ¶
func (r *RadarChart) GetChartTypeName() string
type Reader ¶
type Reader interface {
Read(path string) (*Presentation, error)
ReadFromReader(r io.ReaderAt, size int64) (*Presentation, error)
}
Reader is the interface for presentation readers.
func NewReader ¶
func NewReader(format ReaderType) (Reader, error)
NewReader creates a reader for the given format.
type ReaderType ¶
type ReaderType string
ReaderType represents the input format.
const (
ReaderPowerPoint2007 ReaderType = "PowerPoint2007"
)
type RenderOptions ¶
type RenderOptions struct {
// Width is the output image width in pixels. Height is calculated from slide aspect ratio.
// Default: 960
Width int
// Format is the output image format (PNG or JPEG).
Format ImageFormat
// JPEGQuality is the JPEG quality (1-100). Default: 90.
JPEGQuality int
// BackgroundColor overrides the slide background. Nil means use slide background or white.
BackgroundColor *color.RGBA
// DPI is the rendering DPI for font sizing. Default: 96.
DPI float64
// FontDirs specifies additional directories to search for TrueType/OpenType fonts.
// System font directories are always searched automatically.
FontDirs []string
// FontCache allows sharing a pre-configured FontCache across multiple renders.
// If nil, a new FontCache is created using FontDirs.
FontCache *FontCache
// OverlayOpacityScale scales the opacity of semi-transparent shape fills.
// Value between 0.0 and 1.0. Default 0 means use 1.0 (no change).
// Set to e.g. 0.5 to halve the opacity of overlays, making dark backgrounds brighter.
OverlayOpacityScale float64
}
RenderOptions configures slide-to-image rendering.
func DefaultRenderOptions ¶
func DefaultRenderOptions() *RenderOptions
DefaultRenderOptions returns default rendering options.
type RichTextShape ¶
type RichTextShape struct {
BaseShape
// contains filtered or unexported fields
}
RichTextShape represents a rich text shape.
func NewRichTextShape ¶
func NewRichTextShape() *RichTextShape
NewRichTextShape creates a new rich text shape.
func (*RichTextShape) CreateBreak ¶
func (r *RichTextShape) CreateBreak() *BreakElement
CreateBreak creates a line break in the active paragraph.
func (*RichTextShape) CreateParagraph ¶
func (r *RichTextShape) CreateParagraph() *Paragraph
CreateParagraph creates a new paragraph and makes it active.
func (*RichTextShape) CreateTextRun ¶
func (r *RichTextShape) CreateTextRun(text string) *TextRun
CreateTextRun creates a text run in the active paragraph.
func (*RichTextShape) GetActiveParagraph ¶
func (r *RichTextShape) GetActiveParagraph() *Paragraph
GetActiveParagraph returns the active paragraph.
func (*RichTextShape) GetAutoFit ¶
func (r *RichTextShape) GetAutoFit() AutoFitType
GetAutoFit returns the auto-fit type.
func (*RichTextShape) GetColumns ¶
func (r *RichTextShape) GetColumns() int
GetColumns returns the number of text columns.
func (*RichTextShape) GetCustomPath ¶
func (r *RichTextShape) GetCustomPath() *CustomGeomPath
GetCustomPath returns the custom geometry path, if any.
func (*RichTextShape) GetParagraphs ¶
func (r *RichTextShape) GetParagraphs() []*Paragraph
GetParagraphs returns all paragraphs.
func (*RichTextShape) GetTextAnchor ¶
func (r *RichTextShape) GetTextAnchor() TextAnchorType
GetTextAnchor returns the text anchoring type.
func (*RichTextShape) GetType ¶
func (r *RichTextShape) GetType() ShapeType
func (*RichTextShape) GetWordWrap ¶
func (r *RichTextShape) GetWordWrap() bool
GetWordWrap returns word wrap setting.
func (*RichTextShape) SetAutoFit ¶
func (r *RichTextShape) SetAutoFit(fit AutoFitType)
SetAutoFit sets the auto-fit type.
func (*RichTextShape) SetColumns ¶
func (r *RichTextShape) SetColumns(cols int)
SetColumns sets the number of text columns.
func (*RichTextShape) SetHeight ¶
func (r *RichTextShape) SetHeight(h int64) *RichTextShape
SetHeight sets the height and returns the shape for chaining.
func (*RichTextShape) SetOffsetX ¶
func (r *RichTextShape) SetOffsetX(x int64) *RichTextShape
SetOffsetX sets the X offset and returns the shape for chaining.
func (*RichTextShape) SetOffsetY ¶
func (r *RichTextShape) SetOffsetY(y int64) *RichTextShape
SetOffsetY sets the Y offset and returns the shape for chaining.
func (*RichTextShape) SetTextAnchor ¶
func (r *RichTextShape) SetTextAnchor(anchor TextAnchorType)
SetTextAnchor sets the text anchoring type (vertical position of text within the shape).
func (*RichTextShape) SetWidth ¶
func (r *RichTextShape) SetWidth(w int64) *RichTextShape
SetWidth sets the width and returns the shape for chaining.
func (*RichTextShape) SetWordWrap ¶
func (r *RichTextShape) SetWordWrap(wrap bool)
SetWordWrap sets word wrap.
type ScatterChart ¶
type ScatterChart struct {
Series []*ChartSeries
IsSmooth bool
}
ScatterChart represents a scatter chart.
func NewScatterChart ¶
func NewScatterChart() *ScatterChart
NewScatterChart creates a new scatter chart.
func (*ScatterChart) AddSeries ¶
func (s *ScatterChart) AddSeries(series *ChartSeries) *ScatterChart
AddSeries adds a data series.
func (*ScatterChart) GetChartTypeName ¶
func (s *ScatterChart) GetChartTypeName() string
func (*ScatterChart) SetSmooth ¶
func (s *ScatterChart) SetSmooth(v bool) *ScatterChart
SetSmooth sets whether the line is smooth.
type SeriesMarker ¶
SeriesMarker represents a series marker.
type SeriesOutline ¶
SeriesOutline represents a series outline.
type Shadow ¶
type Shadow struct {
Visible bool
Direction int // in degrees
Distance int // in points
BlurRadius int
Color Color
Alpha int // 0-100
}
Shadow represents a shape shadow.
func (*Shadow) SetDirection ¶
SetDirection sets shadow direction in degrees (normalized to 0–359).
func (*Shadow) SetDistance ¶
SetDistance sets shadow distance in points (clamped to >= 0).
func (*Shadow) SetVisible ¶
SetVisible sets shadow visibility.
type Shape ¶
type Shape interface {
GetType() ShapeType
GetOffsetX() int64
GetOffsetY() int64
GetWidth() int64
GetHeight() int64
GetName() string
GetRotation() int
// contains filtered or unexported methods
}
Shape is the interface that all shapes implement.
type ShapeType ¶
type ShapeType int
ShapeType represents the type of shape.
const ShapeTypeGroup ShapeType = 10
ShapeTypeGroup is the shape type for groups.
const ShapeTypePlaceholder ShapeType = 11
ShapeTypePlaceholder is the shape type for placeholders.
type Slide ¶
type Slide struct {
// contains filtered or unexported fields
}
Slide represents a single slide in a presentation.
func (*Slide) AddAnimation ¶
AddAnimation adds an animation to the slide.
func (*Slide) AddAutoShape ¶
AddAutoShape creates a new auto shape and adds it to the slide. This matches unioffice's Slide.AddShape pattern.
func (*Slide) AddComment ¶
AddComment adds a comment to the slide.
func (*Slide) AddImage ¶
func (s *Slide) AddImage(path string) (*DrawingShape, error)
AddImage creates a drawing shape from a file path and adds it to the slide. This is a convenience method matching unioffice's Slide.AddImage pattern.
func (*Slide) AddImageData ¶
func (s *Slide) AddImageData(data []byte, mimeType string) *DrawingShape
AddImageData creates a drawing shape from raw image data and adds it to the slide.
func (*Slide) AddTable ¶
func (s *Slide) AddTable(rows, cols int) *TableShape
AddTable creates a new table shape and adds it to the slide. This matches unioffice's Slide.AddTable pattern.
func (*Slide) AddTextBox ¶
func (s *Slide) AddTextBox() *RichTextShape
AddTextBox creates a new rich text shape and adds it to the slide. This is an alias for CreateRichTextShape matching unioffice naming.
func (*Slide) CreateAutoShape ¶
CreateAutoShape creates a new auto shape and adds it to the slide.
func (*Slide) CreateChartShape ¶
func (s *Slide) CreateChartShape() *ChartShape
CreateChartShape creates a new chart shape and adds it to the slide.
func (*Slide) CreateDrawingShape ¶
func (s *Slide) CreateDrawingShape() *DrawingShape
CreateDrawingShape creates a new drawing (image) shape and adds it to the slide.
func (*Slide) CreateGroupShape ¶
func (s *Slide) CreateGroupShape() *GroupShape
CreateGroupShape creates a new group shape and adds it to the slide.
func (*Slide) CreateLineShape ¶
CreateLineShape creates a new line shape and adds it to the slide.
func (*Slide) CreatePlaceholderShape ¶
func (s *Slide) CreatePlaceholderShape(phType PlaceholderType) *PlaceholderShape
CreatePlaceholderShape creates a new placeholder shape and adds it to the slide.
func (*Slide) CreateRichTextShape ¶
func (s *Slide) CreateRichTextShape() *RichTextShape
CreateRichTextShape creates a new rich text shape and adds it to the slide.
func (*Slide) CreateTableShape ¶
func (s *Slide) CreateTableShape(rows, cols int) *TableShape
CreateTableShape creates a new table shape and adds it to the slide.
func (*Slide) ExtractText ¶
ExtractText returns all text content from this slide as a single string.
func (*Slide) GetAnimations ¶
GetAnimations returns all animations on the slide.
func (*Slide) GetBackground ¶
GetBackground returns the slide background fill.
func (*Slide) GetCommentCount ¶
GetCommentCount returns the number of comments.
func (*Slide) GetComments ¶
GetComments returns all comments on the slide.
func (*Slide) GetPlaceholder ¶
func (s *Slide) GetPlaceholder(phType PlaceholderType) *PlaceholderShape
GetPlaceholder returns the first placeholder of the given type. Returns nil if no placeholder of that type exists.
func (*Slide) GetPlaceholderByIndex ¶
func (s *Slide) GetPlaceholderByIndex(idx int) *PlaceholderShape
GetPlaceholderByIndex returns a placeholder by its index. Returns nil if no placeholder with that index exists.
func (*Slide) GetPlaceholders ¶
func (s *Slide) GetPlaceholders() []*PlaceholderShape
GetPlaceholders returns all placeholder shapes on the slide.
func (*Slide) GetShapeCount ¶
GetShapeCount returns the number of shapes on the slide.
func (*Slide) GetTextBoxes ¶
func (s *Slide) GetTextBoxes() []*RichTextShape
GetTextBoxes returns all RichTextShape (text box) shapes on the slide.
func (*Slide) GetTransition ¶
func (s *Slide) GetTransition() *Transition
GetTransition returns the slide transition.
func (*Slide) RemoveShape ¶
RemoveShape removes a shape by index.
func (*Slide) RemoveShapeByPointer ¶
RemoveShapeByPointer removes a specific shape from the slide.
func (*Slide) SetBackground ¶
SetBackground sets the slide background fill.
func (*Slide) SetTransition ¶
func (s *Slide) SetTransition(t *Transition)
SetTransition sets the slide transition.
func (*Slide) SetVisible ¶
SetVisible sets the slide visibility.
type SlideLayout ¶
SlideLayout represents a slide layout.
type SlideMaster ¶
type SlideMaster struct {
Name string
SlideLayouts []*SlideLayout
}
SlideMaster represents a slide master.
type SlideshowType ¶
type SlideshowType int
SlideshowType represents the slideshow type.
const ( SlideshowTypePresent SlideshowType = iota SlideshowTypeBrowse SlideshowTypeKiosk )
type TableCell ¶
type TableCell struct {
// contains filtered or unexported fields
}
TableCell represents a table cell.
func (*TableCell) GetBorders ¶
func (tc *TableCell) GetBorders() *CellBorders
GetBorders returns the cell borders.
func (*TableCell) GetColSpan ¶
GetColSpan returns the column span.
func (*TableCell) GetParagraphs ¶
GetParagraphs returns the cell paragraphs.
func (*TableCell) GetRowSpan ¶
GetRowSpan returns the row span.
func (*TableCell) SetColSpan ¶
SetColSpan sets the column span.
func (*TableCell) SetRowSpan ¶
SetRowSpan sets the row span.
type TableShape ¶
type TableShape struct {
BaseShape
// contains filtered or unexported fields
}
TableShape represents a table shape.
func NewTableShape ¶
func NewTableShape(rows, cols int) *TableShape
NewTableShape creates a new table shape.
func (*TableShape) GetCell ¶
func (t *TableShape) GetCell(row, col int) *TableCell
GetCell returns a cell at the given row and column.
func (*TableShape) GetNumCols ¶
func (t *TableShape) GetNumCols() int
GetNumCols returns the number of columns.
func (*TableShape) GetNumRows ¶
func (t *TableShape) GetNumRows() int
GetNumRows returns the number of rows.
func (*TableShape) GetRows ¶
func (t *TableShape) GetRows() [][]*TableCell
GetRows returns all rows.
func (*TableShape) GetType ¶
func (t *TableShape) GetType() ShapeType
func (*TableShape) SetHeight ¶
func (t *TableShape) SetHeight(h int64) *TableShape
SetHeight sets the height and returns for chaining.
func (*TableShape) SetWidth ¶
func (t *TableShape) SetWidth(w int64) *TableShape
SetWidth sets the width and returns for chaining.
type TextAnchorType ¶
type TextAnchorType string
TextAnchorType represents the text anchoring type within a shape.
const ( TextAnchorTop TextAnchorType = "t" TextAnchorMiddle TextAnchorType = "ctr" TextAnchorBottom TextAnchorType = "b" TextAnchorNone TextAnchorType = "" )
type TextRun ¶
type TextRun struct {
// contains filtered or unexported fields
}
TextRun represents a run of text with formatting.
func (*TextRun) GetElementType ¶
func (*TextRun) GetHyperlink ¶
GetHyperlink returns the hyperlink.
func (*TextRun) SetHyperlink ¶
SetHyperlink sets the hyperlink.
type Transition ¶
type Transition struct {
Type TransitionType
Speed TransitionSpeed
Duration int // in milliseconds
}
Transition represents a slide transition.
type TransitionSpeed ¶
type TransitionSpeed string
TransitionSpeed represents the speed of a transition.
const ( TransitionSpeedSlow TransitionSpeed = "slow" TransitionSpeedMedium TransitionSpeed = "med" TransitionSpeedFast TransitionSpeed = "fast" )
type TransitionType ¶
type TransitionType int
TransitionType represents the type of slide transition.
const ( TransitionNone TransitionType = iota TransitionFade TransitionPush TransitionWipe TransitionSplit TransitionCover TransitionUncover TransitionDissolve )
type UnderlineType ¶
type UnderlineType string
UnderlineType represents the underline style.
const ( UnderlineNone UnderlineType = "none" UnderlineSingle UnderlineType = "sng" UnderlineDouble UnderlineType = "dbl" UnderlineHeavy UnderlineType = "heavy" UnderlineDash UnderlineType = "dash" UnderlineWavy UnderlineType = "wavy" )
type VerticalAlignment ¶
type VerticalAlignment string
VerticalAlignment represents vertical text alignment.
const ( VerticalTop VerticalAlignment = "t" VerticalMiddle VerticalAlignment = "ctr" VerticalBottom VerticalAlignment = "b" )
type View3D ¶
View3D represents 3D view settings.
func (*View3D) SetHeightPercent ¶
SetHeightPercent sets the height percent. Pass nil to enable autoscale.
type Writer ¶
Writer is the interface for presentation writers.
func NewWriter ¶
func NewWriter(p *Presentation, format WriterType) (Writer, error)
NewWriter creates a writer for the given format.
type WriterType ¶
type WriterType string
WriterType represents the output format.
const (
WriterPowerPoint2007 WriterType = "PowerPoint2007"
)
Source Files
¶
- animation.go
- bullet.go
- chart.go
- comment.go
- emf_export.go
- emf_vector.go
- font_cache.go
- group.go
- measurement.go
- open.go
- presentation.go
- properties.go
- reader.go
- reader_parts.go
- reader_slide.go
- renderer.go
- shape.go
- slide.go
- style.go
- validate.go
- version.go
- writer.go
- writer_chart.go
- writer_comment.go
- writer_parts.go
- writer_slide.go
- writer_xml.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
render_all
command
|
|
|
render_slide40
command
|
|
|
render_slide7
command
|
|
|
render_test2
command
|