How to recover a corrupted Illustrator (AI) File

Yesterday I was working on some designs for t-shirts in Adobe Illustrator. Today, when I try to open the file I get a message from Illustrator that says that Illustrator “Can’t open the illustration. The illustration contains an illegal operand.” WTH??

000
So here’s how to fix it. Most designers aren’t even aware that there is a feature in Adobe Illustrator called ContentRecovery. By default, this function is turned off. You can turn it on and then recover your file to correct the problem. These are the steps…

Enable content recovery
1. Quit out of Illustrator.
2. Locate your Adobe Illustrator Prefs, make a backup copy. Put the backup copy somewhere else (keep the original filename) and edit the original in your Prefs:
Mac: /Library/Preferences/Adobe Illustrator CS4 Settings/en_US/Adobe Illustrator Prefs
Windows XP: C:\Documents and Settings\\Application Data\Adobe\Adobe Illustrator CS4 Settings\en_US\AIPrefs
3. Using a plain text editor that can search, (I used Bean) search for this string: /enableContentRecovery 0
4. Change the 0 (zero) to a 1 and save it. Do not change its filename.

001
Correct the offending command
1. Launch Illustrator.
2. Using File > Open, hold down Command + Option + Shift (Mac), or Ctrl + Alt + Shift (Windows),  and click Open. Do not use Recent files or double-click the file to open. You want the full Open dialog.
3. Your file will be blank. Close the file without saving or altering.
4. Go back to your un-openable. You will now see a second file has suddenly appeared, with an underscore at the beginning of the filename. (myfile.ai vs. _myfile.ai).

The underscore file is your recovered file. It will also be much larger than your original. Mine was 4.1 megs which shot up to 10.8. When you go into your file later and edit it, it will go back down to the size it was originally.

5. Open your recovered file in a plain text editor and search for something unique in the offending command message. I searched for the word “sugar”. This was a new TrueType font I had downloaded that day. I already knew it wasn’t what I would classify as a quality font, but it had a look I needed. (I also knew that third-party Truetype fonts can be problematic on Macs. I’ve had problems with them in the past.) I was able to find the exact line that matched the message.

You should note that I was lucky in that Illustrator gave me a direct quote of the offending command and because I took a screenshot of it, I was able to search for the exact string.

000a-01

This is what I deleted in the Prefs file:

002a

Save the Prefs file and close.

A word about finding the correct offending command
According to Adobe, there are two things to be aware of…
1. Postscript is a programming language. Functions toggle on and off. So when you delete, your line should start with: %AI8_BeginPluginObject and end with: %AI8_EndPluginObject. The presumed offending command should be between these strings. You must be sure to capture the entire piece of code.

2. Sometimes, your own patterns, textures, brushes, fonts can corrupt your file. Anything coming from a third-party, and including third-party libraries of any of the aforementioned etc. should be considered a suspect in the cause of your offending command.

Also, you should always be aware of how you built your file, whether you downloaded a new font or pattern and used it in your file, whether you’re working in an old file that was converted by Illustrator… even if you used a piece of someone else’s Illustrator art. All of these are clues to a starting point in your search for the error. Illustrator will not always give you clues.

Sometimes, you will have to search and delete every instance of the string. In my case, I just happened to find the right string quoted in the error message. As it turned out, I opened the file and it still loaded the font “Sugar”. The very first thing I did was convert it to outlines to remove it from the document font list altogether.

This is my recovered file…

003

Hello world, no really

As a designer, your eye stays peeled for anything of design interest whether you want it that way or not. You can’t help but notice little things such as the fluid curving arm of your mom’s kettle or the unusual tight kerning in an ad. It’s just the way designers are wired.

This blog represents my travels… on the net or the world around me. Anything I find of design interest is going here for other designers to rummage through. As well, anything of art and culture is landing here. So, for your reading pleasure, here are the keywords for today… design, graphic, art direction, font, type, typography, colour (yes, in Canada we use a “u”), paper, pigment, canvas, brush, oil, watercolour (See? I did it again), acrylic, alkyd, support, medium, art, painting, illustration, writing, literature, short story, novel, book cover, art direction.

This blog will link back to my online portfolio.