0

I am printing a page using a dot matrix printer by using javascript print() method and by use of @media print methods in css.

My print.css as follows:

@media print {
    html, body { 
        font-family: 'Arial', 'Helvetica',sans-serif;
        font-size: 15pt;
        margin : 0px;
    }
}
@page {
      size: 22cm 10cm;
      margin : 0px;
    }

My printable detail is very small suppose two lines of data. But after printing the printer skips the current printed page and feeding another page.

I want to avoid feeding next page and the next print should happen from the same page which is printed last.

I have tried:

@media print {
    page-break-after: avoid;
}

But not working at all.

How can I do this?

Santhucool
  • 1,656
  • 2
  • 36
  • 92

2 Answers2

0

Try the * selector css:

@media print {
  * { 
    page-break-before: avoid;
    page-break-after: avoid;
    page-break-inside: avoid;
  }
}
Dmitry Sadakov
  • 2,128
  • 3
  • 19
  • 34
-1

Try defining a page size something like

@page {
      size: 21.59cm 13.97cm;
}

should work

Tony Vincent
  • 13,354
  • 7
  • 49
  • 68