executeJavaScript and window initialization order problem

Thanks for your reply Joonas,

setTimeout() would not be a good solution for this problem, because you never know when the page is actually finished.

Is there a way to use the vaadin components and generate plain html or pdf (or similar) so it can be printed?
It is not desired to build an entire html report just for printing this page (the lay-out is quite complicated and will change in the future).