New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[js] 第116天 如何使用js来截图?怎样截可见区域和整个页面? #1047
Comments
可以基于html2canvas 和 canvas2image 两个第三方类实现截图。 如果打算截取整个页面 可以直接设定
如果打算截取可见区域 额外设置一下宽高即可
|
这种东西太hack了...browser 上搞纯属自虐 nodejs 可以考虑一系列 headless 库,例如 puppeteer 和 phantomjs |
@t532 楼上说的对,但是更推荐用puppeteer,phantomjs已经停止维护了,在一些比较新的ES的语法上会出现一些问题 |
不知道,目前市面上的库html2canvas 和 canvas2image 都不能处理渐变色文字,不能算完美的库 |
市面上html2canvas库用来截图比较多,截整个页面可传入body 如 : |
第116天 如何使用js来截图?怎样截可见区域和整个页面?
The text was updated successfully, but these errors were encountered: