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

Free Support Forum - aspose.com

Text to HTML with html within the text

I am trying to convert a text doucment that has text along with HTML to an HTML document. The results are not what I expected, I lose the text of the html tags, which are supposed to be considered text. I have tried to using LoapOptions with the LoadFormat set as Text, but I get the same result.


Aspose.Words.LoadOptions lo = new Aspose.Words.LoadOptions(Aspose.Words.LoadFormat.Text,null,null);

Document doc = new Document(filepath, lo);

doc.Save(newfilepath, Aspose.Words.SaveFormat.Html);

Example: test.txt

Here is simple html text:





Thanks for your inquiry. After an initial test with Aspose.Words 13.5.0, I was unable to reproduce this issue on my side. Please upgrade to the latest version of Aspose.Words from the following link:

I hope, this helps.

Moreover, I have attached sample input/output documents here for your reference. If we can help you with anything else, please feel free to ask.

Best regards,

Thank you for responding to my issue. I have downloaded the lastest Words . NET (13.5) and my results are the same. Below is my test file and the output along with the code I used to generate the output.

Input: test.txt

Here is simple html text:


Output: test.html & test2.html (formatted for display)

Here is simple html text: 1234567890


Document doc;


doc = new Document("C:\\test.txt");




catch (Exception e){

Console.WriteLine("Error: e.Message");



Thanks for the additional information. Please specify the LoadOptions and try run the following code snippet. This will fix the issue:

loadOptions =
new Aspose.Words.LoadOptions();

loadOptions.LoadFormat = LoadFormat.Text;

Document doc = new Document(@"C:\Temp\Docs\test.txt", loadOptions);


Best regards,