Convert millimeters or inches to pixels at a stated DPI and export an exact-size JPEG in the browser with Canvas.