开发者

Doc editor in JSP

开发者 https://www.devze.com 2023-04-10 00:38 出处:网络
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

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:

  1. the user selects a template from the server
  2. the client pc downloads the template chosen and loads it in the web editor
  3. the user edits the template
  4. the user sends the edited file to the server
  5. 开发者_如何学Go
  6. 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!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号