Hi,

     I am trying to use the PdfCell Object to calculate the number of Lines
used by the Cell, before rendering to the Document. I am using the below
code to find this. But some how the number of Lines in the Cell does is not
accurately given by the size() method in PdfCell. I am using the Width of
the Cell Object in the PdfCell Constructor. Pl. let me know where I am
wrong.

     .................

     Table table = new Table(2);
     float[] widths = {10f, 15f};
     table.setWidths(widths);
     Cell cell = new Cell(new Phrase("This is a Test Message to find the
number of Lines used by the Cell",
FontFactory.getFont(FontFactory.HELVETICA, 10, Font.NORMAL)));

     PdfCell pc = new PdfCell(cell, 1, 1f, 20f, 1f, 0f, 0f);
     System.out.println("Lines inside Cell : " + pc.size());

     table.addCell(cell);
     table.addCell(cell);

     .................

Thanks in advance.

Thanks
Sarathy



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to