[horde] Horde:MIME:Viewer:msword.php improvement

Pulese Valerio valerio at dei.unipd.it
Wed Jun 19 10:51:40 PDT 2002


Hello
this message is for anybody out there using wvWare to preview
MS Word document in HORDE/IMP and want to enable 
image/pictures emebedded in .doc attachments.

First create a directory htdocs/tmp-wvWare under the
httpd root path writable by nobody/apache or whoever uid
is running httpd server:

	mkdir /usr/local/http/htdocs/tmp-wvWare
	chown nobody:nobody /usr/local/http/htdocs/tmp-wvWare
	or chmod go+rwx /usr/local/http/htdocs/tmp-wvWare

Create a symbolic link from /:

	ln -s /usr/local/http/htdocs/tmp-wvWare /tmp-wvWare
 
Now its time to teach horde to create temporary html and images file
in the right place.
Edit /horde/config/mime_drivers.php as follow:

	/* Location of the wvHtml binary. */
 	$mime_drivers['horde']['msword']['location'] = '/usr/local/bin/wvWare';

Edit /horde/lib/MIME/Viewer/msword.php as follow:

	if (count($version) > 2 && ($version[0] > 0 || $version[1] >= 7)) {
  	$args = " --dir=/tmp-wvWare --basename=/tmp-wvWare/img$$- --charset=iso8859-1 $tmp_word >$tmp_output";
	 	
--dir= to extract embedded images in /tmp-wvWare (with correct <href>)
--basename= to create images with a "unique" name (imgPID-0,imgPID-1, etc.)
--charset=iso8859-1 works better with my netscape version.

Directory /tmp-wvWare should be periodically cleaned up
via appropriate crontab entry.
I use wvWare-0.7.2  and libwmf-0.2.5.

Hope this helps

		Valerio


-- 
E-Mail Valerio.Pulese at dei.unipd.it          ||\\      
Dipartimento di Elettronica e Informatica   || \\==== ||
V. Gradenigo 6/A -  35131 Padova - Italy    ||__\\==  ||
Phone: ++39-49-8277792 Fax: ++39-49-8277699 |_____\===||



More information about the horde mailing list