Ravi wrote:
I am facing an issue with printing where I have to print
receipts of a custom size. Each receipt is about 8 inch by
4inch. I am using window.print(). When a receipt is printed
another 3 receipts are flushed out of the printer. I want only
the printed receipt out of the printer. Am using a dot-matrix
printer and the receipts are in a continuation (i.e around
1000 receipts attached to one another).
I want to print only one receipt at a time. Please help me.
Its very urgent.
I think you are looking for CSS print controls:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Print vs. screen</title>
<style type="text/css" media="print">
.pagebreak { page-break-after: always; }
.onlyscreen { visibility:hidden; display:none; }
</style>
<style type="text/css" media="screen">
.onlyprint { visibility:hidden; display:none; }
</style>
</head>
<body>
<p class="pagebreak">this is page 1</p>
<p class="pagebreak">this is page 2</p>
<p>this is page 3</p>
<p class="onlyscreen">this is only screen, not printed</p>
<p class="onlyprint">this is only printed, not on screen</p>
</body>
</html>
Hope this helps,
--
Bart