I'm developing a web application which has the need of a powerful .doc editor. The user has to select a document template (normally a .doc file) filled with placeholders, and through some macros fill the placeholders with the correct values (maybe picked from a db). I proposed my boss to let the user download the template, edit it with his desktop application (MS Word, OpenOffice Writer, ecc) but the boss wants it online and inside the jsp page. To me it seems I have only two choices: applet or javascript (I'm aware of these two only, there are tons of other techologies I don't know).
The flow would be:
- the user selects a template from the server
- the client pc downloads the template chosen and loads it in the web editor
- the user edits the template
- the user sends the edited file to the server 开发者_如何学Go
- the server saves the file
I saw these two wsyiwyg editors (ckeditor and tinymce) but I didn't find .doc support (neither .odt). Do you know any other plugin I could use to achieve this result? Thank you!
Convert DOC to RTF or whatever format supported by those WYSISYG editors and then convert it back upon submit. There are some free Java APIs available which can salvage Word documents.
- Apache POI HWPF/XWPF (both .doc and .docx)
- OpenOffice.org UNO (only .docx)
- Docx4J (only .docx)
Sounds like you have your answer already but in case it's useful, I've seen a dev project using Docmosis to work with templates in DOC format. Docmosis does an analysis looking for fields and sections in the template and stores that somewhere in a Java object. You can get hold of it and use it as the basis for generating Web forms etc dynamicall - based on the doc template itself!
精彩评论