I put the html for print in a div with class forPrint which is in a material dialog page and call the window.print() when the print button is clicked in the angular component.
However, it shows/prints only the page in the current screen and the rest is cut off when the button is clicked.
How to print the whole content in the div with class forPrint?
I think the reason is material dialog because when I print something in a normal page it works fine.
CSS:
@media print {
/deep/ body * { visibility: hidden; }
/deep/ .forPrint * { visibility: visible; display:block;}
/deep/ .forPrint { display:block;position: absolute; top: 40px; left: 30px; }
}
position: absolute;and only supplying top/left ... addbottom:40px; right:30px;(I'm assuming you've done the above to add margins to the printed document)