Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window.print() is not printing the whole page

I have a page screenShot

I want to print this page. On print button i am using something like this

<input id="print" type="submit" onclick="window.print();" />

But the problem is it is not printing the whole page. Like it only print that is currently in the view. When i click on the print button then till Email:[email protected] page print. It does not print the text below the scrollbar.

textBelowScrollbar

How can i print the whole text. Like suppose i have a very big page and i am using tabs to accommodate my page. And when click on print button, then i want to include the whole page including tabs. How can i do it?

Thanks

like image 604
Basit Avatar asked Jun 01 '12 06:06

Basit


People also ask

Why won't my printer print the full page?

Start by choosing "File" and then "Print," and clicking the "Position and Size" settings. Usually, the default option is "Scale to Fit Media," which prints to the page margins. Deselect it, then manually enter scale, height and width values that equal the full size of your paper.

How do I print a full page window?

2. Press Ctrl + A 3. Right click on the page and left click on “Print” 4. Press the “Print” button.

Why does my printer print only half a page?

The paper size and orientation settings must match the paper you're using in your printer. Besides that, check that the paper is completely blank before printing. Low ink levels and a problematic printer driver or connection can cause the same problems, as the printer can't complete the job after finishing half a page.


3 Answers

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%;
      }
}
like image 68
undefined Avatar answered Oct 17 '22 21:10

undefined


use

  body,html { margin-top:0%;
   display:block;
   height:100%;}
like image 38
Kariuki James Avatar answered Oct 17 '22 21:10

Kariuki James


using this CSS

@media print{ 
    body, html, #page-container, .scrollable-page, .ps, .panel {
        height: 100% !important;
        width: 100% !important;
        display: inline-block;
    }
}
like image 2
Tarek Hassan Avatar answered Oct 17 '22 19:10

Tarek Hassan