简体   繁体   中英

Using iText with JBoss 7 Java EE project

How to use iText with JBoss 7 Java EE project?

I created a Java EE Project using JBoss Tools Group Id: org.jboss.tools.example Artifact Id: multi

I'm now trying to use iText to create a PDF from my Bean

<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? The dependency I found broke my project.

If anyone could help me set up iText with JBoss 7 I'd highly appreciate it

can I use Maven for this? The dependency I found broke my project.

Maven is always appreciated as dependency management mechanism.

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). To use the seam-pdf module you have to integrate the Seam2 framework but it's obsolete now. My recommendation is instead of using declarative way to build PDF, use the iText API and build a pdf yourself. iText documentation is quite good and there is a book and many examples over the internet.

If anyone could help me set up iText with JBoss 7 I'd highly appreciate it

After you have created the war project add iText as maven dependency to your .pom file and you are ready to go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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