Today I want to make a small function to print a web page. I call window.print() directly. However, after printing, the font size is always reduced by one size. I can't find the reason. . .
Later I tried to use an IE print control, but it was a bit disgusting to only support IE, so I had to go back and continue to find the reason
It turned out that the page I wanted to print appeared because of the pop-up layer. This phenomenon can be printed normally if you directly target="_blank" later.
In addition,
function preview()
{
bdhtml=window.document.body.innerHTML;
sprnstr="";
eprnstr=" and Place it at the beginning and end of the content that needs to be printed, and only the required part will be printed, not the entire page. (I was reading someone else’s blog, hehe)
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn