RTF To Inline Html

Hello,
I am trying to convert RTF file to Outlook style Html (embedded images)
using this code:

Aspose.Words.DocumentBuilder r = new DocumentBuilder();
r.InsertDocument(new Document("source.rtf"), ImportFormatMode.KeepSourceFormatting);
r.Document.Save("dest.html");

The result html file’s tags look like

Whereas the expected result is

Is it possible to achieve this without resorting to find\replace?

Hi Shay,

Thanks for your inquiry. Please try using the following code snippet:

Document doc = new Document("in.rtf");
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
// Save images in Base64 format to HTML
saveOptions.ExportImagesAsBase64 = true; 
doc.Save("out.html", saveOptions);

I hope, this helps.

Best regards,

Hi Shay,

Thanks for your inquiry. Unfortunately, Aspose.Words does not support the requested feature. However, you can embed images (Base64 format) in html document using HtmlSaveOptions.ExportImagesAsBase64 properties.

Document doc = new Document(MyDir + "in.rtf");
Aspose.Words.Saving.HtmlSaveOptions options = new Aspose.Words.Saving.HtmlSaveOptions();
options.ExportImagesAsBase64 = true;
doc.Save(MyDir + "Out.html", options);