简体   繁体   中英

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. 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.

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.

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?

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);

from print.css and take another font for printing.

" This only happens on Chrome, while in Firefox it loads the text on first try without any problems."

May be your chrome browser have some problem.. Once try re-installing the browser.. It may solve your problem...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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