PHPackages                             cshaptx4869/html2word - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cshaptx4869/html2word

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cshaptx4869/html2word
=====================

html to word

v0.4.0(4y ago)131.0k3[3 issues](https://github.com/cshaptx4869/html2word/issues)Apache-2.0PHPPHP &gt;=5.6.0

Since Aug 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/cshaptx4869/html2word)[ Packagist](https://packagist.org/packages/cshaptx4869/html2word)[ RSS](/packages/cshaptx4869-html2word/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

HTML转WORD
=========

[](#html转word)

html文件转word格式，欢迎 Star (●'◡'●)

> 推荐转`.doc` 格式 如果为`.docx` 格式，本机测试 Microsoft Office 2019 打开会有问题，WPS没问题

安装
--

[](#安装)

```
composer require cshaptx4869/html2word
```

实例
--

[](#实例)

###### html模板文件

[](#html模板文件)

图片仅支持 PNG, GIF, JPEG, WEBP 格式，且其地址必须是相对于域名根目录或者直接为网络地址

```

    html template

        .testclass {
            font-size: 30px;
            color: #ff0000;
        }

    中文的标题，技术无止境，一直在路上
    p是可以分段的. 使用PHP将html转word
    再分一段 使用PHP将html转word
    还分一段，下面加个图片

    class样式样式是否可以
    测试行内样式
    是否去除链接

```

###### run.php

[](#runphp)

> Html2WordMaker 和 MhtFileMaker 都可以实现。只是原理稍微不同，前者是直接html写入文件，后者是借助mht再写入文件。

```
