Window.print () does not print the entire page

I have a page screenShot

I want to print this page. On the print button, I use something like this

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

But the problem is that this is not printing the entire page. As if it is only a seal that is currently in view. When I click on the print button, a page is printed before Email: tahir@7-cs.com . It does not print text under the scroll bar.

textBelowScrollbar

How to print all text. For example, I have a very large page, and I use tabs to place my page. And when you click the Print button, I want to turn on the whole page, including the tabs. How can I do it?

thanks

+6
source share
3 answers

you must use a separate css file to print the page or use css3 media queries:

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

using percentage values, this is the best option when creating a css print file.

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

or in your main css file:

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

use

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

Try using CSS print stylesheets, look at google for a few examples .

What is the reason that it does not actually print the entire page, I assume that there is no option in the print dialog that indicates how printing will be performed.

0
source

Source: https://habr.com/ru/post/917153/


All Articles