RTF转换为HTML在.NET [英] Convert RTF to HTML in .NET

查看:495
本文介绍了RTF转换为HTML在.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功用做反向 web浏览器的RichTextBox

I've managed to do the reverse using WebBrowser and RichTextBox.

不过,我将如何转换成RTF格式为HTML?

But how would I convert RTF to HTML?

推荐答案

免责声明:我正在查看这家公司

Disclaimer: I'm working for this company.

我看到的,问题是旧的,但对于这一点,也许有人搜索解决方案。我们的组件RTF到HTML允许RTF格式转换为HTML。您可以下载一个组件或尝试网上演示。第一次尝试试用版本,如果你有一个疑问。 :)审判是免费的。

As I see, the question is old but maybe someone search solution for this too. Our component RTF to HTML allows to convert RTF to HTML. You may download a component or try online-demo. Try the trial version first if you have a doubt. :) Trial is free.

下面是从RTF转换在ASP.NET到HTML中的code样品:<​​/ P>

Here's the code sample for the converting from RTF to HTML in ASP.NET:

    SautinSoft.RtfToHtml r = new SautinSoft.RtfToHtml();
    r.OutputFormat = SautinSoft.RtfToHtml.eOutputFormat.HTML_401;
    r.ImageStyle.IncludeImageInHtml = false; //To save images inside HTML as binary data specify this property to 'true'

    r.ImageStyle.ImageFolder = Server.MapPath(""); 
    r.ImageStyle.ImageSubFolder = "images";
    r.ImageStyle.ImageFileName = "picture";       

    string rtf = ".....";
    string html = r.ConvertString(rtf);        

    //show HTML
    if (html.Length>0)
    {
        Response.Buffer = true;
        Response.Clear();
        Response.ContentType = "text/html";
        Response.Write(html);
        Response.Flush();
        Response.End();
    }

这篇关于RTF转换为HTML在.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆