# Points to Pixels Conversion

Hi, I am trying to recreate a PDF in OL Connect Designer and I am given the line spacing in points, but don’t know the equivalent amount in pixels to hard-code into the CSS code. Anyone had to do this before?

``````function fontSize_px2pt(pxVal){
pxVal = parseFloat(pxVal) * 0.75;
return Math.round(pxVal * 100) / 100;
}
function fontSize_pt2px(ptVal){
ptVal = parseFloat(ptVal) * 1.33;
return Math.round(ptVal);
}
``````

Function fontSize_px2pt() converts pixel to point with two decimal places.

Function fontSize_pt2px() converts point to pixel rounds without decimal places (pixel dont have decimal places).

These are conversions for font sizes.

If you don`t want to use functions and set the corresponding pixel values the following list can help:

``````6pt = 8px
7pt = 9px
7.5pt = 10px
8pt = 11px
9pt = 12px
10pt = 13px
10.5pt = 14px
11pt = 15px
12pt = 16px
13pt = 17px
13.5pt = 18px
14pt = 19px
14.5pt = 20px
15pt = 21px
16pt = 22px
17pt = 23px
18pt = 24px
20pt = 26px
22pt = 29px
24pt = 32px
26pt = 35px
27pt = 36px
28pt = 37px
29pt = 38px
30pt = 40px
32pt = 42px
34pt = 45px
36pt = 48px
``````

I think the original question is simply about how to specify points instead of pixels in the CSS.

You can use various units of measure in css. So for instance all of the following values are exactly the same, but using different units of measure:

``````line-height: 96px;
line-height: 72pt;
line-height: 1in,
line-height: 25.4mm
``````

There are other units available as well, just google for it.