liuyuqi-dellpc 2 years ago
parent
commit
1c4f7711a0
1 changed files with 8 additions and 1 deletions
  1. 8 1
      convert.go

+ 8 - 1
convert.go

@@ -14,8 +14,15 @@ func doCommand(cmd string) {
 		fmt.Println(err.Error())
 		return
 	}
-	fmt.Print("finish.... result is:")
 	fmt.Print(string(stdout))
+	cmdRes2 := exec.Command("libreoffice", "--headless", "--convert-to html", "*.docx", "--outdir", "output")
+	stdout2, err2 := cmdRes2.Output()
+	if err2 != nil {
+		fmt.Println(err2.Error())
+		return
+	}
+	fmt.Print("finish.... result is:")
+	fmt.Print(string(stdout2))
 }
 
 func main() {