xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thierry Kormann <tkorm...@ilog.fr>
Subject Re: 1.1.1 transcoding
Date Wed, 19 Dec 2001 17:08:19 GMT
On Wednesday 19 December 2001 17:50, Anthony Shawver wrote:
> Thanks, David.  However I still get the problem:
>
> Previously when transcoding, I used the new TranscoderInput(String URI)
> constructor for input, and everything works fine.  My output stream size is
> about 5k in this instance.
>
> >> transcoder.transcode(new TranscoderInput(uri), new
>
> TranscoderOutput(ostream));
>
> However, now I'm attempting to use the new TranscoderInput(Document doc)
> constructor for input, and I do not seem to get any image output.   My
> output stream is 991 in this instance.
>
> >> transcoder.transcode(new TranscoderInput(document), new
>
> TranscoderOutput(ostream));
>
> The rest of the code (including the TranscoderOutput) is identical.  The
> only thing I can get from debugging it is the difference in output size.
> The only thing I have changed is the transcode method.  I need to do this
> because performance in unacceptable the other way.  Has anyone used the
> "document" version of transcode successfully?

The following page on our website shows how to use the ImageTranscoder with a 
Document.

http://xml.apache.org/batik/rasterizerTutorial.html

---

Things to care about:

a. Your Document must have been created using our DOMImplementation (see the 
documentation on the website). This is due to the fact that we need some 
special features that are *not* part of the standard DOM api. So the xerces 
(or others) DOM implementation can *not* be used.

If you can not bootstrap your DOM using our DOMImplementation, you can use 
the DocumentWrapper class (package org.apache.batik.dom) that will wrap your 
SVG DOM subtree into another identical DOM subtree using our 
DOMImplementation (xerces -> batik DOM for example).

Then, the resulting tree can be sent to the transcoder.

b. if your document uses external references (such as external use, 
image...), you must specify the URL of your document (ie. that will be used 
to find and load thoses external resources). 

You can do that using the ((SVGOMDocument)doc).setURLObject(url)

Hpoe that helps,
Thierry.
 

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


Mime
View raw message