1

I'm trying to print a receipt using PrintJS, however, I can't seem to be able to print a receipt that ends after the data end, instead, it acts as A4 paper.

      printJS({
        printable: "printable",
        type: "html",
        targetStyles: "*",
        style: `@page { margin: 0mm; size: 80m 80m; } @media print { body { margin: 0mm; width: 80mm; height: 80mm } }`,
      });

This is what the element looks like.

enter image description here

This is what the paper is printed like(which is essentially an A4 paper).

enter image description here

This is the height of the paper regardless of size/height I set by the way, the width adapts okay but the height just simply refuses to change.

Alitron
  • 108
  • 2
  • 8

0 Answers0