|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
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!!! ![]() |
|
#2
|
|||
|
|||
|
.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.
|
|
#3
|
|||
|
|||
|
Quote:
I emphasize the above quoted material: Microsoft Software Have a nice day ![]() |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
||||
|
||||
|
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? |
|
#6
|
|||
|
|||
|
Yes you can
Quote:
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. |
|
#7
|
||||
|
||||
|
Quote:
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. |
|
#8
|
|||
|
|||
|
Quote:
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.. |
|
#9
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Using PHP to read word documents(.doc/.txt) files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|