简体   繁体   中英

Detect IE Version, take screenshot, and print screenshot automatically in javascript

I need to do a few things in one javascript solution.

  1. Must first detect the IE browser version (this I can do myself)
  2. Must use javascript to take a screenshot of the active page.
  3. Must print the screenshot that javascript just took.

I just cannot figure out how to do #'s 2 and 3. I have looked at the other articles about #2 on StackOverflow, but they all save an image, and I want to print it.

You can't take a screenshot from pure JS - you need a plugin.

Take a look here if you want some details.

Update: Apparently you can do this with canvas to some degree, so in HTML5 capable browsers, you can use pure JS with a fallback to flash in older browsers. (See here )

You cannot capture a screenshot of the browser, using JS alone. To print something, you should invoke window.print(), on the window containing the things you want printed.

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