Is there anyone can help me? Thanks a lot.
On Mon, Apr 11, 2011 at 4:24 PM, Colin Cheng <colley...@gmail.com> wrote:
> Hi,
>
> When the cell with multi-row span contains long text, the table will not be
> rendered correctly. Thanks for any advice.
>
> Here is the code:
>
> this.doc = new Document(PageSize.A4);
> this.writer = PdfWriter.getInstance(doc, new
> FileOutputStream("test.pdf"));
> doc.open();
>
> PdfPTable tb = new PdfPTable(2);
> tb.setWidthPercentage(50);
> PdfPCell cell = new PdfPCell();
> StringBuilder sb = new StringBuilder();
> for(int i=0; i<50; i++) {
> sb.append("Line: ").append(i).append("\n");
> }
> cell.addElement(new Phrase(sb.toString()));
> cell.setRowspan(2);
> tb.addCell(cell);
>
> cell = new PdfPCell(new Phrase("cell 0, 1"));
> tb.addCell(cell);
> cell = new PdfPCell(new Phrase("cell 1, 1"));
> tb.addCell(cell);
> doc.add(tb);
>
> doc.close();
>
>
------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now! http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php