Hi Archie,

Archie Cobbs wrote:

TJ Teegan wrote:

[..] 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";).

Yes, this is part of the SVG specification. The proper file extension for this is 'svgz'.

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%.

Yes, with gzip compression SVG files compare favorably with many traditional binary vector formats.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to