Google Docs Pixels to Inches

蹲街弑〆低调 提交于 2019-12-24 00:36:29

问题


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...


回答1:


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!




回答2:


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.



来源:https://stackoverflow.com/questions/10229109/google-docs-pixels-to-inches

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!