We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

AppendHTML puts gap between P and UL

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

6 Replies

AL Andrew Lansdowne August 26, 2009 08:23 AM UTC

Forgot to attach the screenshot.



extra paragraph_2b849ac3.JPG


VS Vijayakumar S Syncfusion Team August 26, 2009 09:40 AM UTC

Hi Andrew,

Thank you for using Syncfusion products.

We were able to see the mentioned issue. But this issue has been fixed in our latest source. Could you please try running it with our next forth-coming development build which will be published on 31st August 2009 in the below link.

Development build link:
http://www.syncfusion.com/downloads/development-builds

Please let us know if you have any questions.

Regards,
Vijay


AL Andrew Lansdowne August 26, 2009 01:43 PM UTC

Hi
Thanks for this.

A related note, if I insert the above HTML using paragraph Append HTML, it seems to lose the formatting that i've applied to the Normal style in the document template. Is that expected?

I've been applying the Normal style after doing append HTML but it's prooving tricky to apply it to ALL the paragraphs created by an AppendHTML call.

Thanks


VS Vijayakumar S Syncfusion Team August 27, 2009 02:51 PM UTC

Hi Andrew,

Thank you for posting your query.

We were able to reproduce the mentioned issue of preserving styles while appending html contents. We suspect this could be a defect. We have forwarded this issue to our development team for further analysis.

Once the html contents are imported into word document, we are not able to differentiate or find the paragraph that are inserted by AppendHtml() method.

Could you please report this issue through Direct Trac Developer Support System https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. Thank you for your participation in Syncfusion’s Community Forums”.

Please let us know if you have any questions.

Regards,
Vijay


AL Andrew Lansdowne September 2, 2009 11:24 AM UTC

FYI I have figured this one out. The AppendHTML creates more paragraphs after the paragraph you Append on, if the HTML contains more than one paragraph. The paragraphs inserted are set to style Normal (Web) which is hidden by default in word 2007 even if it's in use. So to set the style on these in a document template just modify the Normal (Web) builtin style.

Thanks


VS Vijayakumar S Syncfusion Team September 11, 2009 10:50 AM UTC

Hi Andrew,

Thank you for your update.

Yes, the paragraphs that are inserted through AppendHTML method are set to Normal (Web) style. While using Normal (Web) builtin style to update the style of the paragraphs inserted through html, please aware of that any other elements [not inserted through AppendHTML] with style [Normal (Web)] also gets modified.

Please let us know if you have any questions.

Regards,
Vijay

Loader.
Live Chat Icon For mobile
Up arrow icon