Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window.print() only prints the "viewable" part of the screen

I've a scrollable screen and I'm having a print button on it and "window.print()" function is called on its onclick event.

My problem is it only prints the "viewable" part of the screen, not the whole screen. If a page is scrollable, the print should extend to 2(or more) pages if contents do not fit in 1 page. But in my case, it always print only 1 page and rest of contents are not printed.

like image 970
Avani Avatar asked Oct 17 '22 06:10

Avani


1 Answers

Possible duplicate of: window.print() is not printing the whole page

You basically have to add the following to your main css file

@media print {
      body, html, #wrapper {
          height: 100%;
      }
}
like image 181
Pulkit Agarwal Avatar answered Nov 02 '22 22:11

Pulkit Agarwal