Alicia Posted November 28, 2008 Share Posted November 28, 2008 Hi guys, I would like to convert the output i generated with my php mysql (while loop) content with text, tables and images to microsoft word after a click.. how can I accomplish this ? I did try to search online but couldnt find any solutions yet. Hope to hear some advise from you guys soon. thanks.. Quote Link to comment Share on other sites More sharing options...
chmpdog Posted November 28, 2008 Share Posted November 28, 2008 Im not sure if it will work, but you could try to write the text to a new file by changing the extension to .doc, just use fopen, or some kind of f Quote Link to comment Share on other sites More sharing options...
Mchl Posted November 28, 2008 Share Posted November 28, 2008 Probably the easier thing would be to open html file in Word. Quote Link to comment Share on other sites More sharing options...
corbin Posted November 28, 2008 Share Posted November 28, 2008 http://www.microsoft.com/interop/docs/OfficeBinaryFormats.mspx Enjoy. There's probably already something out there for that though. Quote Link to comment Share on other sites More sharing options...
Alicia Posted November 29, 2008 Author Share Posted November 29, 2008 How can I open the php generated html tag in microsoft word like you suggested ? we dont really need an online microsoft word.. what we want is only open the microsoft word we have installed in our local computer and edit the data we have generated by using php (images and text sourced from database) please advise Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 29, 2008 Share Posted November 29, 2008 The Microsoft word document formant itself is a proprietary thing that I believe is copyright from exact duplication (Sorta like certain drugs have copy rights until a generic comes out) You need to build your files in a suitable analog such as RTF or Open Office or XML that word can read with some success. Quote Link to comment Share on other sites More sharing options...
corbin Posted November 29, 2008 Share Posted November 29, 2008 The Microsoft word document formant itself is a proprietary thing that I believe is copyright from exact duplication (Sorta like certain drugs have copy rights until a generic comes out) You need to build your files in a suitable analog such as RTF or Open Office or XML that word can read with some success. MS had to release all of their file formats for some reason or other. I would assume with having to release them, they also had to allow people to use them. I could be wrong though. I just know they were court ordered to write papers on [some of] their formats. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 29, 2008 Share Posted November 29, 2008 yeah but I think the reproduction of that format without their software is in violation of the terms sorta like making viagara in your basement, you can do it the formula is known but its illegal Quote Link to comment Share on other sites More sharing options...
corbin Posted November 29, 2008 Share Posted November 29, 2008 So it's legal to make something that can just read the format then? Guess it makes sense since they make free readers. Now I'm off to google.... lol Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 29, 2008 Share Posted November 29, 2008 Its something like that I know there was a big thing over this big new print to pdf era that has come about and adobe didn't have the proper licensing on the file format to protect it. You can know how a word document is made and the structure of it in the binaries etc., but you do not have the legal right to reproduce the documents from nothing. I.e <?php Make_Word_Doc($filename,$content); ?> And have it produce the binaries of a .doc/.docx file You can do it to make a .rtf/.xml/.txt because those are open file formats You can make it a .docx but you can not make it into a "word document" meaning proper file structure. This is all to the best of my knowledge with no googling so it may be wrong Quote Link to comment Share on other sites More sharing options...
corbin Posted November 29, 2008 Share Posted November 29, 2008 Eh knowing MS, it's probably right. Quote Link to comment Share on other sites More sharing options...
Mchl Posted November 29, 2008 Share Posted November 29, 2008 docx is now an ISO standard (%#$@%^) and is under MS 'Open Specification Promise' ("Microsoft irrevocably promises not to assert any Microsoft Necessary Claims against you for making, using, selling, offering for sale, importing or distributing any implementation to the extent it conforms to a Covered Specification […]") so you can download its specs and do your own tool using it. They promise not to sue you. Alicia: Save output of your script using your browser, then open it in MS Word. That's most likely going to look crappy, but other than that should work. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 29, 2008 Share Posted November 29, 2008 but that is docx not .doc correct? I know the new .nnnX formats are XML so they have a reasonable strucutre Quote Link to comment Share on other sites More sharing options...
MatthewJ Posted November 29, 2008 Share Posted November 29, 2008 Even better, the nnnX formats are compressed files containing all the "parts" of the document... Create a .docx and rename it to .zip and open it... You will see that it is made up of about 15 files Quote Link to comment Share on other sites More sharing options...
corbin Posted November 29, 2008 Share Posted November 29, 2008 Wow it sounds like Microsoft actually had a decent format with the .<blah>x's. The HTML route would be easiest.... Just store HTML in a file and have the user download it or something (or write HTML to the browser and send download headers), and then they can open it in word. Quote Link to comment Share on other sites More sharing options...
Alicia Posted December 1, 2008 Author Share Posted December 1, 2008 actually what i am looking for is open the ms office word i have in my computer to edit the output i see from the web page (generated by php and mysql) before i save it in document format.. i dont really need an online version of ms word.. we do have valid license for the ms word, so that is not really the issue.. the issue is how i can pass all the web content to my ms word in a single click?? Quote Link to comment Share on other sites More sharing options...
Mchl Posted December 1, 2008 Share Posted December 1, 2008 In a single one you can't. You will need as much as 5 (on my system) Open your webpage in browser, select File->Save As, select location to save and click save Open your MS Word, select File->Open, browse to the location where you saved your file, and open it. The results might be disappointing if the webpage has complicated layout. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted December 1, 2008 Share Posted December 1, 2008 Use a RTF format it will give you some editing that will get you close to a word document. Quote Link to comment Share on other sites More sharing options...
Alicia Posted December 4, 2008 Author Share Posted December 4, 2008 is there any ready made script that i can get online? it is okay even it is not free.. please advise. Quote Link to comment Share on other sites More sharing options...
Mchl Posted December 4, 2008 Share Posted December 4, 2008 is there any ready made script that i can get online? it is okay even it is not free.. please advise. Maybe there's something on http://www.hotscripts.com/ Quote Link to comment 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.