How to set A4 paper size in CSS?

I am using pos software developed in Laravel, where I want to edit the invoice and add a background image. The image is printing, but it won’t fit on the paper. The image is relative to A4 size. Now how can I set the paper size to A4 in the browser?

You can try the CSS below.

@page {
  size: A4;
  margin: 0;
@media print {
  html, body {
    width: 210mm;
    height: 297mm;