简体   繁体   English

Chrome首次尝试时未完全加载打印预览

[英]Chrome not loading Print Preview completely on first attempt

I'm using classic javascript window.print() function that is bound to a button to print a page. 我正在使用经典的javascript window.print()函数绑定到一个按钮来打印页面。 When I use it the first time after the page loads, it loads the background and the CSS but doesn't load the text for some reason. 当我在页面加载后第一次使用它时,它会加载背景和CSS,但由于某种原因不加载文本。

When I close the Print Preview (not reloading the page) and click the button again, it loads the missing text completely. 当我关闭“打印预览”(不重新加载页面)并再次单击该按钮时,它会完全加载缺少的文本。 This only happens on Chrome, while in Firefox it loads the text on first try without any problems. 这只发生在Chrome上,而在Firefox中,它会在第一次尝试时加载文本而不会出现任何问题。

I've tried using setTimeout, and window.on('load'...) functions, but didnt help. 我已经尝试过使用setTimeout和window.on('load'...)函数,但没有帮助。 I'm using a separate CSS file for page printing. 我正在使用单独的CSS文件进行页面打印。 What can be the cause of this problem? 这个问题的原因是什么?

Had quite same issue. 有同样的问题。 (no printing on first try on windows chrome browser) (在Windows Chrome浏览器上首次尝试不打印)

Solved it by removing 通过删除解决它

@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300italic,600);

from print.css and take another font for printing. 来自print.css并采用另一种字体进行打印。

" This only happens on Chrome, while in Firefox it loads the text on first try without any problems." 这只发生在Chrome上,而在Firefox中,它首先尝试加载文本,没有任何问题。”

May be your chrome browser have some problem.. Once try re-installing the browser.. It may solve your problem... 可能是你的Chrome浏览器有一些问题..一旦尝试重新安装浏览器..它可能会解决你的问题...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM