window.print() is not printing the whole page

Solution 1:

you should use a separate css file for printing the page or use css3 media queries:

<link rel="stylesheet" href="css/print.css" type="text/css" media="print"/>

using percentage values its the best option when you create a css print file.

body, html, #wrapper {
    width: 100%;
}

or in your main css file:

@media print {
      body, html, #wrapper {
          width: 100%;
      }
}

Solution 2:

use

  body,html { margin-top:0%;
   display:block;
   height:100%;}

Solution 3:

using this CSS

@media print{ 
    body, html, #page-container, .scrollable-page, .ps, .panel {
        height: 100% !important;
        width: 100% !important;
        display: inline-block;
    }
}