logo       

Re: Retrieve rendered text length: msg#00147

java.lib.itext.general

Subject: Re: Retrieve rendered text length

BaseFont.getWidthPoint()

----- Original Message -----
From: "Thorsten Schäfer" <Newsletter@xxxxxxxxxxxxxxxxxxx>
To: <itext-questions@xxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, June 09, 2003 18:31
Subject: [iText-questions] Retrieve rendered text length


> Hi there,
>
> First of all let me thank you for such a great library. I'm using it
> more and more... ;)
> One question I have is if it's possible to get the length of a text
> rendered by itext. I'm using code like this:
> content.beginText();
> content.setFontAndSize(fontBold, 24);
> content.showTextAligned(PdfContentByte.ALIGN_LEFT, "TEST", x, y, 0);
> content.endText();
>
> Now I'm searching for a method, which tells me how long the generated
> text is (it depends obviously on the font...), so that I can use a
> abbreviation if it's too long. Does such a method exist or are there any
> hints how to implement such a method?
>
> Thanks,
>
> Thorsten
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of TotalView, The best
> thread debugger on the planet. Designed with thread debugging features
> you've never dreamed of, try TotalView 6 free at www.etnus.com.
> _______________________________________________
> iText-questions mailing list
> iText-questions@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>



-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise