I use BaseFont.getWidthPoint(String text, float fontSize) to get the width of a text string.
If the result is too wide, I reduce the font size and check again.

/Klas



Ämne:
Re: [iText-questions] Scale text to fit document width
Från:
Mykola Ivinskyi <[email protected]>
Datum:
Mon, 20 Apr 2009 04:48:46 -0400
Till:
Post all your questions about iText here <[email protected]>
Till:
Post all your questions about iText here <[email protected]>

i guess i didn't explain it well, 
text has line breaks (it's is actually formatted to look as a grid) and I need to output it into PDF with no-wrap 

thanks,
Mykola

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to