help on word document
am 09.08.2007 15:03:05 von piyush.plaban
i have to show the contents of a word document
i tried readfile() but that shows many binary characters of word
document which looks odd
plz suggest me any idea to show content of a word document just as
Google Docs & Spreadsheets shows after uploading a word document on
the fly.
plz help me its urgent suggest any way
Re: help on word document
am 09.08.2007 15:13:21 von zeldorblat
On Aug 9, 9:03 am, piyush wrote:
> i have to show the contents of a word document
> i tried readfile() but that shows many binary characters of word
> document which looks odd
> plz suggest me any idea to show content of a word document just as
> Google Docs & Spreadsheets shows after uploading a word document on
> the fly.
>
> plz help me its urgent suggest any way
You get a bunch of binary characters because Word files are binary --
not text.
You can probably use the COM functions to do this:
Re: help on word document
am 09.08.2007 15:39:06 von davidkruger
On Aug 9, 8:03 am, piyush wrote:
> i have to show the contents of a word document
> i tried readfile() but that shows many binary characters of word
> document which looks odd
> plz suggest me any idea to show content of a word document just as
> Google Docs & Spreadsheets shows after uploading a word document on
> the fly.
>
> plz help me its urgent suggest any way
What you need to be sure to do in your script that reads the file is
set the headers so the browser will know what it is supposed to be
doing with the file, instead of displaying as plain text. If you add
the headers like:
header("Content-type: applicaton/msword");
It will probably work like you are wanting it to, to get the word
document to display in the web browser. The header has to be sent
prior to sending any other data output in the script. Hope it helps.
Thanks,
David
Re: help on word document
am 09.08.2007 15:41:18 von davidkruger
On Aug 9, 8:13 am, ZeldorBlat wrote:
> On Aug 9, 9:03 am, piyush wrote:
>
> > i have to show the contents of a word document
> > i tried readfile() but that shows many binary characters of word
> > document which looks odd
> > plz suggest me any idea to show content of a word document just as
> > Google Docs & Spreadsheets shows after uploading a word document on
> > the fly.
>
> > plz help me its urgent suggest any way
>
> You get a bunch of binary characters because Word files are binary --
> not text.
>
> You can probably use the COM functions to do this:
>
>
If you add the line header("Content-type: application/msword"); prior
to outputting any other info to the screen it shoudl work as desired.
Hope it helps.
Thanks,
David
Re: help on word document
am 09.08.2007 15:47:02 von davidkruger
On Aug 9, 8:03 am, piyush wrote:
> i have to show the contents of a word document
> i tried readfile() but that shows many binary characters of word
> document which looks odd
> plz suggest me any idea to show content of a word document just as
> Google Docs & Spreadsheets shows after uploading a word document on
> the fly.
>
> plz help me its urgent suggest any way
It is odd, I posted a reply to this already but is not showing for
some reason...if a post or two appear above this one from me just
ignore it. you likely need to set a header in your script for content-
type to be application/msword. Doing so should I hope fix your
problem and display the word document. http://us3.php.net/header
Re: help on word document
am 09.08.2007 16:30:23 von davidkruger
> header("Content-type: application/msword");
Sorry, made a typo in my original post, correct header needed is above.
Re: help on word document
am 09.08.2007 16:48:21 von Jerry Stuckle
dkruger wrote:
> On Aug 9, 8:13 am, ZeldorBlat wrote:
>> On Aug 9, 9:03 am, piyush wrote:
>>
>>> i have to show the contents of a word document
>>> i tried readfile() but that shows many binary characters of word
>>> document which looks odd
>>> plz suggest me any idea to show content of a word document just as
>>> Google Docs & Spreadsheets shows after uploading a word document on
>>> the fly.
>>> plz help me its urgent suggest any way
>> You get a bunch of binary characters because Word files are binary --
>> not text.
>>
>> You can probably use the COM functions to do this:
>>
>>
>
> If you add the line header("Content-type: application/msword"); prior
> to outputting any other info to the screen it shoudl work as desired.
> Hope it helps.
>
> Thanks,
> David
>
This forces the user's system to start msword or something compatible on
their system. I read that he wants to display it as a web page - which
means he needs a .COM object on the server.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: help on word document
am 09.08.2007 16:54:42 von davidkruger
>
> This forces the user's system to start msword or something compatible on
> their system. I read that he wants to display it as a web page - which
> means he needs a .COM object on the server.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================- Hide quoted text -
>
> - Show quoted text -
You're right, the way I understood it, the requestor just was wanting
to display the content of the word file.
Re: help on word document
am 09.08.2007 17:01:41 von davidkruger
On Aug 9, 9:48 am, Jerry Stuckle wrote:
> dkruger wrote:
> > On Aug 9, 8:13 am, ZeldorBlat wrote:
> >> On Aug 9, 9:03 am, piyush wrote:
>
> >>> i have to show the contents of a word document
> >>> i tried readfile() but that shows many binary characters of word
> >>> document which looks odd
> >>> plz suggest me any idea to show content of a word document just as
> >>> Google Docs & Spreadsheets shows after uploading a word document on
> >>> the fly.
> >>> plz help me its urgent suggest any way
> >> You get a bunch of binary characters because Word files are binary --
> >> not text.
>
> >> You can probably use the COM functions to do this:
>
> >>
>
> > If you add the line header("Content-type: application/msword"); prior
> > to outputting any other info to the screen it shoudl work as desired.
> > Hope it helps.
>
> > Thanks,
> > David
>
> This forces the user's system to start msword or something compatible on
> their system. I read that he wants to display it as a web page - which
> means he needs a .COM object on the server.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================- Hide quoted text -
>
> - Show quoted text -
..COM only works on windows versions as well...which since not
specified in the post, the requestor has the option if on windows to
use .COM, or if on linux or other similar could use the header.
Either way would work to get the content of the word file.
Re: help on word document
am 09.08.2007 23:36:54 von burgermeister01
On Aug 9, 8:03 am, piyush wrote:
> i have to show the contents of a word document
> i tried readfile() but that shows many binary characters of word
> document which looks odd
> plz suggest me any idea to show content of a word document just as
> Google Docs & Spreadsheets shows after uploading a word document on
> the fly.
>
> plz help me its urgent suggest any way
Although I never had to actually implement this library, I have tested
this code and it seems to work O.K.
Just click the Software tab on the top...and oh yea, this only works
on a UNIX system, so I hope you're not running windows.
http://www.wagner.pp.ru/~vitus/software/catdoc/
Re: help on word document
am 10.08.2007 08:14:50 von piyush.plaban
Hi ZeldorBlat
i searched COM documentation in php.net but couldnt found a way to
open a document but my server doesnot allows me to open a document
directly from server i use xampp.
suppose i openeed (using $word->open()) the document after that what
to do??
i cant find any COM function to extract/get formatted text content
from opened word document.
pls help
Re: help on word document
am 10.08.2007 14:44:48 von Toby A Inkster
burgermeister01 wrote:
> http://www.wagner.pp.ru/~vitus/software/catdoc/
catdoc is good. The wvWare suite is better: it includes wvHtml which
converts from Word to HTML, keeping most of the formatting.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 50 days, 16:21.]
Command Line Interfaces, Again
http://tobyinkster.co.uk/blog/2007/08/02/command-line-again/