public override VisitorAction VisitParagraphEnd(Paragraph paragraph)
{
if (IsCompositeAcrossPage(paragraph))
{
foreach (Paragraph clonePara in SplitComposite(paragraph))
{
// Remove list numbering from the cloned paragraph but leave the indent the same
// As the paragraph is supposed to be part of the item before.
if (paragraph.IsListItem)
{
double textPosition = clonePara.ListFormat.ListLevel.TextPosition;
clonePara.ListFormat.RemoveNumbers();
clonePara.ParagraphFormat.LeftIndent = textPosition;
}
// Reset spacing of split paragraphs as additional spacing is removed.
clonePara.ParagraphFormat.SpaceBefore = 0;
paragraph.ParagraphFormat.SpaceAfter = 0;
}
}
return VisitorAction.Continue;
}