My printer default size is A4,and I need to print payslip in size 8.5inx5.5in using the old dot matrix printer.
I tried to set every payslip DIV
in a fixed height,
width: 175.6mm;
height:123.7mm;
margin-left:auto;
margin-right:auto;
Although it fit the payslip size perfectly,but after printed,the paper will keep rolling until end of it because payslip paper are all joined unlike A4. And I do not wish to make any changes to printer paper size,so I set:
@media print
{
@page
{
size: 8.5in 5.5in;
size: portrait;
}
}
but the print preview of Google Chrome still showing this:
Actually is it possible to do so?Or is there any way to force printer stop printing after payslip printed to prevent it from keep rolling the paper?(which I think should be not possible)
P.S. I am using Google Chrome only.
**Updated:
I noticed the paper size will change after I choose to "Save as PDF",if I choose back my default printer,the paper size is incorrect again.
Just change min-height: 297mm into max-height: 296mm; in the . page class. This will sort the double page issue.
Click Start, point to Settings, and the click Printers. Right-click the appropriate printer, and then click Properties. Click the Paper tab, and then click the paper size you want to use in the Paper Size box. Click OK, and then close the Printers folder.
You can use CSS to change the appearance of your web page when it's printed on a paper. You can specify one font for the screen version and another for the print version. You have seen @media rule in previous chapters.
maybe this work.
@media print
{
@page
{
size: 8.5in 5.5in;
size: landscape;
}
}
or
@media print
{
@page
{
size: 5.5in 8.5in ;
size: landscape;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With