You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Olivier Jacquet <oj...@jax.be> on 2008/03/01 20:06:44 UTC

Fetching the rendered page result.

Hello,


Is it possible to access the rendered page result from within a page 
without calling the actual http:// address?

I would need this so that I can setup a page that generates xml (xsl-fo) 
to be processed by fop [1] to convert it to pdf. That is much more 
readable than generating the xml of pdf programmatically.

So, basically, what I want is the following unless someone knows a 
better way:

class MyPage {
   function onSubmit() {
      FOPPage xml = new FOPPage();
      String output = xml.render(); // or something like this
      ...save the output to disk...
      ...convert the output to pdf on disk...
      ...send the generated pdf to the user...
   }
}

MyPage.tml:
Click the button to get the pdf:
<t:form><input type="submit"></t:form>

FOPPage.tml:
<?xml version="1.0" encoding="iso-8859-1" ?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
...


Regards,
Olivier


[1] http://xmlgraphics.apache.org/fop/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Fetching the rendered page result.

Posted by Howard Lewis Ship <hl...@gmail.com>.
This is tricky, but doable.  You have to jump into a bit of the
internals to pull it off, however.

Really, Tapestry should add a service to assist in this, something
where you feed in a page instance or page name and get back a
Document.  Add an issue to JIRA.

On Sat, Mar 1, 2008 at 11:06 AM, Olivier Jacquet <oj...@jax.be> wrote:
> Hello,
>
>
>  Is it possible to access the rendered page result from within a page
>  without calling the actual http:// address?
>
>  I would need this so that I can setup a page that generates xml (xsl-fo)
>  to be processed by fop [1] to convert it to pdf. That is much more
>  readable than generating the xml of pdf programmatically.
>
>  So, basically, what I want is the following unless someone knows a
>  better way:
>
>  class MyPage {
>    function onSubmit() {
>       FOPPage xml = new FOPPage();
>       String output = xml.render(); // or something like this
>       ...save the output to disk...
>       ...convert the output to pdf on disk...
>       ...send the generated pdf to the user...
>    }
>  }
>
>  MyPage.tml:
>  Click the button to get the pdf:
>  <t:form><input type="submit"></t:form>
>
>  FOPPage.tml:
>  <?xml version="1.0" encoding="iso-8859-1" ?>
>  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>  ...
>
>
>  Regards,
>  Olivier
>
>
>  [1] http://xmlgraphics.apache.org/fop/
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org