in the HTML output. When this is rendered to text it results in 2 line feeds whereas the browser suppresses the second line feed due to the style attribute. I need these
to be rendered as simply
.
in the HTML output. When this is rendered to text it results in 2 line feeds whereas the browser suppresses the second line feed due to the style attribute. I need these
to be rendered as simply
.
Hi Derek,
…
tags in HTML. I think, you can post process HTML file and replace string withMy question was how can I do this with Aspose.Words. I prefer to do the processing within the RTF.
Hi Derek,
Sample files attached to original message. Thanks.
Hi Derek,
Document doc = new Document(MyDir + "SampleLineBreakIssue.rtf");
Paragraph firstParagraph = doc.FirstSection.Body.FirstParagraph;
Node[] paras = doc.GetChildNodes(NodeType.Paragraph, true).ToArray();
foreach (Paragraph para in paras)
{
if (firstParagraph == para)
continue;
if (para.GetAncestor(NodeType.Cell) != null)
{
Cell cell = ((Cell)para.GetAncestor(NodeType.Cell));
if (cell.ParentRow.IsLastRow && cell.IsLastCell && cell.LastParagraph == para)
{
Node node = para.NextPreOrder(doc);
while (node.NodeType != NodeType.Paragraph)
node = node.NextPreOrder(doc);
if (node == null)
break;
firstParagraph = (Paragraph)node;
continue;
}
firstParagraph = cell.FirstParagraph;
continue;
}
// Create a run with line break.
Run lineBreak = new Run(doc, "\v");
// Insert it at the end of the curent paregraph.
firstParagraph.AppendChild(lineBreak);
// copy content of the previouse paragraph into the cirrent.
while (para.HasChildNodes)
firstParagraph.AppendChild(para.FirstChild);
// Remove next paragraph.
para.Remove();
}
doc.Save(MyDir + "Out.html");