Create a PDF file using JAVA
Introduction
- 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. www.lowagie.com/iText/.
- There is plenty of documentation and example code at this site.
-
Required Jars:
- You can download the following iText jar from http://www.lowagie.com/iText/download.html.
- 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.
Thanks for this example about using PDF within Java code... It should be very usefull for me.
You have done a good job. I was looking for the same. By this can we edit pdfs?
Thanx and Regards
George
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.
How can I pass to the pdf document
the content of my view ?
Regards
sas