Page 1 of 1

Export SVG with IsWithoutBorder

Posted: 24 Jan 2014, 15:54
by Steve
Hallo,

I use CADImportVCL to show SVG in an TPicture-Component. With the SVG unit i can set the IsWithoutBorder property to true. Now i want to export this SVG with this option in a new SVG-file. But when I open this new file with the InternetBrowser (FF, IE) there is a border. Is there a possibility to export only the SVG without border so that the InternetBrowser doesn't show this?

Re: Export SVG with IsWithoutBorder

Posted: 28 Jan 2014, 13:10
by support
Hello Steve!

The SVG file should be exported without border when TsgSVGImage.IsWithoutBorder is set to True. You can also try to set TsgCADtoSVG.IsWithoutBorder to True before saving to file:

Code: Select all

var
  vCADtoSVG: TsgCADtoSVG;
...

  vCADtoSVG := TsgCADtoSVG.Create(Img);
  vCADtoSVG.IsWithoutBorder := True;
  try
    vCADtoSVG.SaveToFile('c:\result.svg');
  finally
    vCADtoSVG.Free;
  end;
Mikhail.

Re: Export SVG with IsWithoutBorder

Posted: 05 Feb 2014, 13:16
by Steve
Hallo Mikhail,

thx for the answer.
Is it also possible to export only a viewBox of the SVG? When i export i always get a viewBox of 0 0 65535 65535.

Re: Export SVG with IsWithoutBorder

Posted: 20 Feb 2014, 15:56
by support
Hello Steve,

It's not possible to define and export only the viewbox. Do not confuse the width and height of the viewbox with the width and height of the SVG document. If you think of the document as a canvas, the viewbox is the part of the canvas that you see. The viewbox can cover the entire canvas or just a portion of it.


Mikhail.