Hi everyone,
I am trying to read a .rtf document. I m using the following line of code just for testing purpose.
$fileName = "/usr/local/apache/htdocs/abc/testing.rtf";
$data = fopen($fileName, "r");
$data1 = fread($data, filesize($fileName));
echo $data1;
The above line of code gives output in the following maner in the browser window.
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 This is a sample tesst page. Lets c it reads it or not.\par \par \b The bold text\par \par \b0 This is testing.\par }
so anyone here can help me to get the exact text of the .rtf document through php code ?
i'll be waiting for someones response...
Thnx .........
problem in reading .rtf document
Moderator: General Moderators
I assume you only want plain text, for instance:
-------------------
This is a sample tesst page. Lets c it reads it or not.
The bold text
This is testing.
-------------------
?
I've got a feeling this might be very difficult.
However, you could take a look at http://www.phpwordlib.motion-bg.com/
-------------------
This is a sample tesst page. Lets c it reads it or not.
The bold text
This is testing.
-------------------
?
I've got a feeling this might be very difficult.
However, you could take a look at http://www.phpwordlib.motion-bg.com/
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
RTF is an open format, there's no reason why someone shouldn't have built a PHP RTF parser converter into HTML.
In fact, if no one has, that sounds like a good project...
Wikipedia has info and links to specifications: http://en.wikipedia.org/wiki/Rich_Text_Format
In fact, if no one has, that sounds like a good project...
Wikipedia has info and links to specifications: http://en.wikipedia.org/wiki/Rich_Text_Format