• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PDF generation

 
sreedhar Lackka
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Thanks a lot in advance.
Actually we need to generate PDF from our application.
The PDF will consists images, and so much data in a tabular format. Could any one please help me to find some example code and references for this.

Regards,
Sree
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used the Apache FOP toolkit for pdf generation.
The iText package has also been recommended.

Note that this is not a JSP question, the XML forum frequently has FOP related posts.

Bill
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the "Other Open Source Porjects" forum, which is appropriate for both FOP and iText.
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sreedhar,

I've recently tested iText (not yet too extensively) and I can tell you that this is your choice if you want to create PDFs directly from Java. It's really easy to use and you can quickly create even content with tables, images etc. There are short and quite good examples on the homepage of iText

Marco
 
sreedhar Lackka
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I create some text with Arial style.
Is this Factory supports Arial fonts
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both FOP and iText can handle just about any font you have on your system, and certainly Arial.
 
sreedhar Lackka
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please give me any example code?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For what, exactly? Which tool are you using? If it's iText, then the tutorial has a whole section with many code examples.
 
sreedhar Lackka
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks a lot.
We are using "com.lowagie.text.FontFactory" and when i try the following code,
Font fonts = new Font[14];
fonts = FontFactory.getFont(FontFactory.COURIER, Font.DEFAULTSIZE, Font.NORMAL);

in place of COURIER it is not taking ARIAL.

I searched http://itextdocs.lowagie.com/tutorial/fonts/styles/index.php also no example is given for that.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see. Well, Arial is not one of the standard fonts that's available everywhere (unlike the other ones that are defined in FontFactory). But FontFactory has tons of methods that will take the font name as a string; you can use those for Arial.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic