pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bharat Bhatt <bharatbh...@gmail.com>
Subject Re: Font size calculation from pixel to PDFBox float
Date Thu, 30 Mar 2017 04:00:42 GMT
Thanks a lot for help.

Thanks,
Bharat

On Tue, Mar 28, 2017 at 5:00 PM, Dick Martin <rtmartin@nycap.rr.com> wrote:

> This site gives a conversion chart:
> http://reeddesign.co.uk/test/points-pixels.html
>
> This site gives a formula:
> http://stackoverflow.com/questions/139655/convert-pixels-to-points
>
> I've not used either of these but the explanation seems straightforward.
>
> On Tue, Mar 28, 2017 at 4:30 AM, Bharat Bhatt <bharatbhatt@gmail.com>
> wrote:
>
> > 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
> >
> > Thanks,
> > Bharat
> >
>

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