I have just upgraded to version 7.302.0.20 as it fixes a bug with the hanging indent on lists imported from HTML. This has been fixed but now a different problem is showing up - There is an empty paragraph added above my list. This did not happen in the previous version I used which was 7.202.0.37.
Here is a sample of the HTML i'm adding:
peifnapei fnaep finspefinspefi nspei
- srounsoerf nsoeu fbsoeugbsoeugbsoegu
- dsf sopdi fnsodu gbsogubsoru gbsorug
slugbs9ogbsorgbsorgbusoru sr gsrg sr
I have tried both adding to the Section.Body.InsertHTML (by adding etc) as well as AppendHTML on a paragraph with just the above. I have made a test case as well, which when run using the old version presents broken list indent but no extra paragraph:
WordDocument WordDocument = new WordDocument();
IWSection section = WordDocument.AddSection();
section.AddParagraph();
WordDocument.LastSection.Body.InsertXHTML(@"
test peifnapei fnaep finspefinspefi nspei
- srounsoerf nsoeu fbsoeugbsoeugbsoegu
- dsf sopdi fnsodu gbsogubsoru gbsorug
slugbs9ogbsorgbsorgbusoru sr gsrg sr
");
WordDocument.Save("test.doc", FormatType.Doc, System.Web.HttpContext.Current.Response, HttpContentDisposition.InBrowser);
WordDocument.Close();
WordDocument = null;
I attach a screenshot. I am considering looping the paragraph(s) after adding the HTML and removing any blank lines..
Thanks
Andy