html转图片,java库cssbox
2024-10-15 09:23:27
引入依赖包
<dependency>
<groupId>net.sf.cssbox</groupId>
<artifactId>cssbox</artifactId>
<version>4.14</version>
</dependency>
案例:
public static void main(String[] args) throws Exception {
ImageRenderer render = new ImageRenderer();
render.setWindowSize(new Dimension(800, 1000), false);
System.out.println("kaishi");
String url = new File("G:/index.html").toURI().toString();
FileOutputStream out = new FileOutputStream(new File("G:"+ File.separator+"cssbox.png"));
Thread.sleep(10000);
render.renderURL(url, out, ImageRenderer.Type.PNG);
System.out.println("OK");
}
---------------------
作者:青春微凉love
来源:CSDN
原文:https://blog.csdn.net/qq_36029699/article/details/86507825
版权声明:本文为博主原创文章,转载请附上博文链接!
最新文章
- JS動態綁定下拉單內容
- hadoop2.6源码导入mvn出错Missing tools.jar问题解决方案
- WCF消息拦截,利用消息拦截做身份验证服务
- 线程池ExecutorService和完成服务CompletionService的使用获取线程的返回结果
- AngularJS开发指南9:AngularJS作用域的详解
- C/C++程序终止时执行的函数——atexit()函数详解
- 集群管理 secondaryNameNode和NameNode(转)
- How to using x++ creating Vendors [AX2012]
- 自定义的IntentFileter 无法找到activity
- 嵌入式C语言不可不用的关键字
- 一个简单的使用restc demo
- [HDU 2102] A计划(搜索题,典型dfs or bfs)
- ReentrantLock+线程池+同步+线程锁
- ③---Java项目管理工具MAVEN安装与配置
- sql server中的用户临时表和全局临时表的区别
- 两个有序数组的上中位数和第K小数问题
- ios 在使用 SDWebimage UIButton setBackgroundimage
- react脚手架改造(react/react-router/redux/eslint/karam/immutable/es6/webpack/Redux DevTools)
- HIT 2715 - Matrix3 - [最小费用最大流][数组模拟邻接表MCMF模板]
- git grade 版本下载及安装
热门文章
- struts2 动态Action
- C++笔记16之const的用法总结
- 组队作业_One
- HDU1301&;&;POJ1251 Jungle Roads 2017-04-12 23:27 40人阅读 评论(0) 收藏
- [label][javascript-Unit Test][JSLint]A Guide To JSLint Messages
- Excel2010画动态甘特图
- kubectl get componentstatus ERROR:HTTP probe failed with statuscode: 503
- 苹果appID的获取方法
- Verify the Developer App certificate for your account is trusted on your device.
- crond脚本执行并发冲突问题