Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

When I try to open an svg file with Illustrator, Illustrator defaults to whatever artboard size was last used when a file was open. As such, the svg, if not the same size as the previous artboard, is then placed and auto-resized into that artboard.

Is there a workaround for this that does not involve opening a fake document with the artboard size of the svg, then closing that doc and File > Open the actual svg?

Note: I do not want to save the svg from Illustrator with the "preserve Illustrator editing capabilities" in the save as svg dialog.

You can test this with any svg, but here's a super simple one that is 320 x 240:

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     viewBox="0 0 320 240" enable-background="new 0 0 320 240" xml:space="preserve">
<rect width="320" height="240"/>
<text transform="matrix(1 0 0 1 98.6523 133)" fill="#FFFFFF" font-family="'ArialMT'" font-size="48">Why?</text>
</svg>
share|improve this question
    
You could script the workaround in which case it wouldnt appear to the user as a workarond. Indeed ny programmer even core developpers would do it thisway so its probavly not a workaround at that point. –  joojaa Mar 11 at 11:54
    
Thanks @joojaa that's how we are currently approaching it. Just surprised that Illustrator does not see the viewBox size in the svg. –  stevedebrun Mar 12 at 17:12
add comment

1 Answer 1

I found a kind of solution for this. When you save your SVG from Illustrator, you must uncheck the "responsive" option.

Illustrator doesn't care about the viewBox property but does care about the width/height properties. When "responsive" is checked, the SVG element doesn't have these properties, and that's why it doesn't take it into account when reopening the SVG.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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