I want to write this.

Last night i dreamt of San Pedro.


How can I write this with 1 PdfPCell

Edited 7 Years Ago by Xessa: n/a

Thank you. That helped me a lot. Can't we do this by creating an array of Parapraph objects?

Paragraph myParagraph = new Paragraph(3)

myParagraph.add(new Paragraph(......));
myParagraph.add(new Paragraph(......));
myParagraph.add(new Paragraph(......));

Now will there be new lines if i print out myParagraph???

Or can I also use Paragraph to print out

Last night I dreamt of San Pedro

com.lowagie.text.pdf.PdfPTable table = new PdfPTable(columns);
        PdfPTable local = new PdfPTable(1);
        PdfPCell ind = new PdfPCell(new Phrase("" + index + "."));
        ind.setBorderColor(frameColor);
        ind.setHorizontalAlignment(indexAlign);
        PdfPCell img = new PdfPCell();
        img.addElement(image);
        img.setHorizontalAlignment(Element.ALIGN_CENTER);
        img.setBorderColor(frameColor);
        PdfPCell txt = new PdfPCell(new Paragraph(text, font));
        PdfPCell txt1 = new PdfPCell(new Paragraph(...));
        PdfPCell txt2 = new PdfPCell(new Paragraph(...));
        PdfPCell txt3 = new PdfPCell(new Paragraph(...));

        txt.setBorderColor(frameColor);

        local.addCell(ind);
        local.addCell(img);
        local.addCell(txt);
        local.addCell(txt1);
        local.addCell(txt2);
        local.addCell(txt3);
 table.addCell(local);
//
        Paragraph myParagraph = new Paragraph(3);
        myParagraph.add(new Paragraph("aaaaaaaaa", font));
        myParagraph.add(new Paragraph("bbbbbbbbb", font));
        myParagraph.add(new Paragraph("cccccccccccc", font));
        PdfPCell myCell = new PdfPCell(myParagraph);
        myCell.setBorderColor(frameColor);
        local.addCell(myCell);
        //
This article has been dead for over six months. Start a new discussion instead.