2

I am going to print from the browser to a receipt printer. I want to support 58mm --> full size paper using responsive design. I used: http://www.unitconversion.org/typography/pixels-x-to-millimeters-conversion.html and it says 58 mm is approx. 219 pixels.

Is this an accurate way to measure pixels in the browser?

Neil S3ntence
  • 198
  • 2
  • 19
Chris Muench
  • 17,444
  • 70
  • 209
  • 362

1 Answers1

2

That converter is misleading - it can produce only approximations (or at the very best, results that work for your specific display), but never generally accurate results.

The number of pixels per mm (or any other physical unit) will vary from display to display, as different displays will have a different number of differently sized pixels. See "Pixel Density" in Wikipedia.

You can specify physical measures in CSS and when printing they should come out OK if the browser and the printer driver are handling things right:

.mysheet { width: 19.2cm; height: 8cm; }

Some Browser/OS/display combinations (I don't know which protocols do this) apparently also can interpret physical measures and render them in their correct size on screen.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088