In your HTML page, you can set up the printer specific style sheet by specifying media="print"
media="print"
>
In order to specify the print page size to Letter size and set the proper margins, use the CSS @page rule:
@page
{
width: 8.5in; height: 11in; /* Letter page size is 8.5 inch X 11 inch */
margin: 0.75in 0.18in 0.75in 0.18in; /* this affects the margin in the printer settings */
}
If you want to set your print layout to landscape, use following @page rule
@page
{
-webkit-transform: rotate(-90deg); -moz-transform:rotate(-90deg);
filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
size: landscape;
width: 8.5in; height: 11in; /* Letter page size is 8.5 inch X 11 inch */
margin: 0.75in 0.18in 0.75in 0.18in; /* this affects the margin in the printer settings */
}
Comments