# html2docx
**Repository Path**: deepoo/html2docx
## Basic Information
- **Project Name**: html2docx
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-12-11
- **Last Updated**: 2025-12-11
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# html2docx
## pandoc方案
安装 pandoc
```bash
apt install pandoc
```
下载 word 模板
```
https://github.com/Achuan-2/pandoc_word_template
```
html 转 docx
```bash
pandoc --from=html --to=docx --reference-doc=template3.docx -o content.docx content.html
pandoc --from=html --to=docx --reference-doc=template.docx -o cover.docx cover.html
pandoc --from=html --to=docx --reference-doc=template3.docx -o content.docx --toc --toc-depth=4 content.html
pandoc --from=html --to=docx --reference-doc=reference.docx -o content.docx --toc --toc-depth=4 -M toc-title="目录" content.html
pandoc --from=html --to=docx --reference-doc=template/reference.docx -o output/example0.docx html/standard0.html
pandoc --from=html --to=docx --reference-doc=template/template3.docx -o output/example2.docx html/standard0.html
pandoc --from=html --to=docx --reference-doc=output/example1.docx -o output/example11.docx --toc --toc-depth=4 -M toc-title="目录" html/standard0.html
```
```bash
pandoc --from=markdown --to=docx --reference-doc=output/example1.docx -o output/example111.docx --toc --toc-depth=4 -M toc-title="目录" markdown/standard0.md
```
# 制作模板
1. 生成 Pandoc 默认的 reference.docx
```bash
pandoc -o reference.docx --print-default-data-file reference.docx
```
2. 使用wps来调整样式