1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-10 10:23:19 +08:00

fix: unmarshal RunProperties

This commit is contained in:
源文雨
2023-02-10 13:52:11 +08:00
parent 9aae5582ad
commit 9a504d59dc
10 changed files with 233 additions and 158 deletions

View File

@@ -23,10 +23,10 @@ func main() {
// add text
para1.AddText("test")
para1.AddText("test font size").Size(22)
para1.AddText("test font size").Size("44")
para1.AddText("test color").Color("808080")
para2 := w.AddParagraph()
para2.AddText("test font size and color").Size(22).Color("ff0000")
para2.AddText("test font size and color").Size("44").Color("ff0000")
nextPara := w.AddParagraph()
nextPara.AddLink("google", `http://google.com`)
@@ -83,5 +83,17 @@ func main() {
}
fmt.Print("End of paragraph\n\n")
}
f, err = os.Create("tmp.docx")
if err != nil {
panic(err)
}
_, err = doc.WriteTo(f)
if err != nil {
panic(err)
}
err = f.Close()
if err != nil {
panic(err)
}
fmt.Println("End of main")
}