I spent a week chasing a bug that turned out not to be a bug in my code.
A packing slip generated in the browser looked correct in the print preview on my machine. A seller printed the same slip on a 4Γ6 thermal printer and got text that was readable but slightly small, with the bottom row of items clipped. Same HTML, same CSS, different result.
The cause was not the CSS. It was the chain of four places where "4Γ6" gets decided, and only one of them is under my control.
The four places a page size is set
CSS β @page { size: 4in 6in; margin: 0; }
The browser print dialog β paper size dropdown and scale ( Fit to page vs 100% )
The printer driver β the paper size the driver believes is loaded
The physical roll β 4Γ6 in, with a non-printable dead zone at the edges
If any of the four disagrees, the browser silently scales the content to fit whatever it thinks the paper is. Nothing errors.β¦