Chrome在第一次尝试时没有完全加载打印预览 [英] Chrome not loading Print Preview completely on first attempt

查看:310
本文介绍了Chrome在第一次尝试时没有完全加载打印预览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的经典JavaScript window.print()函数绑定到一个按钮来打印页面。当我在页面加载后第一次使用它时,它会加载背景和CSS,但由于某种原因不加载文本。

I'm using classic javascript window.print() function that is bound to a button to print a page. 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.

当我关闭Print预览(不重新加载页面)并再次单击该按钮,它会完全加载缺失的文本。这只发生在Chrome上,而在Firefox中,它会在第一次尝试时加载文本而不会有任何问题。

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.

我试过使用setTimeout和window.on('load' ...)功能,但没有帮助。
我使用单独的CSS文件进行页面打印。这个问题的原因是什么?

I've tried using setTimeout, and window.on('load'...) functions, but didnt help. I'm using a separate CSS file for page printing. What can be the cause of this problem?

推荐答案

有相同的问题。 (在第一次尝试在Windows Chrome浏览器上不打印)

Had quite same issue. (no printing on first try on windows chrome browser)

通过移除解决它

Solved it by removing

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

来自print.css,并以另一种字体打印。

from print.css and take another font for printing.

这篇关于Chrome在第一次尝试时没有完全加载打印预览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆