mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-27 13:48:54 +08:00
42 lines
912 B
Go
42 lines
912 B
Go
// Copyright 2017 Baliance. All rights reserved.
|
|
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"baliance.com/gooxml/color"
|
|
"baliance.com/gooxml/measurement"
|
|
"baliance.com/gooxml/schema/soo/dml"
|
|
|
|
"baliance.com/gooxml/presentation"
|
|
)
|
|
|
|
func main() {
|
|
ppt := presentation.New()
|
|
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)
|
|
|
|
}
|
|
if err := ppt.Validate(); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
ppt.SaveToFile("simple.pptx")
|
|
}
|