cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Fagnani-Bell <>
Subject Re: Can cocoon write pdf to a file?
Date Thu, 15 Aug 2002 20:43:14 GMT

On Thursday, August 15, 2002, at 10:53 AM, kyle koss wrote:

> Is it possible for Cocoon to do an XML+XSL -> PDF transformation, but 
> instead of serving the PDF into the browser, writing it to a file?
> What I would like to do is, take information entered into a form on a 
> jsp page, turn it into an XML file, and then apply my XSL to it to 
> produce a PDF which is then stored to disk on the server.
> Can this be done using Cocoon, or would it be easier to just use FOP 
> embedded in a servlet? If it can be done, what do I have to do?

I can't think of any way to do this with the included Cocoon components, 
but you could write an action that does this. Create a matcher that does 
the XML+XSL->PDF transformation, then in an action access the url for 
that matcher and saves to a file. I forget if action can access a 
pipeline with in an action with something like 
resolver.resolve("cocoon:/pdf"), if not you'll have to use the classes.

You could also write an action that actually loads the file, performs 
the transformation, serializes to PDF and writes the file, all 
configurable by sitemap parameters, but the action that saves a url to a 
file seem more generally usable, it could be a good addition to Cocoon.


Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message