Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > fop or itext for java to pdf generation

Reply
Thread Tools

fop or itext for java to pdf generation

 
 
Tim
Guest
Posts: n/a
 
      07-13-2005
Hi

Can anyone comment on the pros and cons of fop (using xml) or itext
(java lib) for generating pdfs from a java programme. My requirements
are to produce a "glossy" hi-fidelity brochure type pdf of approx 50
pages in length. The source data for the report will be pulled out of a
database and will consist of text and graphics. I need to be able to
use page numbering and use a "table of contents" in the pdf.

Are there other tools suitable for doing this. I don't mind paying for
the right product,

Any help appreciated,

Tim

 
Reply With Quote
 
 
 
 
Ingo R. Homann
Guest
Posts: n/a
 
      07-13-2005
Hi Tim,

Tim wrote:
> Can anyone comment on the pros and cons of fop (using xml) or itext
> (java lib) for generating pdfs from a java programme. My requirements
> are to produce a "glossy" hi-fidelity brochure type pdf of approx 50
> pages in length. The source data for the report will be pulled out of a
> database and will consist of text and graphics. I need to be able to
> use page numbering and use a "table of contents" in the pdf.
>
> Are there other tools suitable for doing this. I don't mind paying for
> the right product,


I didn't use FOP really (I only tried it and it somehow did seem
unsuitable to me), but I am using iText for quite a while.

I think, iText will work for what you want to do, although a table of
contents is a bit tricky and concerning this, there are some
disadvantages, IIRC (I think, the number of pages reserved for the table
of contents has to be fixed in advance or something like that).

Further disadvantages of iText are:
- No RowSpan for PdfPTables (IIRC, normal Tables can do Rowspan, but
they have some other disadvantages too (Borders?))
- No relative sizes esepcially for images and tables (absolute to
relative widths and heights have to be calculated manually)
- weak support for page breaks / no-page-break

As you see, the disadvantages are only important when you want to do
"advanced" things.

At all, I think, iText is a very good package when you want to generate
PDFs.

Ciao,
Ingo

 
Reply With Quote
 
 
 
 
Raymond DeCampo
Guest
Posts: n/a
 
      07-13-2005
Tim wrote:
> Hi
>
> Can anyone comment on the pros and cons of fop (using xml) or itext
> (java lib) for generating pdfs from a java programme. My requirements
> are to produce a "glossy" hi-fidelity brochure type pdf of approx 50
> pages in length. The source data for the report will be pulled out of a
> database and will consist of text and graphics. I need to be able to
> use page numbering and use a "table of contents" in the pdf.
>
> Are there other tools suitable for doing this. I don't mind paying for
> the right product,
>


The TeX or LaTeX systems, available on many Unix systems (I think MikTeX
is Windows) is designed for creating such complex documents. Knuth
wrote the original TeX so that he could create his classic textbooks.

Ray

--
XML is the programmer's duct tape.
 
Reply With Quote
 
Andrew
Guest
Posts: n/a
 
      07-14-2005
Hi Tim,

"Tim" <(E-Mail Removed)> writes:

>Can anyone comment on the pros and cons of fop (using xml) or itext
>(java lib) for generating pdfs from a java programme. My requirements
>are to produce a "glossy" hi-fidelity brochure type pdf of approx 50
>pages in length. The source data for the report will be pulled out of a
>database and will consist of text and graphics. I need to be able to
>use page numbering and use a "table of contents" in the pdf.


>Are there other tools suitable for doing this. I don't mind paying for
>the right product,


I've used Apache FOP for doing something similar to what you describe -
producing (shorter) glossy flyers dynamically. My experience suggests that
using XSL:FO allows you to have a much finer-grained control over the layout
and presentation of your PDF output than a tool like iText can provide. Think
things like text leading, kerning, font sizes, colourings, indentation,
page and area margins etc.

Having said that, bear in mind that Apache FOP does not currently implement the
full scope of XSL:FO capabilities (<http://xml.apache.org/fop/compliance.html>
has more details of what the current implementation of FOP does support).
You'll need to decide whether it's missing any key areas of functionality that
you think you'll need for your project. If it is lacking, there are much more
feature-complete commercial XSL:FO engines available, but of course these cost
significant $$$.

Page numbering is very easy with FOP. I haven't created anything more than a
simple table of contents, but they are certainly part of the XSL:FO spec, and
at least some support is implemented in FOP (but beware of memory limitation
issues if you have a large document and lots of forward references, which a
table of contents implicitly requires).

Overall, I was very satisfied with XSL:FO and FOP. Occassionally I had to
creatively work around some limitations, but these were more in the category of
minor hassles than major headaches or showstoppers.

Good luck with the project!

Cheers,
Andrew
 
Reply With Quote
 
Steve Sobol
Guest
Posts: n/a
 
      07-14-2005
Andrew wrote:

> I've used Apache FOP for doing something similar to what you describe -
> producing (shorter) glossy flyers dynamically. My experience suggests that
> using XSL:FO allows you to have a much finer-grained control over the layout
> and presentation of your PDF output than a tool like iText can provide. Think
> things like text leading, kerning, font sizes, colourings, indentation,
> page and area margins etc.


It's wonderful. http://JustThe.net/legal/tos/ contains a form whose target
is a Java servlet that takes the information from the form, plugs it into
the appropriate places in an XML template, and renders it all via XSL:FO
(and FOP). Only thing is, it's a tad sluggish (note that my web page says
10-15 seconds to render the page). But other than that, it works *really*
well. And FO does allow you a good bit of control over what goes where.

> Page numbering is very easy with FOP. I haven't created anything more than a
> simple table of contents, but they are certainly part of the XSL:FO spec, and
> at least some support is implemented in FOP (but beware of memory limitation
> issues if you have a large document and lots of forward references, which a
> table of contents implicitly requires).


I can offer some source code if people are interested

--
JustThe.net - Steve Sobol / http://www.velocityreviews.com/forums/(E-Mail Removed) / PGP: 0xE3AE35ED
Coming to you from Southern California's High Desert, where the
temperatures are as high as the gas prices! / 888.480.4NET (463

"Life's like an hourglass glued to the table" --Anna Nalick, "Breathe"
 
Reply With Quote
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      07-14-2005
Raymond DeCampo wrote:
> The TeX or LaTeX systems, available on many Unix systems (I think MikTeX
> is Windows) is designed for creating such complex documents. Knuth
> wrote the original TeX so that he could create his classic textbooks.


TeX is available for almost every OS. If the OP is looking for some
native Unix formatter/typesetter, than that would be troff plus some
troff macro library. The GNU version of troff - groff - has been ported
to an number of non-Unix platforms, too, including Windows.

Early versions of troff were written in (PDP-11?) assembler, later ones
in C. groff is written in C++.

/Thomas


--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
http://www.uni-giessen.de/faq/archiv....java.gui.faq/
 
Reply With Quote
 
Tim
Guest
Posts: n/a
 
      07-15-2005
thanks for the info. It looks like there hasn't been a realse of fop
for sometime. I'm a little concerned that the project has "ground to a
halt". Anyone know if a new release is likely soon?

Tim

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF forms filling with ASP.NET, interactive forms, fill and write to database (iText or FDF Toolkit or ...) Toni Pohl ASP .Net 1 08-10-2008 01:40 PM
Problems running Apache FOP: org.apache.fop.fo.FOTreeBuilder fatalError Pablo Java 0 03-28-2007 02:31 PM
Passing iText created PDF back to Spring Framework Jack Java 0 07-07-2006 10:13 AM
pdf-forms using iText Daniel Java 0 06-09-2005 12:18 PM
iText HTML->PDF Problems Chris Java 2 04-19-2004 12:32 PM



Advertisments