tan ean khim writes:

> hi all,
> I would like to render a xml file to a pdf file,

I want to repeat that XML 2 PDF functionality is still experimental. 

> the xml file have several "div" element tag, each "div" 
> will be rendered as a chapter in pdf file.

You have to map div to chapter. 

> (1) how to generate different header and footer
> for each "div" dynamically (parse the data from xml file)? 
> For example, the first "div" with header "Chapter 1" and
> the second "div" with header "Chapter 2", etc?

You will have to change the content of the header/footer
in an onChapter-event and add the header/footer in an
onEndPage-event. This is demonstrated in Chap1201.java. 

> (2) how to let the second "div" start with 10 pages after the first "div",
> and the third "div" start with 15 pages after the second "div"?

If the content of the first chapter takes more than 10 pages,
you can't do this. If the first chapter is less than 10 pages
and you want to add blank some pages before starting the new
Chapter, I would keep track of the number of pages in an
onStartPage-event and add the extra blank pages in an
onEndChapter-event. 

> (3) how to get the source of image from xml file using tagmap.xml
> (mapping of xml element tag to iText tag) method?

You point at the source of an image (URL or filename) in
the url-attribute of the image tag. 

> (4) other than the tagmap.xml method as shown in the tutorial's example, 
> what other methods that can be done to render xml file to pdf file?

Personally I never use a tagmap.xml, I use a HashMap filled with
XmlPeer-objects as in http://www.lowagie.com/iText/examples/Chap0705.java 

HTH,
Bruno Lowagie

_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to