Hi,
I have a requirement to save word document in data base as HTML string and to convert it back into into word document. The first part, ie, converting the word file into html and saving as MS SQL NVARCHAR was done successfully ith ASPOSE. But I am running into issues while converting the html string into a word document. I am getting formatting issues with the bullet points. I am loosing the space between the bullet point and the first character (ie, Instead of getting “> TEST” , I am getting “>TEST”). I tried using both Documentbuilder.InsertHTML and normal memory stream save method. But none of them seems working. I checked the generated HTML file and its rendering properly with exact formatting in my browser. The issue is only with the document save method. Please help.
Please ZIP and upload your input Word document here for testing. We will investigate the issue on our end and provide you more information.
Thanks for the reply @awais.hafeez. Please find the attached sample document. The same formatting should be applicable for docx as well.Sample Document This is a sample document.zip (5.8 KB)
I am afarid, I do not see any difference between your ‘Sample Document This is a sample document.doc’ and 18.2.doc (2.1 KB). The 18.2.doc document was generated with Aspose.Words for .NET 18.2 by using the following code:
Document doc = new Document(MyDir + @"Sample Document This is a sample document.doc");
HtmlSaveOptions opts = new HtmlSaveOptions(SaveFormat.Html);
opts.PrettyFormat = true;
opts.ExportListLabels = ExportListLabels.ByHtmlTags;
string html = doc.ToString(opts);
DocumentBuilder builder = new DocumentBuilder();
builder.InsertHtml(html);
builder.Document.Save(MyDir + @"18.2.doc");
Thanks… This saved my day
@awais.hafeez Still the docx have an issue. One extra margin space added up on the left for the docx
Please create a comparison screenshot highlighting (encircle) the problematic areas between Aspose.Words 18.2 generated 18.2.doc (see attachment in my previous post) and ‘Sample Document This is a sample document.doc’ and attach it here for our reference.