Javascript库采取网页截图 [英] Javascript library to take screenshot of web page

查看:131
本文介绍了Javascript库采取网页截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个类似的问题被问了很长一段时间前(4年前)。我想知道在图书馆生态系统中是否有任何新的进展。

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.

我的用例非常简单,我有一个样式化的DIV和一些元素 - 我想创建该DIV的屏幕截图。

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

  2. 在服务器上呈现它

不可能从js获得真正的截图。

Taking a real screenshot from js is not possible.

这篇关于Javascript库采取网页截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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