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

feat: add drawing inline marshal

This commit is contained in:
源文雨
2023-02-08 21:25:09 +08:00
parent 362dfefee9
commit ae07360d5e
12 changed files with 627 additions and 77 deletions

View File

@@ -52,10 +52,15 @@ func main() {
if err != nil {
panic(err)
}
for _, para := range doc.Paragraphs() {
for _, child := range para.Children() {
for _, para := range doc.Document.Body.Paragraphs {
for _, child := range para.Children {
if child.Run != nil {
fmt.Printf("\tWe've found a new run with the text ->%s\n", child.Run.Text.Text)
if child.Run.Text != nil {
fmt.Printf("\tWe've found a new run with the text ->%s\n", child.Run.Text.Text)
}
if child.Run.Drawing != nil {
fmt.Printf("\tWe've found a new run with the drawing ->%s\n", child.Run.Drawing.Inline.DistT) // TODO: replace to refid
}
}
if child.Link != nil {
id := child.Link.ID