With a quick search on google I was able to find about 5 php classes that do what you want to do. If you want to write your own parser open a .rtf in notepad to see what makes it up. It is pretty simpe, \par=new paragraph, \line=new line, \fs12=font size 12. Once you convert it to html there are several free classes to convert to pdf and doc/x.