简体   繁体   中英

Javascript library to take screenshot of web page

This similar question was asked a long time a ago (4 years ago). I was wondering if there are any new advancements in the library ecosystem.

My use case is quite simple, I have a styled DIV and some elements within - I'd like to create a screenshot of that DIV.

Takes this:                                            Into this:
----------------------------                           ------------------------
<div class="potrait">
    <img src="sergio.jpg" />   --> Turns it into -->   sergio.png
    <h1>Sergio tapia</h1>
</div>

Is there anything out there that can help me achieve this?

You have two possibilities:

  1. rerender the div with a lib like html2canvas
  2. Render it on a server

Taking a real screenshot from js is not possible.

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