Programmatically determine DPI via the browser?

后端 未结 4 781
情话喂你
情话喂你 2021-02-12 16:24

I would like to programmaticaly determine the DPI of a user\'s display in order to show a web page at a precise number of units (centimeters/inches). I know it a weird request:

4条回答
  •  别跟我提以往
    2021-02-12 16:38

    You can't. DPI is a function of the pixel resolution of the screen and the physical dimensions of the display. The latter is not available in any browser interface I am aware of.

提交回复
热议问题