I'm printing an HTML receipt via javascript:window.print()
Printing it to an Inkjet Printer makes everything all good. However on DOT-MATRIX Printer, Epson LX-300+II everything is different. It doesn't fit right, the texts are not aligned. I tried saving it to PDF and printing the PDF from Adobe Reader, the orientation seemed to be all good.
I already set the page size and tried resizing the fonts, but still I can't print it correctly. The Receipt's size, by the way, is 8.5 x 5.5in.
I tried formulating the CSS, but failed to get the correct result. This is the CSS:
@media print {
html, body {
width: 8.5in;
height: 5.5in;
display: block;
font-family: "Calibri";
font-size: auto;
}
@page
{
size: 5.5in 8.5in;
}
}
Also whenever I tried adding @page { size: 8.5in 5.5in.; size: Portrait; }
the printed paper is on landscape.
How can I set things right?
EDIT: I tried
@page {
size: 5.5in 8.5in;
}
but it's printing the page on Landscape...
@media print{ /*hide what you don't need/clutter*/ }
and add this where it is needed as a "print.css" file – Mcfarlane8.5in
with5.5in
, as Leroy said - a width of 8.5 inches and a height of 5.5 inches is landscape – Mcfarlanesize: width height
? – Meenen