I actually added an event handler to my page (could easily be a mixin) that returns the page as a pdf. I did somewhat cheat but it does work nicely. I use a HttpClient to request the same page again (with the sessionid so all session state is correct). From there on you have the exact xhtml you can use to generate your pdf (I use flying saucer) or whatever else you wish to do.
Hope it helps, Joost On Apr 23, 2012, at 2:12 PM, Lance Java wrote: > Funny you should mention this, I actually had a quick try at doing this > myself but I got a bit stuck... here's what I learned. > > 1. I was trying to use this technique > http://wiki.apache.org/tapestry/Tapestry5HowToGetAnHTMLStringFromARenderCommandParameterto > specify a FOP parameter to a Page (or Component) in a tml template. > > 2. From what I can see, there are two ways to return a StreamResponse > 2a. Return a StreamResponse from the onActivate() method of a page > 2b. Return a StreamResponse from an event handler method fired by a > <t:eventlink /> > > 3. Unfortunately, you can not use the method suggested in option 1 for > cases 2a or 2b because tapestry does not initialize or run the page render > sequence when a StreamResponse is returned in either of these two cases. > > 4. I came to the conclusion that I would probably need to initialize the > PageRenderQueue myself which would likely involve the use of internal > tapestry classes. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org