Skip to main content
Inspiring
June 23, 2014
Question

"width" and "height" attributes not included on svg export

  • June 23, 2014
  • 2 replies
  • 626 views

Hello,

When exporting svg files through scripting, Illustrator CC includes the viewBox attribute in the <svg> tag – but not width and height. This makes display inconsistent and problematic in web browsers.

Is there a way to include width and height attributes when exporting from Illustrator CC? CS6 did it automatically.

This topic has been closed for replies.

2 replies

Doug A Roberts
Community Expert
Community Expert
May 8, 2024

If you uncheck 'Responsive' in the export options, width and height should be included.

If this doesn't work for you, please share an example file along with the exact export options you used.

Participating Frequently
May 8, 2024

I'm using the `app.activeDocument.exportFile()` API. `ExportOptionsSVG` does not seem to have a "responsive" option that I can set to `false`?

Doug A Roberts
Community Expert
Community Expert
May 8, 2024
Participating Frequently
May 8, 2024

I have the same issue. Does anyone have a solution for this?