We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Controlling line spacing between content in aspose word document

How can i controll line spacing between contents on Aspose word document.See the sample code as well as sample document below.
In the sample attachment we want to coontrol line spacing between content show in highlighted yellow.
See the sample code we are using and see the red section.This string builder is using doeumentbuilder object.
private string GetPracticeHtml(List FolderContentList)
{
StringBuilder strPartice = new StringBuilder();
int i = 0;
if (FolderContentList != null && FolderContentList.Count > 0)
{
strPartice.Append(“

Practice Area
”);

foreach (FolderContent foldContent in FolderContentList)
{
EktronHelper.SortList<Wilmerhale.Common.Content>(foldContent.ContentList, “ContentTitle”, SortDirection.Ascending);
foreach (Wilmerhale.Common.Content content in foldContent.ContentList)
{
i += 1;
//strPartice.Append("" + content.ContentTitle + “”);

strPartice.Append("
");
strPartice.Append(content.ContentTitle); — Need to control line spacing here.
strPartice.Append("
");
// strPartice.Append("
");
//strPartice.Append("
    ");
    // strPartice.Append("<div style='font-size:10px;font-family:Arial;margin:0 0 0 0>");

    FolderContent folderContent = foldContent.FolderList.Find(delegate(FolderContent fContent) { return fContent.FolderID == content.ChildFolderID; });
    if (folderContent != null)
    {
    strPartice.Append(GetContentHtml(folderContent, ref strPartice, 1));
    }
    // strPartice.Append("");
    //strPartice.Append("
");
}
}
}
return strPartice.ToString();
}



Hi,


Thanks for your inquiry. I believe, PageSetup class is what you’re looking for. PageSetup object contains all the page setup attributes of a section (left margin, bottom margin, paper size, and so on) as properties.

Best Regards,
<br>Hi,<br>   We are running into issue while setting documentBuilder.ParagraphFormat.SpaceBefore and documentBuilder.ParagraphFormat.SpaceAfter in aspose document.Whatever we are setting here is being overwritten in the document...In the mainbiodetails mentioned below content is cuming out with lots of p tags we need to set space before and after that we require support on this urgently....See the attached file for reference................  <br><br><br>documentBuilder.InsertHtml("<strong><span style='font-size:13px;font-family:Times New Roman'>Biography</span></strong>");<br>                                            documentBuilder.ParagraphFormat.ClearFormatting();<br>                                             documentBuilder.ParagraphFormat.SpaceAfterAuto = false;<br>                                            documentBuilder.ParagraphFormat.SpaceBeforeAuto = false;<br>                                            documentBuilder.ParagraphFormat.SpaceBefore = 12;<br>                                            documentBuilder.ParagraphFormat.SpaceAfter = 0;<br>                                            documentBuilder.InsertHtml(<font color="#FFA500">mainBioDetails</font>);

Hi,


Thanks for your inquiry. Please note that, when you insert content by using InsertHTML method, whole formatting is taken from HTML snippet. In this case, Aspose.Words does not inherit formatting specified in DocumentBuilder options. I think, the workaround suggested in this post might be helpful to you in this situation.

Please let me know if I can be of any further assistance.

Best Regards,