2

Is anyone aware of the formula google docs use to convert pixels to inches?

Right click on a cell and click table properties then you get the image below, note I have opened up firebug and you can clearly see each td is set with a px width. I can work with inches or mm or equivalent for printing to pdf but pixels is not so accurate.

This is all done on client side hence the javascript tag...

enter image description here

Rubén
  • 34,714
  • 9
  • 70
  • 166
Haroon
  • 3,402
  • 6
  • 43
  • 74

2 Answers2

5

Haroon, I'm not sure what you're trying to do, but PC displays are generally 96DPI and I think google have emulated this with the zoom level they have set in their documents webapp.

We can confirm it's close, by taking a screenshot of googledocs and pasting it into paint, and then measuring the document width.

I got 796 pixels from my select tool in paint. I am using A4 portrait pages that are 210mm wide. This means we can do 796/210 to get our pixel density.

1 millimetre = 3.79 pixels

multiply by 2.54

1 inch = 96 pixels

I don't know if this will remain consistent with other monitor resolutions or paper sizes, but I would expect it would be close!

jon
  • 5,986
  • 5
  • 28
  • 35
  • I am trying to get a decent/ reasonable accurate table/layout going for my cms, I need to print off my page inside a PDF Renderer, as the PDF renderers dont work too well with pixels I wanted to get a good/ accurate measurement, I am going to experiment with your suggestions later on, thank you – Haroon Apr 19 '12 at 14:38
  • thanks, sorry I took so long to get back I found out that it indeed is 96 DPI, I looked at the margins set by google docs, I set the margin to 1inch and inside the document I found it to be 96 pixels! :) – Haroon Apr 27 '12 at 22:55
1

Old question and the same old answer but from a different source. I've been trying to get images to display the "correct" size when they have been inserted into a google document. They always were too small. So I inserted one of known size and printed it and manually checked the size. From those dimensions I can confirm that Google does indeed use 96 DPI.

  • The 96 DPI must not be universal, or maybe it's dependent on page size. On a slide I'm using, it is only 72 DPI. – Trashman Jan 31 '22 at 19:27