The only way I found till now, is getting the offsetWidth, offsetHeight of a test div element with height and width of one inch: http:
div
height
width
Then you can use JQuery to send dpi_x and dpi_y this to to your server
dpi_x
dpi_y
http://jsfiddle.net/sxfv3/