如何在java中将jsp页面保存为pdf? [英] how to save a jsp page as pdf in java?
问题描述
我有一个用JSP构建的页面,struts。这个页面加载动态内容。
I have a page that built with JSP, struts.This page loading with dynamic content.
我想将页面保存为PDF文件,包含所有内容和单击按钮时的格式相同。如果我可以保存包含所有内容的页面,我可以转换为PDF。
如何以PDF格式保存带有此属性的jsp页面?
I want to save the page as PDF-file with all contents and the same format with a button click. If i can save the page with all contents, I can convert to PDF. How to save a jsp page with this properties as pdf?
提前感谢
推荐答案
我最近正在研究这个话题,我发现更好的方法是在客户端使用javascript来生成PDF。
很少有人可以为你做这些。选择你的方式:
f.e.
I was researching this topic lately and I found that better aproach is to use javascript on client side to generate PDF. There are few libs who can make it for you. choose your way: f.e.
生成使用Javascript从div中的HTML获取PDF格式
http ://html2canvas.hertzen.com/
https://github.com/MrRio/jsPDF
(:
这篇关于如何在java中将jsp页面保存为pdf?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!