2017-08-28 20:56:18 -05:00
|
|
|
// Copyright 2017 Baliance. All rights reserved.
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2017-11-18 11:43:37 -06:00
|
|
|
"log"
|
|
|
|
|
|
|
|
"baliance.com/gooxml/color"
|
|
|
|
"baliance.com/gooxml/measurement"
|
|
|
|
"baliance.com/gooxml/schema/soo/dml"
|
|
|
|
|
2017-08-28 20:56:18 -05:00
|
|
|
"baliance.com/gooxml/presentation"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
ppt := presentation.New()
|
2017-11-18 11:43:37 -06:00
|
|
|
for i := 0; i < 5; i++ {
|
|
|
|
slide := ppt.AddSlide()
|
|
|
|
|
|
|
|
tb := slide.AddTextBox()
|
|
|
|
tb.Properties().SetGeometry(dml.ST_ShapeTypeStar10)
|
|
|
|
|
|
|
|
tb.Properties().SetWidth(3 * measurement.Inch)
|
|
|
|
pos := measurement.Distance(i) * measurement.Inch
|
|
|
|
tb.Properties().SetPosition(pos, pos)
|
|
|
|
|
|
|
|
tb.Properties().SetSolidFill(color.AliceBlue)
|
|
|
|
tb.Properties().LineProperties().SetSolidFill(color.Blue)
|
|
|
|
|
|
|
|
p := tb.AddParagraph()
|
|
|
|
p.Properties().SetAlign(dml.ST_TextAlignTypeCtr)
|
|
|
|
|
|
|
|
r := p.AddRun()
|
|
|
|
r.SetText("gooxml")
|
|
|
|
r.Properties().SetSize(24 * measurement.Point)
|
2017-08-28 20:56:18 -05:00
|
|
|
|
2017-11-18 11:43:37 -06:00
|
|
|
}
|
|
|
|
if err := ppt.Validate(); err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
2017-08-28 20:56:18 -05:00
|
|
|
ppt.SaveToFile("simple.pptx")
|
|
|
|
}
|