pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maruan Sahyoun <sahy...@fileaffairs.de>
Subject Re: Font size calculation from pixel to PDFBox float
Date Tue, 28 Mar 2017 08:43:14 GMT
Hi,

> Am 28.03.2017 um 10:30 schrieb Bharat Bhatt <bharatbhatt@gmail.com>:
> 
> Hi,
> 
> To set the font size in PDPageContentStream's setFont method, font size to
> be passed in float.
>        PDPageContentStream.setFont(pdFont, fontSize);
> 
> 
> I have input data as standard size in pixel (E.g. 18px)
> How to convert the pixel size to PDBBox font size, to get the same height
> as displayed in browser and PDF.
> Is there any formula is used for conversion? Or what is the basis for
> fontsize in PDFBox

font size is in points and there are 72 points to an inch. PDF doesn't use pixels because
that's device dependent.

BR Maruan



> 
> Thanks,
> Bharat


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message