Search code examples
htmldelphistoragertf

rtf and html can live in the same application?


I have what I think it is a very popular problem. I have a legacy app that contains rtf fields. rtf in my case is used only for very basic features (font: size, style, color, ... hyperlinks). Anyway since I allow to paste from word sometimes some more complex things can go in there.

Now rtf is ok, even because with Report Builder I can get reports where rtf is printed.

The problem comes with web application. I am developing a web application that is basically an optional interface for my legacy application.

At this stage I solved the probelm by removing the rtf formatting (I use the TRichEdit trick discussed here).

Anyway ideally I would like to be able to see and edit formatted text in both the web application and the win32 application.

What can be the solution?

In this question I found a link to the ScroogeHTML converter.

But even if I convert there are these points that i cannot reconcile:

  1. Storage: what to store? Currently of course I store rtf.
  2. Should I convert rtf to html every time I show the rich text in web app and then convert it back to rtf for storage?

Solution

  • Your could implement a RTF editor in your web application.

    http://en.wikipedia.org/wiki/Online_rich-text_editor

    This way you don't have to change the storage format.