Hello,

I need to set the table width equal to the image that I am inserting in a 
column.


Image img = Image.getInstance( cComps.getImage(), Color.BLUE );

PdfPTable pTable = new PdfPTable( 2 );
pTable.setTotalWidth( img.scaledWidth() );

PdfPCell cell = new PdfPCell( img );
cell.setColspan( 2 );
pTable.addCell( cell );

cell = new PdfPCell( new Phrase( getNotes() ) );
cell.setColspan( 1 );
pTable.addCell( cell );      

cell = new PdfPCell( new Phrase( getDesc() ) );
cell.setColspan( 1 );
pTable.addCell( cell );

return pTable;

However, when the document is rendered, getDesc() text extends beyond image 
though the total width of the table is set to width of image and should wrap 
the text to next line.

What do I need to do so that the text is aligned with the image border and does 
not exceed beyond that.          
    



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to