Re: PHP and Word...
| From: | Adam Bregenzer | Date: | Mon, 16 Feb 2004 01:07:19 +0000 |
| Subject: | Re: PHP and Word... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-177763@lists.php.net to get a copy of this message | ||
On Sun, 2004-02-15 at 18:28, Russell P Jones wrote:
> I need to use PHP to pull the first page from a Word Document and then
> print it to the screen. It doesnt have to be fancy, so even if just the
> text is pulled that would be fine (although formatting would be grand
> too).
[snip]
> I was thinking about converting it to text somehow, and then just pulling
> the first 50 lines or so - but I dont know how to convert it to text...
Here is a snippet of sample code I have that uses wvWare[1] to display a
Word doc. You should be able to pass it through shell_exec[2]. It is
not perfect but does a decent job of keeping formatting.
passthru(WV_HTML_PATH . ' "' . FILES_HOME_DIR . $file . '" -');
[1] http://wvware.sourceforge.net/
[2] http://us4.php.net/shell_exec
--
Adam Bregenzer
adam@bregenzer.net
http://adam.bregenzer.net/