Ads Inside Post

Search in This Blog

Paragraph overlapping problem in itextsharp

Problem:

If you are working with itextSharp in Dot net winform C# or VB.net then you are very familiar with Paragraph. if  Paragraph font size is big then the Paragraph text will overlap as below example image.

Paragraph overlapping problem in itextsharp
Paragraph overlapping problem in itextsharp


So  how to overcome this problem?

Solution: 

To overcome paragraph text overlapping problem in itextsharp you will use  Paragraph SpacingAfter property.

Example:

Use below C# code, you can convert it into VB.net code if you are working in VB.net.

Paragraph para= new Paragraph("This is a test");
para.Alignment = Element.ALIGN_CENTER;
para.SpacingAfter=50f;
doc.Add(para);