Skip to main content
Participant
September 13, 2023
質問

Export ai to SVG creating PNG and JPG file

  • September 13, 2023
  • 返信数 1.
  • 1843 ビュー

I have a tool that automates AI. It opens a .ai file and then calls Export passing in AiExportType.aiSVG. I pass in an ExportOptionsSVG object too. When I call Export, I see that I not only get the SVG file created, but I also see either a JPG or PNG file created too. Those filenames are "random" in that the filenames appear to just be hex numbers. For instance, I just got 1338D1F3.jpg for a file. I suspect that the type, jpg or png created may depend on whether there are text frames or not in the .ai file. But, that's just a guess right now. I don't see any option in the APIs for Illustrator.Application, Illustrator.Document or the export options object that would let me stop this from occurring.

 

How can I prevent this from occurring programmatically (via the automation APIs)?

このトピックへの返信は締め切られました。

返信数 1

CarlosCanto
Community Expert
Community Expert
September 13, 2023

If you create a new document and draw a plain rectangle with default fill and stroke, then export to svg using your tool, does it create the jpg/png files?

 

if it didn't then, it's probably not the code but the art that is causing the issue

Known Participant
September 14, 2023

Regardless of what "causes" this, I want to avoid it. I don't see any API on Artboard or Artboards that would appear to help me avoid these files being created. I do know we have created png files from the .ai files directly via the UI, so that might be why it is insisting on dropping those to disk when I call Export to create the SVG. Indeed, if I don't supress adding the .ai files I open to the MRU and I later open a .ai file later via the UI, Illustrator puts up a message box complaining that it can't find a png file for the .ai file. When our team creates a png from the .ai file, they use the same name and just change the extension. These files created by Export don't use those names, which is probably why Illustrator is saying it can't find the png file.

 

I just want to stop these randomized files being created.

Known Participant
September 15, 2023

Illustrator files are not supported, but you could save as pdf with Preserve Illustrator Editing Capabilities checked.

 

or you could save your ai file to Google Drive, Dropbox or similar and paste the link here


https://drive.google.com/file/d/1ZShLLGOoAhUQ4LPK46Kin2f20a5w4vx8/view?usp=sharing

https://drive.google.com/file/d/1DPZ67Zu_hdcPQxiI4h--4RueRVotwD4B/view?usp=sharing

 

Try this.