Illustrator AI export to Photoshop PSD. A bug and workaround.
Last week I came across an Illustrator CS4 bug that took a little while to figure out, so I thought I’d post details up here in case anyone else come across the same issue. I’ve sent Adobe a bug report, and they’re looking into it, but in the meantime…
Illustrator CS3 and CS4 both have an excellent feature that allows you to export artwork from a .AI to a .PSD, retaining the individual layers. This is great when developing a website. Personally, I opt to wireframe and then mock up in Illustrator, but when it comes time to create the XHTML template, I like to go to Photoshop because traditionally exporting directly from Illustrator has been less precise.
To export to Photoshop, you simply select File > Export, then choose PSD as the file type (and in Illustrator CS4 you can now choose to export one or all artboards while you’re at it). You’re presented with a dialog box with a load of options, but the key thing here is to choose “write layers”.
If all is well, the net result is a layered PSD file containing editable text and nested groups of objects matching your groups in Illustrator. As a side note, drop shadows are rendered out as separate items so aren’t live once you’ve moved to Photoshop.
The bug
The bug arises when you try to export artwork that has a layer with nested grouped objects.
If you have a group within a group, 4 levels deep – ie. Group > Group > Group > Group and on the lowest level (furthest in) you apply a drop shadow, Illustrator’s export engine fails and you’ll get an innocuous error message:
This little box hides the fact that when you open Photoshop, all layers beneath and including the nested group layer will be flattened onto one layer. This happens in both CS3 and CS4. It may be that the bug occurs with other live effects; I haven’t done an exhaustive test beyond setting up a couple of documents as you see above to test the theory.
The solution
Understanding what causes the problem should mean you’ve already figured out the solution. Pretty much it’s as straight forward as ungrouping objects. Make sure you have nested groupings to a maximum of 3 levels deep if you want to apply drop shadow to nested grouped items. I tend to stick almost all my content in one layer when developing a design, and then split it out into layers ahead of the export – which is probably why I’ve come across this issue. You can save yourself the headache by creating layers as you go, and thus reducing the need to group objects together in the first place.



