Skip to main content
Participant
September 11, 2023
Question

Export to SVG options

  • September 11, 2023
  • 2 replies
  • 818 views

I have a task to open .ai files and export them to SVG. The team for which I am writing this have sent me two images for settings they are using. On the SVG Options (image), the want the "Responsive" option to be used. So, I create the ExportForScreenOptionsWebOptimizedSVG object and set SVGResponsive to true (c#).

But they also show the Illustrator Export As dialog where they check "Use Artboards". I found ArtboardRange as a member of the ExportOptionsSVG and it is a string. I do wonder why its a string but the name implies some sort of "Range".

I also have found the Artboards collection in the Illustrator Document object. They have already set up the artboard they want to use.

So, is there a way to "check" that "Use Artboards" programmatically? Or do I need to access the Name property of the ArtBoard and set it as the ArtboardRange? And if so, I now have two different Options objects I'm dealing with. So how would I call Export? Can I pass in an array of options objects?

 

I'm waiting on my copy of Illustrator to arrive so right now, I have no way to just code something up and try it out.

This topic has been closed for replies.

2 replies

CarlosCanto
Community Expert
Community Expert
September 25, 2023

ExportOptionsSVG is an older api to export to svg

 

the newer api uses Export for Screens added I think in 2018

look at the "ExportForScreensItemToExport" it has a property to export 1 or more artboards and it also lets you set responsive property on/off

 

artboards take a string argument because you can specify a range like this "2-3" or "all" but I think it works with numbers as well if you want to export a single artboard

 

check this thread for a script written by @m1b for how to use api

https://community.adobe.com/t5/illustrator-discussions/script-for-export-multiple-artboard-to-jpg-png-etc/m-p/13624982#M358490

Known Participant
October 11, 2023

Hi Carlos,

 

Got around to trying ExportForScreensItemToExport. There is no responsive property in that object. Nor does it appear I can use it. Illustrator throws and illegal argument exception. I suspect it is due to the fact that I am call Export with Illustrator.AiExportType.aiSVG.

CarlosCanto
Community Expert
Community Expert
October 12, 2023

there is a responsive property, please check m1b script in the link I posted

 

 

jane-e
Community Expert
Community Expert
September 24, 2023

 

quote

I'm waiting on my copy of Illustrator to arrive so right now

By @R.D.321614268nx9

 

Illustrator is only sold by subscription and can be downloaded from the Creative Cloud app. I'm confused as to why you say you are waiting for it to arrive?

 

Jane

Known Participant
September 25, 2023

Hi Jane,

Because I don't spend my money to buy software I am going to automate for someone. The company has paid for a subscription and I got the mail with a link to download it and have done so.