0

I have JSF RichFaces rich:editor running and I am able to upload and open documents or just stream them to the editor. The issue is that .doc or docx or other richText documents will show lots of stuff that is not what I see in the actual document when I open it with Office, and the only format that I am able to actually get rigth is when I get it from a HTML file.

My questions are:

Is there any way to open the documents online and have them edited similar to what Google Docs have?

Is there any way to tweak RichFaces rich:editor component to do what I want to do?

NOTE: If I copy and Paste from .doc then its works just ok, but here I have to get it from streaming

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
petrichi
  • 101
  • 1
  • 6

1 Answers1

0

You basically need to convert DOC(X) to HTML for editing and HTML to DOC(X) after saving. That's also what Google Docs is basically doing.

Your next question shall most probably be, "How do I convert from DOC(X) to HTML and back?". You can use among others Open Office API for this, or a library on top of it like JDOCConverter. Alternatively, you can also parse the DOC(X) yourself with help of a low level API like Apache POI HWPF and then generate the desired HTML accordingly based on the infomation collected in Java objects.

No, this is not a trivial task. You need to have a good understanding of the DOC(X) format (this question alone already shows that you don't have) and the limitations during the conversion step. I'd personally recommend to just use Google Docs.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • OK, lets say I want to use Google Docs, I know that they have an API for developers to use their file system. But in this case I need to have it integrated in my file system and have the editor in my libraries and not to have an iFrame linked to Google editor that is somewhere. Correct me if I am wrong. Thank you – petrichi Mar 27 '13 at 16:50