Bruno Lowagie wrote:
Joseph Hanna wrote:

Hello everyone,
I have a project that involves me transforming a xml file with a
specific format specified by a DTD into a PDF file. The other thing is
that the information is in international characters and I need to be
able to set a true type font. I know the font thing can be done, but
how is the handling of international characters? I am also worried
about the 'discontinuation' of support for the xml handling. Is this
the correct project for my work or should I keep looking?

Download this XML file:
http://www.lowagie.com/iText/gallery/pace.xml
It's in unicode and contains the word peace in many different languages.

Now download this source code example:
http://www.lowagie.com/iText/gallery/Pace.java

If you have arialuni.ttf in the right directory,
you can convert the unicode XML file to
http://www.lowagie.com/iText/gallery/pace.pdf

You will see that some words are missing:
those are examples of which the unicode character
isn't defined in arialuni.ttf.
In this case, you need to use FontSelector and
add more fonts.

You will also see that Indic words aren't rendered correctly.
This is because the characters aren't ligaturized (iText only
has a Ligaturizer for Arabic).

As far as discontinuation of XML support is concerned:
the book on iText will explain that it's better to write
your own handler as is done in the Pace.java example.
Why would you need iText to parse XML?
You know the structure of you XML better than any
iText developer; you can't expect iText to understand
every XML schema you can think of.
Let iText take care the PDF generation and write
your own XML handler.

br,
Bruno

I'm working on an implementation of XSL-FO which will use iText as its
PDF library.  It's some way off yet, but I'll post here as soon as I
have some demonstration output.  With this approach, you can use XSLT to
transform your XML into XSL-FO, then generate your PDF from that.  In
fact, that is why XSLT was invented.  Of course, you will have to become
familiar with XSL-FO.

Peter
--
Peter B. West <http://cv.pbw.id.au/>
Folio <http://defoe.sourceforge.net/folio/>

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to