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.
之前分享过很多次CloudCone的信息,主要是VPS主机,其实商家也提供独立服务器租用,同样在洛杉矶MC机房,分为两种线路:普通优化线路及CN2 GIA,今天来分享下商家的CN2 GIA线路独立服务器产品,提供15-100Mbps带宽,不限制流量,可购买额外的DDoS高防IP,最低每月82美元起,支持使用PayPal或者支付宝等付款方式。下面分享几款洛杉矶CN2 GIA线路独立服务器配置信息。配...
#年终感恩活动#华纳云海外物理机688元/月,续费同价,50M CN2 GIA/100M国际大带宽可选,超800G 防御,不限流华纳云成立于2015年,隶属于香港联合通讯国际有限公司。拥有香港政府颁发的商业登记证明,作为APNIC 和 ARIN 会员单位,现有香港、美国等多个地区数据中心资源,百G丰富带宽接入,坚持为海内外用户提供自研顶级硬件防火墙服务,支持T B级超大防护带宽,单IP防护最大可达...
美得云成立于2021年,是一家云产品管理服务商(cloud)专业提供云计算服务、DDOS防护、网络安全服务、国内海外数据中心托管租用等业务、20000+用户的选择,43800+小时稳定运行香港特价将军澳CTG+CN2云服务器、采用高端CPU 优质CN2路线 SDD硬盘。香港CTG+CN22核2G3M20G数据盘25元点击购买香港CTG+CN22核2G5M30G数据盘39元点击购买香港CTG+CN...
file_get_contents为你推荐
Telewizjamedia支持ipadeacceleratoreaccelerator.shm_size设置多少合适呢?win10445端口WIN7怎么打开3306端口iphonewifi苹果手机怎样设置Wi-Fi静态IP?联通版iphone4s苹果4s是联通版,或移动版,或全网通如何知道?win7如何关闭445端口如何关闭445端口,禁用smb协议css选择器CSS的常见选择器有哪几种google统计怎样获得google ga 统计代码fastreport2.5护套线BV2.5中的2.5是指什么尺寸,单位是什么,BV又是什么意思?
中文域名注册查询 如何注册网站域名 独享100m site5 siteground 站群服务器 mediafire下载 godaddy域名转出 双11抢红包攻略 创宇云 服务器架设 中国特价网 谁的qq空间最好看 t云 in域名 联通网站 yundun 空间登录首页 shuang12 免费个人网页 更多