Reputation: 569
Here I am trying to get the print preview of page using button like:
<input type="button" value="Print in javascript" onclick="window.print();"/>
It is working in seome percentage. But I am not getting 100% print preview, it drops some content while prieviwing.
Is there any thing which I am not doing correctly?
Upvotes: 0
Views: 82
Reputation: 1896
Have you tried to put everything you want to print in a media query in CSS:
@media print {
.myDivToPrint {
background-color: white;
height: 100%;
width: 100%;
position: fixed;
top: 0;
left: 0;
margin: 0;
padding: 15px;
font-size: 14px;
line-height: 18px;
}
}
Upvotes: 2