Skip to main content
Inspiring
October 29, 2014
Answered

How to export an .ai graphic in indesign as .png/.jpg?

  • October 29, 2014
  • 1 reply
  • 581 views

I have been searching for this multiple hours, but I just can't find the solution. I'm currently writing a script for a xml export. Now in this export, I need to link the images in the assets folder. The problem is, I can't use .ai. Is it possible to export these .ai files as .png/.jpg via script? If yes, could you share a documentation about this?

This topic has been closed for replies.
Correct answer cchimi

Based on the UI dialog for Export XML, it looks like you'll first want to set an XMLExportPreference to copy either optimized or formatted images, and then choose and image type. So,

objDoc.xmlExportPreferences.copyFormattedImages = true;

or

objDoc.xmlExportPreferences.copyOptimizedImages = true;

followed by

           

objDoc.xmlExportPreferences.imageConversion = ImageConversion.JPEG

or

           

objDoc.xmlExportPreferences.imageConversion = ImageConversion.PNG


This help page describes the difference between optimized and formatted images: InDesign Help | Exporting XML


That should get you started.  You may need to play with some other options to get the output you want, but that's the idea.

1 reply

cchimiCorrect answer
Inspiring
October 29, 2014

Based on the UI dialog for Export XML, it looks like you'll first want to set an XMLExportPreference to copy either optimized or formatted images, and then choose and image type. So,

objDoc.xmlExportPreferences.copyFormattedImages = true;

or

objDoc.xmlExportPreferences.copyOptimizedImages = true;

followed by

           

objDoc.xmlExportPreferences.imageConversion = ImageConversion.JPEG

or

           

objDoc.xmlExportPreferences.imageConversion = ImageConversion.PNG


This help page describes the difference between optimized and formatted images: InDesign Help | Exporting XML


That should get you started.  You may need to play with some other options to get the output you want, but that's the idea.

StammAuthor
Inspiring
October 30, 2014

And this will also convert .ai? I thought it might be a little difficult for vector bassed graphics. Thank you, sir!

Inspiring
October 30, 2014

I don't have any AI images to test with, but it works for EPS so I would think so.