Hello.. I know that height()
method of jquery returns a number unitless...
How can i be sure that this number is in the unit i want?
I want to work with centimeter cm any ideas?
Hello.. I know that height()
method of jquery returns a number unitless...
How can i be sure that this number is in the unit i want?
I want to work with centimeter cm any ideas?
the unit returned by height() is pixels.
converting that to cm might be difficult, as that depends on the user's monitor, size of pixels, etc.
question, why in gods name do you want cm?
height returns height in pixels. Unfortunately centimeters is going to be very difficult for you to work with. Monitors all have different pixel densities, and javascript does not have a way to know this pixel density. You'll have to estimate how many pixels average a centimeter and convert from there.
Average pixel density would have anywhere from 100-130px in a centimeter, as you can tell this is a pretty wide range.
I would like to do this only for a reports page in order to generate some pages A4... I would like to go to a new page (css page break) if it exceeds some cm...