cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
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"/>
</map:act>

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


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


Mime
View raw message