Issue with GoSvgWriter

Hi

I'm using GoSvgWriter to generate SVG from my diagram. If I look at the SVG, the first object it creates is a large rectangle inside first element after element. SVG code looks like below:
Can someone please help knowing how to exclude this rectangle from exported SVG? or How can I control size of this rectangle?
Thanks,
Tushar

That’s the background, which is the GoDocument.PaperColor, or the GoView.BackColor if GoSvgWriter.PaintView is true.

What’s the problem with having that element there?

If you really need to get rid of it, I suppose one could override GoSvgWriter.GenerateObjects.

Thanks for replying.

The problem is I can not draw such a large rectangle on GoDiagram, it throws an error.
I'm intending to use exported SVG to re-generate some drawing using GoDiagram and GoDiagram does not seem to be supporting such a large rectangle (?)

Are you importing into GoDiagram some SVG that GoSvg exported? That’s quite a bit of work.

Well, one solution is to read in the XML as DOM. Either find that Rect element and remove it from the DOM, or skip over it when interpreting the SVG.

It would be easier to use the GoXml layer directly than the GoSvg support. The Svg support was intended to allow you to export GoDiagrams outside of the Go environment.

Thanks Jake and Walter