There sure is. If you set up a ColumnText, then call .go(true), it'll
run in "simulated" mode, and won't actually draw anything. You can then
call getYLine() to see where the text ended.
--Mark Storer
Senior Software Engineer
Cardiff.com
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
Autonomy Corp., an HP Company
________________________________
From: Costa Basil [mailto:[email protected]]
Sent: Wednesday, October 12, 2011 11:02 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] shrink text to fit rectangle
Thank you. This looks like exactly what I am looking for.
One more question, is there a way for a given text to find
compute the size of the rectangle that would fit the text, assuming some
horizontal constraints (let's say the width can't go beyond a certain
value).
Thank you again.
________________________________
From: Mark Storer <[email protected]>
To: Costa Basil <[email protected]>; Post all your questions
about iText here <[email protected]>
Sent: Wednesday, October 12, 2011 10:55:18 AM
Subject: RE: [iText-questions] shrink text to fit rectangle
There's some code in iText that does precisely this. Look in
the TextField source
<http://itext.svn.sourceforge.net/viewvc/itext/trunk/itext/src/main/java
/com/itextpdf/text/pdf/TextField.java?revision=4784&view=markup> for
appearance generation when the font size is set to zero, starting on
line 213 for multiline text, or on 247 for single-line text.
--Mark Storer
Senior Software Engineer
Cardiff.com
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
Autonomy Corp., an HP Company
________________________________
From: Costa Basil [mailto:[email protected]]
Sent: Wednesday, October 12, 2011 10:39 AM
To: [email protected]
Subject: [iText-questions] shrink text to fit rectangle
What is the best way to shrink a text to fit a given
rectangle on a page?
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
iText-questions mailing list
[email protected]
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