从JSP输出创建PDF [英] Create a PDF From a JSP Output
问题描述
我有一个带PDF导出选项的网页。我必须在PDF中显示页面的内容。目前我使用iText PDF Library生成PDF。问题是用iText创建PDF是一个相当大的挑战。此外,我们经常对网页进行布局/ UI更改,因此我们对PDF进行了相同的更改。
I have a webpage with a export option to PDF. I have to display the contents of the page in the PDF. Currently I use iText PDF Library to generate PDFs. The problem is creating PDF with iText is quite a challenge. Moreover we get frequent layout/UI changes for the webpage, so we have make the same changes to PDF.
有什么方法可以将我的JSP输出转换为PDF。例如,如果我们将内容类型设置为contentType =application / vnd.ms-excel,则JSP表可以呈现为Excel文档。
Is there any way i can convert my JSP output to PDF. Like for example "if we set the content type to contentType="application/vnd.ms-excel", a JSP table can be rendered as Excel document.
推荐答案
您是否检查了Jasper Reports?它具有XML模板的概念。同样的模板也可用于生成Word / XLS / PDF / CSV / XML输出。
Have you checked Jasper Reports ? It has the concept of XML templates. Also same template can be used to generate Word / XLS / PDF/ CSV / XML output.
这篇关于从JSP输出创建PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!