The requirement is to provide a PDF option to a page that is already being rendered in HTML as faithfully as possible. Specifically,
1) generate dynamic HTML from database based on posted parameters. The HTML features imagery, optional javascript includes. Importantly, this page features a link or icon that says "save as PDF". 2) clicking "save as PDF" on the page will use the exact same request parameters to stream PDF into the browser instead of HTML. Important requirement is that the PDF should look exactly the same as the HTML rendered in #1 with all the graphics, but ignore any javascript used to show/hide etc i.e. just rendder the whole HTML. Many of the posts on this board and elsewhere address either #1 or #2, not both. Best streaming PDF reference: http://wiki.apache.org/tapestry/Tapestry5HowToCreateADynamicPDF Tapestry magic #10 (http://tawus.wordpress.com/2011/05/02/tapestry-magic-10/) seems like it offers the closest solution to both #1 and #2 - integrating Flying Saucer which generates PDF from (X)TML and CSS, but not able to connect all the dots as how it all hangs together in a legacy application. Basically, I am still unclear whether to store request or response for "save as PDF". Request would be stored to regenerate the result - only redirect to streaming as PDF. Storing the response would avoid another server trip and instead pass the response downstream to something like Flying Saucer to for conversion into PDF. How? I know one thread that goes into generating XML or Freemarker FIRST. But I already have HTML legacy that people know and love - just need to add the PDF extension and not redo the HTML. All references are at least 2 years old. So, would appreciate any latest and greatest recommendations.