如何使用javascript将Html页面转换为PDF [英] How to Convert Html Page to PDF using javascript

查看:103
本文介绍了如何使用javascript将Html页面转换为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个java应用程序,它在网页中查看很少的结果,我想将这些结果保存到PDF文件中,用户单击按钮导出到PDF按钮。任何人都可以帮我使用哪种技术。我真的很清楚这一点。

I have a java Application which view few results in a web page , I want to save those results into PDF file which user click on a button "Export to PDF" Button. Can any one please help me to use which technology. I am really aware of this.

推荐答案

简单而好的方法是利用现有的库。您可以在服务器端或客户端完成它。如果您选择服务器端,请转到 iText PDF Api 否则您可以使用 jspdf 。两者都会提供自己的方法,你可以使用它。

The simple and best way is to make use of existing libraries. You can get it done either in server side or in client side. If you choose the server side, go for iText PDF Api Otherwise you can use jspdf. Both will provide their own methods, you could use it.

这篇关于如何使用javascript将Html页面转换为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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