Quoting pooja sharma <[EMAIL PROTECTED]>:

> 
> It is very difficult to write a tagmap for any kind of xml. The files given
> in the tutorial as examples are all xml files (for which the tagmaps are
> written) and there is no need to apply any xsl on them. In my project, xml
> and xsl -two separate files are provided in order to convert them to PDF. I
> don't know each and every kind of iText tag that can be used for writing
> tagmaps. 

I don't know every kind of iText either (allthough I wrote the code;
I just don't remember them). Fortunately, all classes have very easy
names. If I need a paragraph, I read the constructor of class Paragraph
that takes a Properties object. If I need a chapter, I do the same with
class Chapter, and so on...

How difficult can that be???

> And if I convert a large xml and xsl into text file and then to PDF, then I
> get "out of memory" error . Is it because a tree structure is formed in the
> memory as in case of FOP? 

It's because it is a bad idea to stuff a 3MB String into a Paragraph
object.

> In the the Java code in which I am  converting text into PDF, Iam reading the
> text file into a string and then using the "paragraph.add" function. To
> remove the "out of memory" problem, I have used "System.gc()" function but it
> has made the processing very slow - a 3MB file will take hours !!!!!!!! 

And where do you perform the garbage collect?
I don't understand why this would help you avoiding the OutOfMemory.
Allthough I still think it's a bad idea to degrade your XML
to text, you could split your textfile with '\n' as delimiter.

In Pseudocode it would look like this:
Paragraph p;
StringTokenizer st = new StringTokenizer(myText, "\n");
while (st.hasMoreTokens()) {
    p = new Paragraph(st.nextToken());
    doc.add(p);
}

> What should I do to reduce the processing speed?

I think you mean INCREASE processing speed.

> What should I do so that  meta-info is not lost?

Tagmaps are REALLY EASY. Use them.
(Remark: in some situations in which the same tagname has
different meanings depending on the context, tagmaps will
not be sufficient.)

> If I have to write tagmaps, How should I write them for any xml and xsl? 

Get rid of the xsl.

> PLEASE GUIDE

As I stated earlier: free software developers can't do the work
YOU are paid for. But if you send a small sample of your XML
(in which no more than 5 different tags are used), I can get you
started by writing you a demo tagmap.

Bruno


-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to