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

Free Support Forum - aspose.com

Line spacing in paragraph within a table cell

We have recently upgraded aspose.pdf.dll from 4.1 to 4.6.0 for one of the image issue. But this has introduced a new defect.
An extra space is getting added between the lines whenever there is bulleted paragrapgh in a table cell.
We have not done any changes to our code which could be related to line spacing in the paragraph.

Could you please let us know what is the change in any of the DLL released after 4.1.0. where in there are changes made related to paragraph line spacing.



Hello Praveen,

I have tried reproducing the issue at my end but I am afraid I am unable to notice it. Can you please share the code snippet so that we can test the scenario at our end. We apologize for your inconvenience.

We are looking for the information, what is the change that has been done related to the line spacing when the paragraph has bulleted text. Since, we just upgraded the aspose.pdf.DLL from 4.1 to 4.6. So we want to check what is the default line spacing set for a PDF. and How aspose.pdf behaves in case of the bulleted paragraph about the line spacing. Can you please describe more about this?

It is difficult the share the code as we are not sure what is causing the issue. Still we will keep trying and share code if we figure out something from our end.


Hello Praveen,

There have been several release versions between 4.1.0 and 4.6.0 and there have been many issues fixed and new features introduced in between these versions. So I am afraid I might not be entirely certain about the change in our product that might have caused this problem. The default line spacing between text paragraphs is one line.

Can you please take a look over the attached code snippet and see if you can use it to reproduce the problem ? I am also attaching the resultant PDF that I have generated using Aspose.Pdf for .NET 4.6.0.

We apologize for your inconvenience.

Thanks for reply,

I am not able to reproduce the issue seperatily, However, i could identify that the issue did not come when I changed the font to a non-unicode font. in our application font is not fixed it decided depending on the server response.

Please find the code below.

Pdf pdf1 = new Pdf();
Aspose.Pdf.Section sec1 = pdf1.Sections.Add();
Text text1 = new Text(sec1);
//text1.Margin.Bottom = 15;
//text1.TextInfo.LineSpacing = 3;
Segment segment1 = new Segment();
segment1.Content = “\n \n\nRNS Number : 3548R \nLegal & General Protected Inv PLC \n19 August 2010 \n \n? \nNOTES TO THE FINANCIAL STATEMENTS \n \n1 Investments at fair value \n Investments are stated at fair value, in accordance with the accounting \npolicies on pages 21 to 32. The net cost of investments excluding deposits is as \n shown below: \n\n”;
segment1.TextInfo.FontSize = 9;
segment1.TextInfo.FontName = “Courier new”;
segment1.TextInfo.IsUnicode = true;
//Instantiate a table object
Aspose.Pdf.Table tab1 = new Aspose.Pdf.Table();
//Add the table in paragraphs collection of the desired section
//Set with column widths of the table
tab1.ColumnWidths = “100%”;
//Set default cell border using BorderInfo object
//tab1.DefaultCellBorder = new BorderInfo((int)BorderSide.All, 0.1F);
//Set table border using another customized BorderInfo object
// tab1.Border = new BorderInfo((int)BorderSide.All, 1F);
//Create MarginInfo object and set its left, bottom, right and top margins
MarginInfo margin = new MarginInfo();
margin.Top = 5f;
margin.Left = 5f;
margin.Right = 5f;
margin.Bottom = 5f;
//Set the default cell padding to the MarginInfo object
// tab1.DefaultCellPadding = margin;
//Create rows in the table and then cells in the rows
Aspose.Pdf.Row row1 = tab1.Rows.Add();
row1.Cells[0].Paragraphs.Add(new Text(" "));
Text text2 = new Text(sec1);
//text1.Margin.Bottom = 15;
//text1.TextInfo.LineSpacing = 3;
Segment segment2 = new Segment();
segment2.Content = "\n \n* Capital Protection Plus terminated on 05 JANuary 2009, Capital \nPlus II terminated on 3 March 2010, terminated on 21 \nApril 2010 and Protected Investments I terminated on 23 December 2009. The \nfinancial statements for these 4 sub funds have therefore been prepared on a \ntermination basis. \n \n \n \n \nNOTES TO THE FINANCIAL STATEMENTS - continued \n \n2 Debtors - 2010 - continued \n \n “;
segment2.TextInfo.FontSize = 9;
segment2.TextInfo.FontName = “Courier new”;
segment2.TextInfo.IsUnicode = true;
Aspose.Pdf.Row row2 = tab1.Rows.Add();
row2.Cells[0].Paragraphs.Add(new Text(” "));

Hello Praveen,

Thanks for the code snippet.

I have tested the scenario and I am still unable to notice the problem. I have tried generating the PDF document while using one of the Unicode fonts (Devanagari New) and also have generated a document while using Courier New font. In both the cases, the spaces between lines seem to be identical. I have tested the issue with Aspose.Pdf for .NET 4.1.0 and with Aspose.Pdf for .NET 4.6.0.

Please take a look over the resultant PDF's that I have generated. I have also attached the font file that I have used for the testing purpose. I am afraid until or unless we are able to reproduce the issue at our end, we might not be able to figure out the exact reasons of this problem. Therefore, we might not be able to get this issue resolved. We apologize for your inconvenience.