We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Transform String literal to HTML

Hello I have a RTF document, which contains HTML.

I would like the transform the HTML markup in a document to HTML, it is currently interpreted as a string literal.

for example this document.rtf, http://i.imgur.com/qmP1DSV.png (also in the attachements) gets transformed to the following HTML:

but I would like the HTML to actually be parsed like this:

the current code:
byte[] buffer = Encoding.ASCII.GetBytes(responseItem.Notes.ToString());
MemoryStream newStream = new MemoryStream(buffer);
Document doc = new Document(newStream);
var saveOptions = new Aspose.Words.Saving.HtmlSaveOptions(SaveFormat.Html);
responseItem.Notes = doc.ToString(saveOptions);

Hi Daniel,

Thanks for your inquiry. You need to detect HTML code inside main Document and insert it (html) using DocumentBuilder.InsertHtml method into another document. After that you can save the new Document instance to HTML format. I hope, this helps.

Best regards,