使用Java将HTML文件转换为PDF及其图片和样式 [英] Convert an HTML file to a PDF with their pictures and styles using Java

查看:292
本文介绍了使用Java将HTML文件转换为PDF及其图片和样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

将HTML文件转换为PDF

我想转换一个使用Java将HTML文件转换为PDF。我搜索了stackoverflow和其他网站。我很惊讶。因为我找不到任何简单的方法。

I want to convert an HTML file to PDF by using Java. I've searched stackoverflow and other sites. I am suprised. Because I couldn't find any easy way.

你可以帮我这么做吗?

Could you help me with to do that?

提前致谢。

推荐答案

如果没有Java库要做到这一点,我建议找一个命令行工具来完成这项工作,并使用Runtime.exec()从Java调用它。虽然不太理想。

If there is no Java library to do this, I suggest finding a command-line tool that does the job, and invoking it from Java using Runtime.exec(). Not ideal though.

这篇关于使用Java将HTML文件转换为PDF及其图片和样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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