RTFtoHTMLconverterVersion1.
2forPHP4and5(including5.
5)requiresionCubeLoader,ZendOptimiser/ZendLoadedorNuSpherePHPExpressConvertingRTFFilestoHTMLUsingRTFtoHTMLconverterRTFtoHTMLConverterisaPHPbasedutilitywhichallowsyoutoconvertRTFdocumentsintoHTMLcode.
ThecodeproducedcanthenbedirectlyoutputtoawebpageorsavedtoaHTMLfile.
TheconvertercanalsoproducesimpleHTMLfromplaintext(PlaintexttoHTMLconverter).
Theconvertersupportsconversionincludingfonts,colours(includingbackgroundcolours),specialcharacters,hyper-linksetc.
TheRTFtoHTMLconvertersystemcomesintwotypesforbothRTFandPlaintext.
Thesearebasicfunctionsandaclassbasedsystem.
1.
Functions1.
1RTFfunctionsTherearetwofunctionsassociatedwiththeconversionofRTF.
1.
1.
1ConvertingastringholdingtheRTFsource:convert_rtf_to_html($rtfdata,$showerrors/*false*/,$showconversiontime/*false*/)Where:$rtfdataisastringcontainingthesourceRTFcode.
$showerrorsisanoptionalBoolean,toindicateifyouwanterrorstobedisplayedattheendoftheconversion.
$showconversiontimeisanoptionalBooleantoaddthetimetakentoconvertthestring,totheendoftheoutput.
Example:require("rtf.
php");$rtf="{";$rtf.
="{}";$rtf.
="{}";$rtf.
="";$rtf.
="";$rtf.
="Iamrichtext}";convert_rtf_to_html($rtf);1.
1.
2LoadingtheRTFfilefromtheharddriverequire("rtf.
php");convert_rtf_file_to_html($file,$showerrors/*false*/,$showconversiontime/*false*/)Where:$fileisastringcontainingthepathandfilenamerelativetothewebserversrootpath.
$showerrorsisanoptionalBoolean,toindicateifyouwanterrorstobedisplayedattheendoftheconversion.
$showconversiontimeisanoptionalBooleantoaddthetimetakentoconvertthestring,totheendoftheoutput.
Example:require("rtf.
php");convert_rtf_file_to_html("documentation/mydocument.
rtf");1.
2PlaintextfunctionsTherearetwofunctionsassociatedwiththeconversionofplaintext.
1.
2.
1Convertingastringholdingtheplaintext:convert_txt_to_html($textdata,$showconvtime/*false*/)Where:$textdataisastringcontainingtheplaintext.
$showconversiontimeisanoptionalBooleantoaddthetimetakentoconvertthestring,totheendoftheoutput.
Example:require("rtf.
php");$text="Iamplaintext";convert_txt_to_html($text);1.
2.
2Loadingthetextfilefromtheharddriveconvert_txt_file_to_html($file,$showconvtime/*false*/)Where:$fileisastringcontainingthepathandfilenamerelativetothewebserversrootpath.
$showconversiontimeisanoptionalBooleantoaddthetimetakentoconvertthestring,totheendoftheoutput.
Example:require("rtf.
php");convert_txt_file_to_html("documentation/mydocument.
txt");2.
Classes2.
1RTFclassTheRTFclasshasabasicsetofmethodstocontrolitsuse.
Thesearelistedbelow2.
1.
1TheclassconstructorRTFConv($rtfdata)Where:$rtfdataisastringcontainingthesourceRTFcode.
2.
1.
2TheoutputtypeSetOutput($type)Where:$typeiseither"dhtml"or"html",where'dhtml'signifiesadynamicoutputi.
e.
theconversionisoutputdirectlyusingprint.
Note:Fontstylesareembeddedintoeachfontelementand'html'(recommended)signifiesthattheoutputisbufferedintoastringthatcanbeoutputusingShowOutputoraccesseddirectly.
2.
1.
3ThedocumentformatUseDocumentFormat($use/*true*/)Where:$useisoptionalandcanbeeithertrueforconvertingthedocumentsettingsorfalseforignoringthem.
ThedocumentsettingsarethewidthandmarginssetusingapplicationssuchasWord.
2.
1.
4Showingerrors(usedinconjunctionwithShowOutput)ShowErrors($show/*true*/)Where:$showisoptionalandcanbeeithertrueforshowinganyerrorswhenusingShowOutput,orfalseforignoringthem.
2.
1.
5SettingtheoutputlevelSetOutputLevel($level)Where:$levelistheamountofformattingrequired:0=noformatting1=basicformattinge.
g.
and2=fullformattingsuchasfontsstylesandtablesDefaultsto2ifnotset.
2.
1.
6ShowthetimetakentoconvertthesourceintheoutputShowConversionTime($showconvtime/*true*/)Where:$showconvtimeisoptionalandcanbeeithertrueforshowingtheconversiontime,orfalseforignoringit.
2.
1.
7ConvertingtheRTFdataConvert()TheConvertmethodwill(dependingontheoutputtype)eitheroutputtoabufferforlateraccessorusebyShowOutput,or,itwilloutputtheconversiondirectlytotheclientusingprint.
2.
1.
7Showingtheoutput(i.
e.
printingittotheclient)ShowOutput($showstyles/*false*/,$file/*""*/)Where:$showstylesisoptionalandcanbeeithertrue(recommended)forshowingthestylesusedforthefonts,orfalseforignoringthem.
$fileisoptionalandcanbethepathandnameofafiletoredirecttheoutputtoe.
g.
"documentation/mynewdocument.
html".
Note:Youcanalsousetheclassvariables:styleswhichholdsthelistoffontstylesneededfortheconvertedRTF.
outwhichholdsthebufferedconversion.
errwhichcontainsanarrayoferrormessagese.
g.
err[0]holdsthefirsterror,err[1]thesecondetc.
.
Example:require("rtf.
php");$r=newRTFConv($rtf);$r->SetOutput("html");$r->ShowConversionTime($showconvtime);$r->ShowErrors(true);$r->Convert();$r->ShowOutput(true);(where$rtfistheRTFdatae.
g.
$rtf=file_get_contents("mydocument.
rtf");2.
2PlaintextclassTheplaintextclasshasabasicsetofmethodstocontrolitsuse.
Thesearelistedbelow2.
2.
1TheclassconstructorPlainTextConv($text)Where:$textisastringcontainingtheplaintexttobeconverted.
2.
2.
2SettingthefonttouseSetFont($font,$fontsize/*12*/)Where:$fontisastandardwebfontsuchas'Arial'tousefortheentireconversion.
$fontsizeisanoptionalsizedefiningthefontsizetousefortheentireconversion.
2.
2.
3ShowthetimetakentoconvertthetextintheoutputShowConversionTime($showconvtime/*true*/)Where:$showconvtimeisoptionalandcanbeeithertrueforshowingtheconversiontime,orfalseforignoringit.
2.
2.
4ConvertingtheplaintextdataConvert()TheConvertmethodwill(dependingontheoutputtype)eitheroutputtoabufferforlateraccessorusebyShowOutput,or,itwilloutputtheconversiondirectlytotheclientusingprint.
2.
2.
5Showingtheoutput(i.
e.
printingittotheclient)ShowOutput($file/*""*/)Where:$fileisoptionalandcanbethepathandnameofafiletoredirecttheoutputtoe.
g.
"documentation/mynewdocument.
html".
Note:Youcanalsousetheclassvariable:outwhichholdsthebufferedconversion.
Example:$r=newPlainTextConv($text);$r->SetFont("Helvetica",10);$r->ShowConversionTime($showconvtime);$r->Convert();$r->ShowOutput();LicenseTHISSOFTWAREISPROVIDEDBYTHEAUTHOR"ASIS"ANDANYEXPRESSORIMPLIEDWARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THEIMPLIEDWARRANTIESOFMERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSEAREDISCLAIMED.
INNOEVENTSHALLTHEAUTHORBELIABLEFORANYDIRECT,INDIRECT,INCIDENTAL,SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENTOFSUBSTITUTEGOODSORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,STRICTLIABILITY,ORTORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAYOUTOFTHEUSEOFTHISSOFTWARE,EVENIFADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGE.
RTFtoHTMLconverterisCopyright2007-2014Pa-software.
Allrightsreserved.
10gbiz发布了9月优惠方案,针对VPS、独立服务器、站群服务器、高防服务器等均提供了一系列优惠方面,其中香港/洛杉矶CN2 GIA线路VPS主机4折优惠继续,优惠后最低每月仅2.36美元起;日本/香港独立服务器提供特价款首月1.5折27.43美元起;站群/G口服务器首月半价,高防服务器永久8.5折等。这是一家成立于2020年的主机商,提供包括独立服务器租用和VPS主机等产品,数据中心包括美国洛...
湖南百纵科技有限公司是一家具有ISP ICP 电信增值许可证的正规公司,多年不断转型探索现已颇具规模,公司成立于2009年 通过多年经营积累目前已独具一格,公司主要经营有国内高防服务器,香港服务器,美国服务器,站群服务器,东南亚服务器租用,国内香港美国云服务器,以及全球专线业务!活动方案:主营:1、美国CN2云服务器,美国VPS,美国高防云主机,美国独立服务器,美国站群服务器,美国母机。2、香港C...
ftlcloud怎么样?ftlcloud(超云)目前正在搞暑假促销,美国圣何塞数据中心的云服务器低至9元/月,系统盘与数据盘分离,支持Windows和Linux,免费防御CC攻击,自带10Gbps的DDoS防御。FTL-超云服务器的主要特色:稳定、安全、弹性、高性能的云端计算服务,快速部署,并且可根据业务需要扩展计算能力,按需付费,节约成本,提高资源的有效利用率。点击进入:ftlcloud官方网站...
file_get_contents为你推荐
人文社科winrarCommitteesios11朝阳分局电子物证实验室建设项目思科routebasedcss支持ipad支持ipad支持ipad支持ipadwin10关闭445端口如何进入注册表修改关闭445端口
vps是什么意思 看国外视频直播vps 科迈动态域名 idc评测 hawkhost优惠码 pw域名 韩国加速器 512av 天猫双十一秒杀 godaddy域名证书 nerds 服务器是干什么的 免费申请个人网站 申请网站 免费ftp smtp服务器地址 西安主机 百度云空间 免费个人网页 godaddy退款 更多