0

I have an SVG loaded into Illustrator. I perform a selection on the illustration, go to File -> Export Selection, and export the selected content as a PNG and it looks exactly like my selection, which is what I want.

When I use File -> Export Selection and choose to export the selection as an SVG, however, the exported content contains lots of whitespace around my selected content. I don't want that whitespace--I want the the exported SVG to look exactly like the PNG.

Does anyone know how I can export the SVG without that extra whitespace? I'm happy to provide any additional details that might be helpful!

2
  • SVG is a text document and you can see the code by opening it in a text editor. If you open your export search for viewBox which is like the canvas size of the SVG. For some reason your viewBox is probably taking the size of the artboard. I tried to replicate your situation but everything exported properly.
    – Komental
    Jun 28 '21 at 2:00
  • 1
    Probably best to make artboards and export the artboards. Jun 28 '21 at 8:42
0

If you are exporting selected shapes as SVG, then I don't think there is anything wrong here. It's doing it right, exactly as one would expect.

SVGs aren't images like a PNG. They are essentially plain text, in fact a kind of XML code. Each object is made from a line of code: i.e. a path, with a fill and a stroke attribute. So, only objects which are selected will be output in the SVG.

One possible work around is to select all the artwork, and group it using Ctlr+G. Then use a clipping mask to crop it to the required area you want to output. Then select the clipped group, and do File > Export Selection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.