Hi,
if I import HTML source having nested ul listpoints words listpoints are not well rendered, because there are placeholders like a break between listpoints.
I attached HTML source and resulting word (bad rendering is marked with yellow background color).
Here is my code:
Aspose.Words.Document doc = new Aspose.Words.Document();
DocumentBuilder db = new DocumentBuilder(doc);
db.InsertHtml(File.ReadAllText(@“xxxxxxx”));
doc.Save(@“xxxxx”, SaveFormat.Docx);
Is this a bug or do you know any workaround?
I used newest version of Aspose.Words.
Thanks and greetings.
Christian
Hi Christian,
Thanks for your query. Please use the latest version of Aspose.Words for .NET 11.0.0. I have not found the mentioned issue by using latest version of Aspose.Word for .NET. Please find the generated output file in attachment.
Hi,
problem is not the yellow color, this was my marking of the problem.
I attached problems as png (and they are in your docx file too).
There are non-expected line breaks. I do not expect these line breaks.
Greetings
Christian
Hi Christian,
The problem occurs because auto-spacing of paragraphs. Your request has been
linked to the appropriate issue. You will be notified as soon as it is resolved.
As a workaround, you can reset auto-spacing of all paragraphs in the document before saving, as shown below:
Document doc = new Document();
DocumentBuilder db = new DocumentBuilder(doc);
db.InsertHtml(File.ReadAllText(MyDir + "HtmlFile.html"));
// Loop through all paragraphs and reset auto spacing.
NodeCollection paragraphs = doc.GetChildNodes(NodeType.Paragraph, true);
foreach (Paragraph paragraph in paragraphs)
{
paragraph.ParagraphFormat.SpaceAfterAuto = false;
paragraph.ParagraphFormat.SpaceAfter = 0;
}
doc.Save(MyDir + "out.docx");
Thanks a lot. Workaround is working fine.
Greetings
Christian
The issues you have found earlier (filed as WORDSNET-2104) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(15)