Re: SVG in HTML

From: J.M. Maurer <uwog_at_uwog.net>
Date: Tue Jul 14 2009 - 12:16:30 CEST

On Tue, 2009-07-14 at 12:07 +0200, J.M. Maurer wrote:
> I'm trying to export SVG to HTML, but this is a bit annoying: you can't
> set the size of the SVG in HTML. This is because the SVG has to be
> embedded in an <object> tag. If you put a size on the object tag, the
> object itself is resized, and the SVG in it is not. Scrollbars are added
> so you can view the entire SVG. See the attached example in Firefox.
>
> Solutions:
>
> 1. Use javascript to resize the svg, like here:
>
> http://www.unet.univie.ac.at/~a9900479/svg4tom/svg4tom1.html
>
> NOTE: this involves adding js to *BOTH* the HTML and SVG data!
>
> 2. Leave it as it, ie. with the scrollbars
>
> 3. Export a PNG representation of the SVG, which does have the right
> size.

4. Poke around in the SVG data to set the size in it, like

  <svg width="576pt" height="432pt" viewBox="0 0 576 432" >

  ... and don't set the size on the object tag.

Cheers,
  Marc
Received on Tue Jul 14 12:22:45 2009

This archive was generated by hypermail 2.1.8 : Tue Jul 14 2009 - 12:22:45 CEST