Home > Backend Development > PHP Tutorial > PHP converts html to rtf format_PHP tutorial

PHP converts html to rtf format_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:27:56
Original
1073 people have browsed it

Preliminary preparations: Download Html2Rtf.dll, run cmd as administrator, enter the directory where Html2Rtf.dll is located -> Enter Regsvr32 Html2Rtf.dll

Core code:

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";

 ?>

Possible problems Fatal error: Class 'COM' not found in ×××

Solution:

·Copy php_com_dotnet.dll to the ext folder in the php root directory

·php.ini Make sure to have this statement

 [PHP_COM_DOTNET]

extension=php_com_dotnet.dll

·Ensure that the COM+ Event System service is turned on

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/814675.htmlTechArticlePreparatory work Download Html2Rtf.dll, run cmd as an administrator, and enter the directory where Html2Rtf.dll is located-- 》Enter Regsvr32 Html2Rtf.dll core code: PreserveImages = true; $html...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template