Search code examples
cssprintingthermal-printerbarcode-printing

How to specify the length of printing document in CSS


I'm printing barcodes using a thermal printer. The size of each sticker on roll is (width: 3inch, height: 1.5inch). everything is working fine but the problem is I'm getting 3 or 4 blank stickers before the printed one. how can I set the length i.e 1.5 inches for one printout. I used the CSS below

@media print{
@page{ size: 3in 1.5in; }
}

but it printed the barcode vertically after adding this CSS. I just want my printer to stop after printing 1 sticker. I don't want it to give blank stickers.


Solution

  • Just go to control panel and set the width and height of printing document under "printing preference" option.