NotionCommotion Posted December 9, 2014 Share Posted December 9, 2014 Other than downloading the file, editing it on the local PC, saving it, and uploading it back to the server using some applicable script, any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/292985-edit-microsoft-word-file-on-website/ Share on other sites More sharing options...
QuickOldCar Posted December 9, 2014 Share Posted December 9, 2014 Some sort of csv conversion may be better. Then could edit it in a form on site or manipulate the data in other ways.. Quote Link to comment https://forums.phpfreaks.com/topic/292985-edit-microsoft-word-file-on-website/#findComment-1499085 Share on other sites More sharing options...
Psycho Posted December 9, 2014 Share Posted December 9, 2014 (edited) Microsoft word documents are not plain "text". The files contain extensive markup text, similar to HTML, to specify properties such as font, color, position, etc. etc. etc. Not only that, but several years back MS made a significant change in the format of that markup. Previously (.doc), it used a MS proprietary format and now (.docx) it uses an XML based format. So, it is not a trivial task to create an on-line editor. Trying to code an editor yourself will be a huge amount of effort and would require that you limit what a user can do. I suspect there are some APIs/Classes available that can do most, if not all, of what you are doing. I would start by doing some Googling for that. But, I suspect that either you would find some free tools that are limited, or you will find more comprehensive tools that cost money. Edited December 9, 2014 by Psycho Quote Link to comment https://forums.phpfreaks.com/topic/292985-edit-microsoft-word-file-on-website/#findComment-1499087 Share on other sites More sharing options...
NotionCommotion Posted December 9, 2014 Author Share Posted December 9, 2014 Maybe Libreoffice? I currently use it headless to convert word/excel/powerpoint to PDF. Quote Link to comment https://forums.phpfreaks.com/topic/292985-edit-microsoft-word-file-on-website/#findComment-1499103 Share on other sites More sharing options...
Psycho Posted December 9, 2014 Share Posted December 9, 2014 (edited) That sounds like a MS Office replacement application. What you need is a Web based interface that can read the source code of the Word docs, convert it to content that you can represent in a web interface, allow the user to make edits to the content (using features such as bold, color, font (whatever you need), and finally convert that web content back into the format for a word document. Take a look at these search results: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=php%20microsoft%20word%20library Edited December 9, 2014 by Psycho Quote Link to comment https://forums.phpfreaks.com/topic/292985-edit-microsoft-word-file-on-website/#findComment-1499111 Share on other sites More sharing options...
kicken Posted December 9, 2014 Share Posted December 9, 2014 Probably the easiest thing to do would be to use something like LibreOffice to convert the document to HTML, load it in a TinyMCE instance, then on save convert it back to a word document (assuming that is possible using LibreOffice). That would provide basic editing capabilities, but nothing fancy and may not work with every document. Word allows you to do quite a bit of stuff that doesn't easily translate to a web interface. Quote Link to comment https://forums.phpfreaks.com/topic/292985-edit-microsoft-word-file-on-website/#findComment-1499115 Share on other sites More sharing options...
NotionCommotion Posted December 10, 2014 Author Share Posted December 10, 2014 Thaanks kicken, makes sense. Quote Link to comment https://forums.phpfreaks.com/topic/292985-edit-microsoft-word-file-on-website/#findComment-1499137 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.