An open API service indexing awesome lists of open source software.

https://github.com/ainilili/html2docx

html convert to docx.
https://github.com/ainilili/html2docx

converter documentation docx html openxml

Last synced: 7 months ago
JSON representation

html convert to docx.

Awesome Lists containing this project

README

          

# Introduction
Convert [HTML](https://zh.wikipedia.org/wiki/HTML) to [DOCX](https://zh.wikipedia.org/wiki/Office_Open_XML)

# Install
```shell
go get github.com/ainilili/html2docx
```

# Usage
```go
package main

import (
"github.com/ainilili/html2docx"
"log"
"os"
)

func main() {
source := `

我的网页

欢迎来到我的网页


这是一个简单的HTML文档。

`
dist, err := html2docx.Convert([]byte(source))
if err != nil {
log.Fatalln(err)
}
err = os.WriteFile("test.docx", dist, 0666)
if err != nil {
panic(err)
}
}
```