pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bharat Bhatt <bharatbh...@gmail.com>
Subject Font size calculation from pixel to PDFBox float
Date Tue, 28 Mar 2017 08:30:54 GMT

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


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message