You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by SasiKanth Chandran <sa...@gmail.com> on 2011/07/13 22:08:29 UTC

Font size calculation

Hi,

How do i calculate the font size from a string based on the type of font is
selected ? Like FontMetrics in Java AWT API, Is there any API in PDFBox to
do the calculation ?

Thanks,
Sasi

Re: Font size calculation

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Am 13.07.2011 22:08, schrieb SasiKanth Chandran:
> Hi,
>
> How do i calculate the font size from a string based on the type of font is
> selected ? Like FontMetrics in Java AWT API, Is there any API in PDFBox to
> do the calculation ?
Have a look at [1]. It shows how to put some text into a pdf including some font 
height/width calculations.

> Thanks,
> Sasi


BR
Andreas Lehmkühler

[1] 
http://svn.apache.org/repos/asf/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/TextToPDF.java