What you need to get?
There is a DIV block on the web page, for example, a black rectangle. When printing, it is necessary that this block be of size A9 (+ - 1 mm). Let me remind you, the size of A9 is 37 * 52 millimeters.

What was done? I tried to set the size in pixels. Tried this conversion table: Converter
In our case, it should be in pixels approximately width = 140, height = 196.

I tried to use mm instead of pixels. For example:

.div.A9 { width: 37mm; height: 52mm; } 

In both cases, the printout is a huge difference of + -10-15 mm.

Are there any ways to get the right sizes for printing?
Tested in Chrome latest version.

UPD: Can convert data to PDF (need dimensional accuracy)? What are your options?

    2 answers 2

    Maybe it will

     <style> @media print { .divA9 { width: 37mm; height: 52mm; border: 1px solid black; } } </style> <div class="divA9"></div> 

    Another check that there is no margin, padding. I do not remember how they affect the interpretation of the width and height, but there are different models of the box (box model), which can also be changed if necessary. Also, do not forget about margins, footers and other options in the print dialog.

    The converter may not correctly calculate. Pixels on the printer most likely have a different size than on the screen of the author of the site.

    A pdf was conceived that always and everywhere printed the same and exactly. So convert.

      Decided not to bother PDF version. Here are some tips to help you print a document of a given size.

      1. Hard set the orientation of the document. Book, landscape. This reduces the flow of questions "Oh, I have it printed as a book. How to print out an album ....?"

        @page {size: portait, landscape}

      2. Remove margins when printing. Otherwise, you will not hold two A5 on one sheet.

        @page {margin: 0; }

      3. Find the right pixel-mm ratio. Print about 15 rectangles of different sizes. Measure with a ruler. My ratio was 3,557142857142857 pixels per mm. Most likely you have it.

      4. Pay attention to how your block length is considered. that is, box-sizing what you have. I have content. In this case, all padding and margin are added to the width of the block, that is, the length of the block can be longer than you specified. Consider this.

      This will help you to make the document appropriate for the size of the thread in the thread.