Directly call Window.print (), but after printing, the font is always reduced by a number, and then directly target= "_blank", you can print, the following is the implementation of the Code
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 to support ie a little disgusting, can only go back to find the reason for the original, I want to print the page because it is the elder brother pop-up layer, so this phenomenon, and then directly target= "_blank", you can normally print. In addition, the code is 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 <!--startprint--> and <!--endprint--> at the beginning and end of the content you want to print, print only the parts you need, not the entire page. (Look at someone else's blog Oh, hehe)