简体   繁体   English

将iText与JBoss 7 Java EE项目结合使用

[英]Using iText with JBoss 7 Java EE project

How to use iText with JBoss 7 Java EE project? 如何将iText与JBoss 7 Java EE项目结合使用?

I created a Java EE Project using JBoss Tools Group Id: org.jboss.tools.example Artifact Id: multi 我使用JBoss Tools Group ID:org.jboss.tools.example Artifact ID:multi创建了一个Java EE项目。

I'm now trying to use iText to create a PDF from my Bean 我现在正在尝试使用iText从Bean创建PDF

<p:document xmlns:p="http://jboss.com/products/seam/pdf">                                                      

  This only prints plaintext                                                                                          

</p:document>

According to JBoss Wiki ( http://docs.jboss.org/seam/1.1.5.GA/reference/en/html/itext.html ) I need jboss-seam-pdf.jar and the iText.jar - can I use Maven for this? 根据JBoss Wiki( http://docs.jboss.org/seam/1.1.5.GA/reference/en/html/itext.html )的介绍,我需要jboss-seam-pdf.jar和iText.jar-我可以吗?为此使用Maven吗? The dependency I found broke my project. 我发现的依赖关系破坏了我的项目。

If anyone could help me set up iText with JBoss 7 I'd highly appreciate it 如果有人可以帮助我使用JBoss 7设置iText,我将不胜感激

can I use Maven for this? 我可以为此使用Maven吗? The dependency I found broke my project. 我发现的依赖关系破坏了我的项目。

Maven is always appreciated as dependency management mechanism. Maven一直被视为依赖项管理机制。

The example you see is a sample froject using the old Seam framework >= 2 which is useful for Java EE 5 (now we have CDI). 您看到的示例是使用旧的Seam框架> = 2的示例示例,该框架对于Java EE 5(现在有CDI)很有用。 To use the seam-pdf module you have to integrate the Seam2 framework but it's obsolete now. 要使用seam-pdf模块,您必须集成Seam2框架,但现在已经过时了。 My recommendation is instead of using declarative way to build PDF, use the iText API and build a pdf yourself. 我的建议是,不要使用声明性方式来构建PDF,而是使用iText API并自己构建pdf。 iText documentation is quite good and there is a book and many examples over the internet. iText文档非常好,互联网上有一本书和许多示例。

If anyone could help me set up iText with JBoss 7 I'd highly appreciate it 如果有人可以帮助我使用JBoss 7设置iText,我将不胜感激

After you have created the war project add iText as maven dependency to your .pom file and you are ready to go. 创建war项目后,将iText作为maven依赖项添加到.pom文件中,即可开始使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM