You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Steinar Rune Eriksen <sr...@bizpartner.no> on 2004/10/15 11:17:14 UTC
Binary data / PDF
hei
I am trying to display a pre-generated PDF file in Cocoon; so I am not
using the FOP stuff. I have a Java generator that loads the PDFs from a
database and holds it as a byte array (byte[]).
Question is : how do I pass a byte array back to Cocoon from the
generator; and how does the sitemap go on further to render it (e.g pdf
serializer)?
My other generators work only on XML documents where I use the following
to pass data back to cocoon. This obviously does not work on binary data.
XMLReader xmlreader = XMLReaderFactory.createXMLReader();
xmlreader.setContentHandler(xmlConsumer);
InputSource source = new InputSource(new StringReader(message));
xmlreader.parse(source);
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Binary data / PDF
Posted by Joerg Heinicke <jo...@gmx.de>.
On 15.10.2004 11:21, Bertrand Delacretaz wrote:
>> ...I am trying to display a pre-generated PDF file in Cocoon; so I am
>> not using the FOP stuff. I have a Java generator that loads the PDFs
>> from a database and holds it as a byte array (byte[])...
>
>
> To serve binary data you need a Reader, not a Generator. I *think* there
> is a BLOB reader or something similar in Cocoon, but don't have the
> details here.
It's the DatabaseReader I think you have in mind:
http://cocoon.apache.org/2.1/userdocs/readers/database-reader.html.
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Binary data / PDF
Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 15 oct. 04, à 11:17, Steinar Rune Eriksen a écrit :
> ...I am trying to display a pre-generated PDF file in Cocoon; so I am
> not using the FOP stuff. I have a Java generator that loads the PDFs
> from a database and holds it as a byte array (byte[])...
To serve binary data you need a Reader, not a Generator. I *think*
there is a BLOB reader or something similar in Cocoon, but don't have
the details here.
-Bertrand