W3C home > Mailing lists > Public > www-svg@w3.org > March 2013

Re: SVGSVGElement.toDataURL()

From: Dirk Schulze <dschulze@adobe.com>
Date: Mon, 11 Mar 2013 07:03:37 -0700
To: Jeremie Patonnier <jeremie.patonnier@gmail.com>
CC: Robert Longson <longsonr@gmail.com>, www-svg <www-svg@w3.org>
Message-ID: <EB017641-29A0-4138-8EA3-764257655617@adobe.com>

On Mar 11, 2013, at 6:31 AM, Jeremie Patonnier <jeremie.patonnier@gmail.com> wrote:

> Hi Robert,
> 
> 
> 2013/3/11 Robert Longson <longsonr@gmail.com>
> Canvas drawImage will take an SVG image as input and you can convert
> that using toDataURL
>  
> I didn't test this yet, but it should turn the SVG image into a rastered image, shouldn't it?
> If it's so, it would be useful to have a SVGSVGElement.toDataURL() to get an SVG image rather than a raster PNG.
> 
> Actually it would be useful to have something like innerHTML on SVGElement. This would allow to get a string representation of any SVG DOM tree. Once we have such a string representation, it's trivial to produce a DATA URI.

Indeed, this would be nice and was discussed before. I would rather not create a 'innerSVG' function but reuse 'innerHTML'. It might be the wrong naming schema, but authors would expect it to work. 'innerhHTML' is defined in 'HTMLElement.idl' at the moment. This definition would need to move to 'Element.idl'. The HTML WG and WEBAPS WG need to agree on that.

Greetings,
Dirk

> 
> Best,
> -- 
> Jeremie
> .............................
> Web : http://jeremie.patonnier.net
> Twitter : @JeremiePat
Received on Monday, 11 March 2013 14:04:07 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:41 UTC