Today to do a small print web page function, directly call Window.print (), but printed out, the font is always narrowing a number, can not find the reason ...
Later try to use an IE print control, but only support ie a little disgusting, can only return to continue to find the reason
Originally, I want to print the page because it is the elder brother pop-up layer, so appear this kind of phenomenon, later direct target= "_blank", can print normally.
Other than that
Copy Code code as follows:
Function Preview ()
{
bdhtml=window.document.body.innerhtml;
Sprnstr= "<!--startprint-->";
Eprnstr= "<!--endprint-->";
Prnhtml=bdhtml.substring (Bdhtml.indexof (SPRNSTR) +17);
Prnhtml=prnhtml.substring (0,prnhtml.indexof (EPRNSTR));
window.document.body.innerhtml=prnhtml;
Window.print ();
}
</script>
Place the <!--startprint--> and <!--endprint--> at the beginning and end of the content that needs to be printed, printing only the parts you need, not the entire page. (Look at someone else's blog Oh, hehe)