如何在 Struts 中为 Mysql 的搜索结果创建 pdf
我想根据使用 Struts 从 Mysql DB 传入的值创建一个 pdf。有人可以帮助我指出任何工具或如何处理吗?
I want to create a pdf according to Incoming Value From Mysql DB using Struts.Could Anyone help me by point any tool or how to process?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用iText - 一个用于创建PDF文档的成熟开源库。以下示例基于 Struts 1,但可能对您有帮助:
You can use iText - a mature open source library for creating PDF documents. The following example is Struts 1 based, but may help you:
除了 iText 之外,您还可以使用 JasperResports - 它构建于之上iText,但为您的报告提供了 GUI 设计器(然后可以将其导出为 pdf、excel、打印机等)。
但无论哪种方式,你都必须阅读和学习很多东西;)
In addition to iText, you can use JasperResports - it is built ontop of iText, but provides a GUI designer for your report (which can be then exported to pdf, excel, printer, etc.).
But either way you will have to read and learn a lot ;)
Docmosis 将允许您以 Doc 或 ODT 格式创建文档的基础作为模板。然后,您可以在渲染 PDF 之前使用 mysql 数据来控制要对模板执行的操作(插入数据、删除数据、选择不同的模板等)。我不确定你的“具有复杂用户界面的 pdf”是什么意思。 Docmosis 可以让您制作相当复杂的文档模板(感谢 OpenOffice),而 Jasper 可以让您编写几乎任何您可能需要的输出结果。
Docmosis will let you create the basis of your document in Doc or ODT format as a template. You can then use your mysql data to control what you want to do to the template (insert data, remove data, pick a different template etc) before you render the PDF. I'm not sure what your "pdf with complex UI" means. Docmosis lets you template fairly sophistocated documents (thanks to OpenOffice), but Jasper lets you code pretty much any output result you could need.