wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes PDF generation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "PDF generation" Watch "PDF generation" New topic
Author

PDF generation

sreedhar Lackka
Ranch Hand

Joined: Jul 05, 2008
Posts: 154
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

Joined: Mar 22, 2000
Posts: 12823
    
    5
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
Marshal

Joined: Mar 22, 2005
Posts: 42624
    
  65
Moving to the "Other Open Source Porjects" forum, which is appropriate for both FOP and iText.


Ping & DNS - my free Android networking tools app
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

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

Joined: Jul 05, 2008
Posts: 154
How can I create some text with Arial style.
Is this Factory supports Arial fonts
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42624
    
  65
Both FOP and iText can handle just about any font you have on your system, and certainly Arial.
sreedhar Lackka
Ranch Hand

Joined: Jul 05, 2008
Posts: 154
Could you please give me any example code?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42624
    
  65
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

Joined: Jul 05, 2008
Posts: 154
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
Marshal

Joined: Mar 22, 2005
Posts: 42624
    
  65
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PDF generation