Search code examples
fontsgoogle-apps-scriptstylespixel

Google Docs: What is the conversion from points to pixels?


In the Google Apps Script documentation, it vaguely refers to points multiple times, for instance here, to refer to dimensions of the page. A quick Google search turned up that this conversion depends on many factors, including font size. So what does this number really mean, and can I convert it to pixels in the code?

Here is a sample from the link above:

getPageHeight()

Retrieves the page height, in points.

Returns:

Number — the page height, in points

getPageWidth()

Retrieves the page width, in points.

Returns:

Number — the page width, in points


Solution

  • 1 px = 1/96 in, 1 pt = 1/72 in, 1 px = 3/4 pt.

    EM, PX, PT, CM, IN…