Dirk Ulrich wrote:
>   I have already adapted the endpage example to add a header to the 
> generated pdf.
> What's not so nice in this example is that the complete page is created 
> in the helper class.

For the simple standalone examples, I have tried
to do everything in one source file. That way if
you point somebody to an example, he has all the
code he needs.

> Isn't it possible to only build the header at onPageEvent?

If you mean if you could create a separate class
that implements the page events interface: of course,
that how you SHOULD do it. The examples are just...
examples. They show one aspect of iText in a practical
way. In a production environment you are supposed to
write 'cleaner' Java.

> I want to show some kind of table in the header on each page. The pages 
> content should be created in the 'main' class.

OK. No problem.
Provide sufficient margin space, build your document,
and add the table in the page event.

> It should just behave as you expect for using document.setHeader(...);

setHeader uses HeaderFooter.
Using page events is completely different.

> I want to build the docuemnt's content and before I defined the header 
> and just set it to the document so that it wil be placed at the top of 
> each page. ...and it ensures that the document's content begins AFTER 
> the header. How can I achieve this behaviour using onPageEnd?

That's not possible.
That's not even how HeaderFooter works (or worked).
What you are saying here, is that the header should
adapt itself to the document's content.
With HeaderFooter it's the other way round: the
document's content adapts itself to the space taken
by the header/footer.
You SHOULD know the space taken by the header/footer
before adding content to the document. Then you can
define the margins accordingly and use page events.

Your question confuses me.
I'm not sure what you are trying to do, maybe
your problem calls for a ColumnText approach.
With ColumnText you'd have complete control
over header/footer and content.

best regards,
Bruno

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to