cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: writing PDF file to filesystem
Date Fri, 04 Mar 2005 17:09:45 GMT
Lars Huttar wrote:

> Geert Josten wrote:
>> Hi,
>>> Doesn't it? It allows you to specify the serializer. I've never used 
>>> it, but I've seen the code there. By default it uses the XML 
>>> serializer, you just need to specify another.
>>> Am I missing something?
>>> Regards, Upayavira
>> Hmmm it _is_ possible with the SourceWritingTransformer, but only 
>> because XSL-FO is XML and there is a serializer that can convert the 
>> FO XML to PDF, which can be directly written to disk by this 
>> transformer.
>> But what if you want to write something that isn't derived from XML? 
>> You can't just insert binary data into the <source:fragment> element 
>> and make it be written to some file...
> Actually you can; I have been doing that for some time (see my post of 
> today, "how to copy a binary file"). I wrap a <dummy> element around 
> the file contents.
> It may not be legal XML if it contains non-Unicode characters, but it 
> works.
> It's not pretty though...

You can also use the copy-source action which handles sources as binary 
streams. And architecturally speaking, it's a bit less ugly than the 
source-transformer :-)

<map:act type="copy-source" src="cocoon://pipeline-that-creates-a.pdf">
  <map:parameter name="dest" value="path/to/file.pdf"/>


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

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

View raw message