开发者

What is a good, free solution for Richtext editor and convertion to HTML?

Simple situation. I'm trying to write my own blog with a minor twist. Part of the blog will be controlled from a client application instead of a web interface. Basically, I'm still in the design phase and haven't written a single line of code. But I'm trying to combine several techniques into an interesting exercise in software development. Thus I want a client application which I can use to write articles in, which can then upload the article through a web service to the server. (The client would be Delphi 2007/WIN32 and the service is ASP.NET/C# with SQL Server.)

The article itself would be stored in RTF format, including images. This would be in a local database on the client, which would also keep track of the article's status. Once uploaded, it will keep the article synchronised with the version on the server. Technical details are just boring and as said before, still in a design phase...

But I do need a good solution to convert the article from RTF in the database to HTML to be displayed in the blog. I have two options:

  1. Upload both the RTF and HTML from the client, with the client doing the convertion from RTF to 开发者_如何转开发HTML.
  2. Upload just the RTF and let it convert on demand on the server. (Or convert on the server when the RTF is uploaded.)

Option 1 would need a Delphi/WIN32 solution to convert it while option 2 would need a .NET solution for the conversion. I don't want an RTF editor for .NET but need a good option to use in Delphi 2007. And I need something to convert an RTF to HTML, which would keep (almost) all formatting and which would include all images from the text. This could be both in .NET or Delphi.

So, I have the following questions:

  • Is there a good, free RTF editor for Delphi which can handle images?
  • Is there a good RTF-to-HTML converter for Delphi or C# which can keep as much of it's formatting intact as possible, including images?


Some good suggestions for .Net: Convert Rtf to HTML


Since you provided so much background about why you are doing it, I am going to provide some feedback on the whole plan. This may not be an answer to your question directly though. Sorry.

You might consider looking at Windows Liver Writer for the client. If you just implement an API it supports then it can do all the editing.

Also, I would suggest skipping RTF all together. Converting from RTF to HTML will loose some formatting, and typically create sub-optimal HTML. Creating an RTF with the sole intent of converting to HTML is a less than optimal solution.

Instead keep it HTML for the round trip. If you must use RTF, then limit the RTF formatting to the HTML formatting you want to support. That way the conversion will be more accurate. Then convert as soon as possible, providing a preview for the poster. Since it won't always convert accurately you want the poster to see any of the conversion oddities before they make them public. That way they can fix them before they are embarrassed.


You'd better take a look at TRichEditWB component in EmbeddedWeb component pack. The whole pack is open-source:

http://www.bsalsa.com/forum/forumdisplay.php?f=29

You can add image, and even controls like buttons and checkboxes to TRichEditWB. It also can hilight HTML and XML code, and recognize URLs automatically.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜