Hi ,
I am facing a problem with “br” HTML tag in rendering in a word document. Following is the code that I am using to write s1 and s2 with one line break. s1 has
tag at the end . But both the strings are getting concatenated without any space. Please help me to resolve my problem. Please let me know if my code is wrong anywhere.
The output should be :
<font class="Apple-style-span" face="Arial">Some text 1 </font>
<font class="Apple-style-span" face="Arial">Some Text 2</font>
protected void BtnGenerateDocument_Click(object sender, EventArgs e)
{
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
string s1 = "<style>ol,ul,p{margin:0px;}</style><span id=" + "\"customSpanWithFontStyles\" style=\"font-size:8pt; font-family:Arial;\">Some text 1 </span><span class=\"Apple-style-span\" style=\"background-color: rgb(255, 255, 0); \"><br/></span>";
string s2 = "<style>ol,ul,p{margin:0px;}</style><span id=\"customSpanWithFontStyles\" style=\"font-size:8pt; font-family:Arial;\">Some Text 2</span>";
builder.InsertHtml(s1 + s2);
doc.Save(PathOfFile + "DocumentBuilderAndSave Out.docx");
}
Thanks,
Deepti Jain