PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 18th, 2004, 12:22 AM
Computer_Giant Computer_Giant is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 Computer_Giant User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Using PHP to read word documents(.doc/.txt) files

I'm doing a project right now and I'm kinda stuck with this... Anyone has any idea how to go about doing whats mentioned in the header?? Reference or whatever... I tried doing with various reference but only can readt .txt. When I read .doc files, those weird boxes will appear together with the content in the file.

PLEASE HELP!!!

Reply With Quote
  #2  
Old March 18th, 2004, 11:29 AM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
.doc is different encryption, its encrypted and i dont know if there is a way to read .doc files without getting "the wierd boxes". But basically .doc is encrypted by microsoft software aka word, trying to open with php will give you the weird boxes because it cannot decode.

Reply With Quote
  #3  
Old March 24th, 2004, 01:14 PM
tobycloud tobycloud is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Near Albany NY
Posts: 27 tobycloud User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to tobycloud Send a message via AIM to tobycloud
Quote:
Originally Posted by Bruski
microsoft software

I emphasize the above quoted material:

Microsoft Software

Have a nice day

Reply With Quote
  #4  
Old August 17th, 2004, 12:43 AM
shankanagavel shankanagavel is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 shankanagavel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hai friends,
i m new to php.i want to know abt ..how to read the MS-word doc files
if any one knows help me

with regards
kanagavel

Reply With Quote
  #5  
Old August 17th, 2004, 03:49 AM
Itsacon's Avatar
Itsacon Itsacon is offline
Command Line Warrior
Click here for more information
 
Join Date: Aug 2004
Location: Sector ZZ9 Plural Z Alpha
Posts: 1,030 Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 1 Week 12 h 39 m 36 sec
Reputation Power: 12
Send a message via ICQ to Itsacon
If you had read the threat correctly, yo would have seen it was already agreed it isn't possible.

Now OpenOffice, THAT you can read. OpenOffice documents are saved as Zipped XML files. Just use a zip library to unzip and parse the XML code, and PHP should have no problem with either.

See? Who needs Microsoft?

Reply With Quote
  #6  
Old September 9th, 2004, 09:35 AM
Christoff777 Christoff777 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 Christoff777 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes you can

Quote:
Originally Posted by Itsacon
If you had read the threat correctly, yo would have seen it was already agreed it isn't possible.

Now OpenOffice, THAT you can read. OpenOffice documents are saved as Zipped XML files. Just use a zip library to unzip and parse the XML code, and PHP should have no problem with either.

See? Who needs Microsoft?

First of all, it is possible:
Using (D)COM on php.

example:
<?
$word = new COM("word.application") or die("Unable to instanciate Word");
$word->Visible = 1;
$word->Documents->Open("one.html");
$word->Documents[1]->SaveAs("test_one.doc",1);
$word->Quit();
$word->Release();
$word = null;
?>

Alternatively studying the doc file type, from fcmin to fcmac in the file type is essentially text, if
you can get those offsets, it should be easy extracting text out of a word document.
Fcmin seems to start at 1536 physical bytes most of the time, excluding the FIB.

As for the microsoft comment... Like it or not, Currently microsoft products are being used
by the majority of your customers.

Telling them to use openoffice, isn't a real solution, most people wont go over to openoffice,
simply because it isnt microsoft, microsoft currently holds a psychological advantage.

Their product isnt better, but, you get the picture....

Who needs microsoft? As long as you've got customers, you'll need microsoft.

Reply With Quote
  #7  
Old September 9th, 2004, 10:52 AM
Itsacon's Avatar
Itsacon Itsacon is offline
Command Line Warrior
Click here for more information
 
Join Date: Aug 2004
Location: Sector ZZ9 Plural Z Alpha
Posts: 1,030 Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 1 Week 12 h 39 m 36 sec
Reputation Power: 12
Send a message via ICQ to Itsacon
Quote:
Originally Posted by Christoff777
Who needs microsoft? As long as you've got customers, you'll need microsoft.


Not really, OpenOffice can read word documents fine.

Haven't had any MS Office software on my system for over 4 years (Used StarOffice at first, later OpenOffice).

Same goes for explorer, between Opera and Netscape, IE and OE haven't gone through my firewall for years (IE only for windows updates).

It's a myth that when your customers use crappy software, you have to do it too.

Reply With Quote
  #8  
Old September 10th, 2004, 01:12 PM
Christoff777 Christoff777 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 Christoff777 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by Itsacon
Not really, OpenOffice can read word documents fine.

Haven't had any MS Office software on my system for over 4 years (Used StarOffice at first, later OpenOffice).

Same goes for explorer, between Opera and Netscape, IE and OE haven't gone through my firewall for years (IE only for windows updates).

It's a myth that when your customers use crappy software, you have to do it too.

The fact that openoffice can read word documents isnt the point... This isnt what the discussion is about...

Btw opening Word documents in openoffice will work, but its definately not perfect.

Wasnt actually talking about your software, I could care less, was talking about customers..

Reply With Quote
  #9  
Old September 10th, 2004, 01:16 PM
Christoff777 Christoff777 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 Christoff777 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question mmm

Just one question?

If you dont have any microsoft products, and never use them?

How are you going to help your customers?

There is a lot of alternatives for microsoft products yes, but its far from perfect, would you advise them to dump all their hard work and do everything over to learn a program they never saw before? Doesnt
sound very productive...

Not actually knowing their product, might prove to be a problem.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Using PHP to read word documents(.doc/.txt) files


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap