search

Home  >  Q&A  >  body text

Convert html files to word

composer require cshaptx4869/html2word

<?php

require_once 'vendor/autoload.php';

use Fairy\Html2WordMaker;
use Fairy\MhtFileMaker;

// 1、保存为文件
Html2WordMaker::getInstance()
->addFile('resource/tpl.html')
->eraseLink()
->fetchImg('http://php.test/html2word')
->makeFile('resource/a.doc');

MhtFileMaker::getInstance()
->addFile('resource/tpl.html')
->eraseLink()
->fetchImg('http://php.test/html2word')
->makeFile('resource/a.doc');

// 2、浏览器下载
Html2WordMaker::getInstance()
->addFile('resource/tpl.html')
->fetchImg('http://php.test/html2word')
->download();

MhtFileMaker::getInstance()
->addFile('resource/tpl.html')
->fetchImg('http://php.test/html2word')
->download();


只是没有如果只是没有如果1981 days ago1064

reply all(0)I'll reply

No reply
  • Cancelreply