Skip to Content

Create a PDF file using JAVA


This weblog presents Java code to create a PDF file to be displayed in EP6 portal using AbstractPortalComponent.
I currently use this solution to convert all my reporting htmlb table display to PDFs.
I am going to use iText’s open source api to create a PDF file.
These apis can also be used to read PDF file. For more information about api check out the site.
There is plenty of documentation and example code at this site.

Required Jars:

You can download the following iText jar from
servlet.jar, itext-1.2.jar

Steps to create PAR component

Step 1:

Create an AbstractPortalComponent using Eclipse or Netweaver Studio. Add the above jar (itext-1.2.jar) to PORTAL-INF->lib folder.

Step 2:

Add the following lines to doContent method.

Step 3:

Deploy it in portal and run it. You should get the following output.
You must be Logged on to comment or reply to a post.
  • Hats off,
    You have done a good job. I was looking for the same. By this can we edit pdfs?

    Thanx and Regards

  • I am new to eclipse, as mentioned in the blog, i could get itext-1.3.jar (this is only available).
    And stored in c:\tomcat\webapps\irj\WEB-INF\lib\ext.

    And refered in the project.

    But i am getting a error:

    Linkage error while loading implementation class

    java.lang.NoClassDefFoundError: com/lowagie/text/Phrase

    I think, i missing some very basic step.
    can you guide me thru. it?

    Thank You.