Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

Re: [iText-questions] xml -> pdf or html

Bruno

2005-06-24

Replies:

Doug James wrote:

> * Request for anyone's comments / suggestions / concerns. *
>
> There is a chance I could be asked to take a home grown XML document
> and create either html or pdf from it. Any pitfalls to watch out for
> or any suggestions on the best way to do the request?

I don't know if I already mailed you, but for what it's worth:

Are the home grown XML files large (resulting in 100+ PDF pages) or
small (10 pages)?
Is the XML straighforward (text flow doesn't change) or complex?
The answer to these questions will help you to make the choice between
using a
SAX-parser, DOM or JDOM.

A colleague of mine uses DOM resulting in an XML tree, then changes some
nodes,
then walks the tree to make the PDF with iText Chunk, Paragraph,
Anchor,... objects.
This code is closed source and to application specific to add to iText.
This approach is only recommended if you have relatively small documents
that
aren't very straightforward.

The XML package uses SAX, so does the (hidden by ignorance) markup package.
It would be great if somebody would be able to update these packages and
post
the updates back to the iText project. But as was the case with the
application my
colleague made: your home grown XML could be very specific for your own
organization. If you need Tables in your output, we should have an in depth
discussion of your needs as (PdfP)Table functionality is rather complex.
(If you don't need 'rowspan', a lot of problems can be avoided.)

Another possibility would be to use another XML project,that uses iText
for PDF/HTML generation, but offers an XML layer on top of iText.
UJAC is such a project: http://ujac.sourceforge.net/
I think the developer who wrote these Application Components has already
solved many issues that are rather problematic in the iText XML package,
but I still haven't found the time to look at his code.

br,
Bruno


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.