2

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?
Community
  • 1
  • 1
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
  • 2
    It depends... If users are more reading than updating the data in your rtf, you can add another column with the html one... Each time a user modify the RTF from the legacy app, you save the rtf and its html convertion to the new column... Each time a user modify the HTML from the new app, you save the html and its RTF convertion to the current column... – Whiler Sep 02 '11 at 10:40
  • THis is a solution, but an overhead. Expecially if I allow to add images in the future... Why HTML, may be version 6, doesn't contain also rtf spec?... – UnDiUdin Sep 02 '11 at 11:03
  • But where is the "trick"? All i see is `PlainText` employment which is pretty well-known... Also, HTML version 6, LOLWUT? – Premature Optimization Sep 08 '11 at 02:19

1 Answers1

3

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.

Jens Mühlenhoff
  • 14,565
  • 6
  • 56
  • 113