Farid KHEZZAR wrote:

hi bruno

Hi,
please use the mailing list address if you have a question:
itext-questions@lists.sourceforge.net

i'm using the iText library to generate pdf files,
i have headers and footers which are built in the onEndPage method and to build them i need variables initialized in my main method which build the document (from a heavy sql query that i don't want to repeat) i thought it would be simple : declare a glabal variable, initalize it in my main method and then use it in the onEndPage method but my problem is that "onEvent" methods can't share variables with other methods,
Why not? In my PdfPageEvent implementations, I look at all kinds of variables in order to compose a header, a watermark, whatever.

so how can I do without repeating 2 times the same heavy query ??
In your questions you make some assumptions that are wrong. I don't think you understand the concept of Events. Have you tried the examples in the tutorial? http://itextdocs.lowagie.com/tutorial/directcontent/pageevents/ Look at how I change the header with the 'act' in the Romeo and Juliet example.
br,
Bruno


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to