我想将RichTextBoxContents
交换为HTML。
我用过aspose.word
,但它是演示版。 ex)enter image description here
这应该指导你一个粗略的方向:
string output = "";
Foreach( line in richtextbox.text)
{
output += $"<p style=\"color:{line.color.name};\">"
output += line
ouput += "</p>";
}
应该给你这样的东西:
<p style="color:red;">This is a the line content.</p>
我在手机上,如果语法有点偏离,那就怜悯吧