Skip to main content
Known Participant
January 12, 2011
Answered

How to export layer in jpg files ?

  • January 12, 2011
  • 1 reply
  • 814 views

Hi everyone,

I am trying to develop  a plug-in  for Ai CS4 in which I need to export all the layers in jpg files. Could any one tell me the API that can help  me to  do so ?

or any suggestion how I can do this.

thanks in advance.

This topic has been closed for replies.
Correct answer A. Patterson

Well, the AIRasterizeSuite (AIRasterize.h) will have tools that let you convert sets of art into raster objects in Illustrator. And the AIArtSetSute (AIArtSet.h) has methods that let you construct said art sets from the contents of layers. From there, you'd have to take the contents of the generated raster objects and save them out manually to JPEG.

Oh, just found another that might be what you want. AIImageOptimization.h has methods like 'AsJPEG', which seem to take an art handle (which could be the group at the root of a layer from the sounds of it). So that would presumably let you do dump that to JPG. It uses AIDataFilters though, and I don't know how those work.

I think this has come up before in this forum, so if you do da little searching you might come across some better help than me. It's definitely doable though.

1 reply

A. Patterson
A. PattersonCorrect answer
Inspiring
January 12, 2011

Well, the AIRasterizeSuite (AIRasterize.h) will have tools that let you convert sets of art into raster objects in Illustrator. And the AIArtSetSute (AIArtSet.h) has methods that let you construct said art sets from the contents of layers. From there, you'd have to take the contents of the generated raster objects and save them out manually to JPEG.

Oh, just found another that might be what you want. AIImageOptimization.h has methods like 'AsJPEG', which seem to take an art handle (which could be the group at the root of a layer from the sounds of it). So that would presumably let you do dump that to JPG. It uses AIDataFilters though, and I don't know how those work.

I think this has come up before in this forum, so if you do da little searching you might come across some better help than me. It's definitely doable though.