0

I have the following code:

    void Main()
   {
       var writer = new PdfWriter(@"c:\temp\Overwrite.pdf");
            var pdf = new PdfDocument(writer);
            var document = new Document(pdf);
    
        var p = new Paragraph($"Feature: 4.2 - Release Selection and a very big welcome to the Community this has been a very good project indeed, I sure do like it. How about yourself, very big welcome to the Community, this has been a very good project indeed, I do like it. Selection and a very big welcome to the Community this has been a very good project indeed, I sure do like it. ").SetKeepWithNext(true)
                    .SetMarginTop(10)
                    .SetMarginBottom(10)
                    .SetFixedLeading(0f);
    
        document.Add(p);
        
        document.Close();
    }

But the output ends up like the following: enter image description here How can i have the text wrap to the next line without overwriting itself ?

Community
  • 1
  • 1
auburg
  • 1,373
  • 2
  • 12
  • 22

1 Answers1

0

Im not sure what this line is doing, but its causing the issue, if you comment it like i did here, your text works.

var p =
        new Paragraph(s)
        .SetKeepWithNext(true)
        .SetMarginTop(10)
        .SetMarginBottom(10);
        //SetFixedLeading(0f);
Cory Melendez
  • 224
  • 1
  • 8
  • 1
    The leading is the distance from the base of one text line to that of the next. By setting it to a fixed 0, therefore, @auburg told itext he wanted each text line to overwrite the previous one. – mkl May 06 '20 at 18:51