Shouldn't be too hard.

Do this in your page class:

Object afterRender(MarkupWriter writer) {
Document doc = writer.getDocument();
ITextDocument itextDoc = convertT5DocToItext(doc);
return new ITextStreamResponse(itextDoc);
}

I think you can also gain access to all generated markup from the
MarkupWriter (writer.toString()), and just pass the generated HTML on to
your PDF writer.

One example technique for making a PDF version of your pages is to subclass
your page and only include the afterRender method above. I'm sure there are
other (more elegant) ways to do this than the example I made here!

On Fri, Jan 1, 2010 at 7:30 AM, Ashwanth Kumar <ashwanth.ku...@gmail.com>wrote:

> Hello,
>
> Happy new year to all!! (Its new year here in India)..
>
> Okay, i need a small help! I want to generate a PDF file, based on the
> generated page in Tapestry.. I've plans of using iText to generate PDF. Can
> any one help me? How to get it done!!
>
> PS: On cliking Download PDF link, the PDF should be generated on the fly,
> and then sent to user.
>
>  - Ashwanth Kumar
>

Reply via email to