I have created 2 paragraphs and added them to paragraph3 this way,
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("NextLineTextPDF.pdf"));
document.open();
PdfContentByte cb = writer.getDirectContent();
cb.beginText();
BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
Font grey = new Font(bf,12f,0,Color.gray);
Chunk blueText = new Chunk(leading1, grey);
Font blue = new Font(bf,12f,0,Color.BLUE);
Chunk greenText = new Chunk(leading2, blue);
Paragraph p1 = new Paragraph(blueText);
Paragraph p2 = new Paragraph(greenText);
Paragraph p3 = new Paragraph();
p3.add(blueText);
p3.add(greenText);
document.add(p3);
cb.endText();
But the problem is, if the string inside paragraph3 is is lenghty, characters are trimmed and the string is nor wrapped.
Is there any way, so that I can enclose my Paragraph3 into a recctangle , to wrap my string, without trimming?