title: How to position and wrap long text into next line using itextsharp?
body: <p>I am producing PDF file using itextsharp,</p>
  
  <p>I am printing 2 strings leading1 &amp; leading2.</p>
  
  <p>The problem is when ever leading1 lenght increases, its effecting leading2 and its gets trimmed.</p>
  
  <p>But I want to print leading1 &amp; leading2 in next line, if no.of characters in leading1 is increased.</p>
  
  <p>Basically leading2  is hardcoded as = YOU DIDIT. But leading1  is dynamic value.</p>
  
  <p>So , I just want to know how to position and wrap long-text.</p>
  
  <p>Here is my code...</p>
  
  <p>Can anyone help me in doing this?</p>
  
  <pre><code>PdfContentByte cb = writer.getDirectContent();
          cb.saveState();
          cb.beginText();
          cb.setFontAndSize(baseFontMedium, 10f);
  
          // float x = 6.4392f * commonView.INCH;
          float x = 6.47f * commonView.INCH;
          float y = pageSize.getHeight() - (1.13f * commonView.INCH);
  
          cb.setCMYKColorFillF(0f, 0f, 0f, 0.77f); 
          cb.setTextMatrix(1, 0, 0, 1, x, y); 
          cb.showText(leading1);
  
          x += new Chunk(leading1, fontMedium10Pt).getWidthPoint();
  
          cb.setCMYKColorFillF(1f, 0f, 0f, 0f);
          cb.setTextMatrix(1, 0, 0, 1, x, y);
          cb.showText(leading2);
  
          cb.endText();
          cb.restoreState()
  </code></pre>