Page 1 of 1

Read rtf ?

Posted: Sat Apr 28, 2007 9:38 am
by satheshf12000
Hi all..

I am wondering on how to read an rtf file through php. Its printing as if it was opened as a text file. somethings are included automatically like this..
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 hi this is a long test.\par this is sat testing the file.\par } 0
any help is really appreciated.

thanks..

Posted: Sun Apr 29, 2007 5:40 am
by Ollie Saunders
search around for a library. I looked on PEAR and there doesn't seem to be anything there, which I find rather surprising but meh.

Posted: Sun Apr 29, 2007 6:31 am
by mentor
You can read rtf using COM. Read the user comments at the bottom of the page.

COM functions are only available for the Windows version of PHP.

Posted: Sun Apr 29, 2007 9:41 am
by feyd

Posted: Sun Apr 29, 2007 12:23 pm
by timvw
If you have lots of time you can also look at the RTF Specification.

Posted: Sun Apr 29, 2007 6:19 pm
by Ambush Commander
The last I checked, there are really no satisfactory pure-PHP RTF parsers out there right now. COM will let you piggy back off of Microsoft Word's RTF parsing capabilities (which are fairly good), and that PHP class looks interesting but probably has incomplete coverage of the RTF spec.