Stop ejecting paper after printing content

I am a beginner programmer. I am using a dot matrix printer. When I take the print, it ejects the paper until it reaches A4 length. I just want to print only 3-6 lines. And to stop page ejection right after that. I searched for the answer, I found to use "page-break-after: always". The next div contains the print content. A.

<div class="print_bill"></div> 

css

 @media print,screen{ .print_bill { position: relative; page-break-after: always; } } 

But it was not successful. Please help me

+4
source share

All Articles