如何在Java中使用XML创建PDF? [英] How do you create a PDF from XML in Java?
本文介绍了如何在Java中使用XML创建PDF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前,我正在用Java创建一个XML文件,并通过使用XSL / XSLT转换它在JSP页面中显示它。现在我需要获取该XML文件并在PDF中显示相同的信息。有没有办法通过使用某种XSL文件来做到这一点?
At the moment, I'm creating an XML file in Java and displaying it in a JSP page by transforming it with XSL/XSLT. Now I need to take that XML file and display the same information in a PDF. Is there a way I can do this by using some kind of XSL file?
我见过 iText Java-PDF库,但我找不到任何方法将它与XML和样式表一起使用。
I've seen the iText Java-PDF library, but I can't find any way to use it with XML and a stylesheet.
非常感谢任何帮助。提前致谢!
Any assistance would be much appreciated. Thanks in advance!
推荐答案
您可以使用XSL格式化对象。
以下是一些关于如何做的好文章:
You can use XSL Formatting objects. Here are some good articles on how to do it:
- http://www.xml.com/pub/a/2001/01/17/xsl-fo /index.html
- http://www.xml.com/pub/a/2001/01/24/xsl-fo/index.html?page=1
- http:/ /www.javaworld.com/javaworld/jw-04-2006/jw-0410-html.html
- http://www.xml.com/pub/a/2001/01/17/xsl-fo/index.html
- http://www.xml.com/pub/a/2001/01/24/xsl-fo/index.html?page=1
- http://www.javaworld.com/javaworld/jw-04-2006/jw-0410-html.html
这篇关于如何在Java中使用XML创建PDF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文