fook-keong wrote:
>Hi,
>I want to generate a PDF file with a define XML template. Data will be obtained
>from the servlet and the data merging with the XMl template would be done. One
>problem I'm facing is that the PDF file would need a dynamic table in it and I'm
>not sure how to do it since I was not able to add it to the XMLPeer.setContent().
>Another question is that how should I define in the XML template for the table
>section? I know there are alternative solutions but I'm required to use iText.
>
In my projects, I parse the original template XML twice: once I look for
a custom <tables /> tag and I replace this tag with the dynamic table
resulting in a new XML file. A second time I parse this resulting XML
and generate the PDF.
Another solution, is to mark the place where the dynamic table should
come with a processing instruction and use a subclass of iText's XML
handler. In this subclass you process the table when the procession
instruction is triggered.
Which of both solutions is to be preferred, depends on the nature of
your project.
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