Exporting as an SVG in Adobe Illustrator canvas size issues [closed]
Asked Answered
S

5

20

I'm having real trouble with saving a simple SVG in Adobe Illustrator.

Illustrator keeps imposing its own canvas size on the export.

This is what I'm doing...

1) Draw an art board around the image

enter image description here

2) File > Save As

3) Change type to SVG

When I view the result, Illustrator has seemed to have resized the canvas arbitrarilyenter image description here

How can I control this so I can get my own size?

Sapota answered 21/6, 2012 at 15:2 Comment(3)
After researching I've discovered it's not just me - forums.adobe.com/message/2851504Sapota
How is this question related to programming?Absentee
@Bjørn-RogerKringsjå SVG is in XML format and this question solves my problem with adjusting size of an image in HTML / JavaScriptThread
C
54

Your problem is that your SVG is being saved with the Artboard, which is set to the default document size.

Try using "Object > Artboards > Fit to Artwork Bounds" before you save.

Covarrubias answered 31/3, 2013 at 21:5 Comment(2)
I tried this but still get the whole document image size, any thoughts?Trash
I figured this out if you have a "layer" on your background. Select it and delete it. Then do what this answer tells you to do.Mudra
S
5

The Mac Finder (which I'm assuming you're using to view your SVGs) tends to ignore SVG boundaries. Shouldn't matter in production, although it's a bit annoying when you're viewing them in a folder.

Open your SVG file in a text editor, paying special attention to the opening tag. Make sure the cartesian coordinates in the "viewbox" attribute matches what you have in mind.

In-depth explanation of what the code means: http://commons.oreilly.com/wiki/index.php/SVG_Essentials/Coordinates

Skidproof answered 7/7, 2012 at 6:1 Comment(0)
T
3

Illustrator has an issue with artboards, ie "viewBox" in the .svg format. Try this: first adjust your artboard/canvas for your graphic in Illustrator, then save the file in .ai format.

Now from the .ai format you can save the file as .svg and your artboard will be as you adjusted it. Next time you open the .svg in Illustrator, the artboard will be messed up again, so you will have to work from the .ai file and just use the .svg on the web.

That means each time you need to adjust an .svg, you need to first save it in .ai-format, adjust the artboard, save it as .ai and then save it as .svg.

If you have a contact address to the people at Adobe, let them know...

True answered 9/1, 2015 at 13:7 Comment(0)
F
0

Sometimes you can unintentionally include small items in the illustration that increases the size. Try pressing Crtl + A to highlight everything in the document. Then, delete any extra items outside the illustration. This should resize the canvas.

Frankish answered 17/2, 2014 at 20:52 Comment(0)
B
0

The solution to this is to use an optimiser like https://petercollingridge.appspot.com/svg-editor

This strips out white space and also optimises the file.

Belligerence answered 18/2, 2015 at 16:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.