I am producing PDF file using itextsharp,
I am printing 2 strings leading1 & leading2.
The problem is when ever leading1 lenght increases, its effecting leading2 and its gets trimmed.
But I want to print leading1 & leading2 in next line, if no.of characters in leading1 is increased.
Basically leading2 is hardcoded as = YOU DIDIT. But leading1 is dynamic value.
So , I just want to know how to position and wrap long-text.
Here is my code...
Can anyone help me in doing this?
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()