Jocka Posted November 19, 2006 Share Posted November 19, 2006 I just started using this on a server of mine to convert doc files to html. The only thing I can't figure out how to do is instead of creating a HTML file, I just want the output. If anyone has used wvware, maybe you can help.This is the format to make it work "wvHtml .docfile .htmlfile"One thing we tried when executing was "wvHtml $thisdoc /dev/stdout" but it's calling dev a directory. As I understand, this should just echo out the information if it were in a php like this:[code]<?php$newDoc = system('wvHtml $thisdoc /dev/stdout');echo $newDoc;?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/27737-wvware-anyone-use-it/ Share on other sites More sharing options...
steviewdr Posted November 19, 2006 Share Posted November 19, 2006 I dont know about wvware - but if you set the headers on a html page to be a word document - Microsoft Word will convert it to a *.doc for you -)Here is how to set the headers: header("Content-disposition: filename=your_file.doc"); header("Content-type: application/msword");And MS word should handle that page then.-steve Quote Link to comment https://forums.phpfreaks.com/topic/27737-wvware-anyone-use-it/#findComment-127039 Share on other sites More sharing options...
Jocka Posted November 20, 2006 Author Share Posted November 20, 2006 The problem isn't creating .doc files. I can do that with ease. The problem was reading doc files created in microsoft word or openoffice (the 2 main programs). It seems to do a decent job doing it but like I said. I have to upload the .doc file, then convert it to an html file, then read the html file, then delete the html file. All I was looking for was a way to convert it from .doc to html (not an html file) and output the information. This way I could do this : $string = system('wvHtml this.doc output');Then I could just throw all the output into a string. It works within the Linux shell environment to use /dev/stdout but not in the php "System" function. Quote Link to comment https://forums.phpfreaks.com/topic/27737-wvware-anyone-use-it/#findComment-127419 Share on other sites More sharing options...
steviewdr Posted November 21, 2006 Share Posted November 21, 2006 Ah! Apologies.Why not get the "catdoc" application? Its available for linux (and a debian package :-) ). It can be called via the cmdline or system(). Do you need graphics and all that - or just the text however. It would be very difficult to replicate a doc as a html page in my opinion. Anyways take a look at catdoc - if you just need the text etc.http://freshmeat.net/projects/catdoc/http://www.45.free.net/~vitus/software/catdoc/ Quote Link to comment https://forums.phpfreaks.com/topic/27737-wvware-anyone-use-it/#findComment-127853 Share on other sites More sharing options...
redbullmarky Posted November 21, 2006 Share Posted November 21, 2006 if the need for just the text content is all, then that gives you a few solutions. as steve said, there's catdoc. also:1, antiword (free) - http://www.winfield.demon.nl/2, phpWordLib (costs) - http://www.phpwordlib.motion-bg.com/3, i wrote a class that will strip out the text from a word file. it's a bit messy, but it works perfectly. PM me and i'll send it you Quote Link to comment https://forums.phpfreaks.com/topic/27737-wvware-anyone-use-it/#findComment-127861 Share on other sites More sharing options...
Jocka Posted November 22, 2006 Author Share Posted November 22, 2006 I'm going to check all these out. I've been trying to figure this out for a few weeks now.Cat doc looks promising so I'm gonna look into it a little bit more.Any more suggestions as well? My boss now says it's ok to just get text. wvWare got all of the formatting but I explained to my boss that it would be easy to find a substitute for this if all else fails but it would have to be text only. He said ok so i'm good to go. :) Quote Link to comment https://forums.phpfreaks.com/topic/27737-wvware-anyone-use-it/#findComment-128311 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.