xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Archie Cobbs <arc...@dellroad.org>
Subject Re: serialized applet
Date Fri, 17 Dec 2004 15:18:49 GMT
TJ Teegan wrote:
> I am not sure exactly what you are trying to accomplish, but if the goal 
> is to get document you are going to put on the canvas as small as 
> possible I would suggest looking at how you can take a loaded 
> SVGDocument and write the DOM as a String.  Then you can use the 
> Deflater class in java.util.zip to compress it into a relatively small 
> byte[].  To load it, use the Inflater class in java.util.zip and create 
> a Document similar to the examples at 
> http://xml.apache.org/batik/domapi.html#creating

Along these lines, I didn't realize this at first but JSVGCanvas
is perfectly happy loading an URL that points to a gzip'd SVG file.
E.g., setURL("http://foo.com/myfile.svg.gz").

We've found that compresing the files makes load times a lot faster,
because a nontrivial amount of time was spent just downloading the
file over the net. Of course, SVG files compress very well, e.g. 90%.


Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

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

View raw message