0

I want to write this.

Last night i dreamt of San Pedro.


How can I write this with 1 PdfPCell

Edited by Xessa: n/a

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by quuba
0

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

0
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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.