0

In my C# windows Form application I use below code. it works fine. but I need to add line space for this paragraph.

var linkFont = FontFactory.GetFont(FontFactory.HELVETICA, 13, iTextSharp.text.Font.UNDERLINE, BaseColor.BLUE);

List<Anchor> anchor = new List<Anchor>();
    foreach (string tName in templateName)
    {

    Anchor anch = new Anchor(tName, linkFont);
    anch.Reference = "#" + tName;
    anchor.Add(anch);
    }

Paragraph templateData = new Paragraph();
templateData.Alignment = Element.ALIGN_LEFT;

    for (int z = 0; z < anchor.Count; z++)
   {
      templateData.Add(anchor[z]);
      templateData.Add(" , ");
   }

output of this code is below. Output of above code

if I use following code nothing changed.

Paragraph templateData = new Paragraph();
templateData.Alignment = Element.ALIGN_LEFT;      
templateData .SetLeading(15, 1);  

How can I fix this issue and add line space for this paragraph ?

Thanks

morola
  • 1
  • 1
  • 1
  • It's very tempting to hammer this question down as a duplicate of [Changing text line spacing](http://stackoverflow.com/questions/21810133/changing-text-line-spacing) which is an accepted answer with 16 up-votes meaning that it works for many other developers, so it should work for you. However, I can think of two reasons why it doesn't work for you: (1.) you are using the `Paragraph` in a `PdfPCell` or `ColumnText` in *text mode*, or (2.) you aren't using an official version of iTextSharp. Please clarify: which version of iTextSharp are you using and how are you using the paragraph? – Bruno Lowagie Jun 14 '16 at 13:15

1 Answers1

0

Change value of Y in:

templateData.SetLeading(15, 10); //'1' to '10' or whatever you want
Shaharyar
  • 12,254
  • 4
  • 46
  • 66