加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php实例分享之html转为rtf格式

发布时间:2020-12-12 20:12:30 所属栏目:PHP教程 来源:网络整理
导读:核心代码: 代码如下: PreserveImages = true; $html2RTFCom->PageNumbers = 1; $html2RTFCom->PageNumbersAlignH = 1; $html2RTFCom->PageNumbersAlignV = 5; $htmlFile = "a.html"; $rtfFile = "a.rtf"; $result =$html2RTFCom->ConvertFile($htmlFile,$rt

核心代码:

代码如下:
PreserveImages = true;
$html2RTFCom->PageNumbers = 1;
$html2RTFCom->PageNumbersAlignH = 1;
$html2RTFCom->PageNumbersAlignV = 5;
$htmlFile = "a.html";
$rtfFile = "a.rtf";
$result =$html2RTFCom->ConvertFile($htmlFile,$rtfFile,"head","foot");
print($result);
unset($html2RTFCom);
echo "done";
?>

可能遇到的问题 Fatal error: Class 'COM' not found in ×××
解决办法:
·将php_com_dotnet.dll复制到php根目录ext文件夹下
·php.ini 确保有此语句
[PHP_COM_DOTNET]
extension=php_com_dotnet.dll
·确保 COM+ Event System 的服务开启

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读