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 people 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 and put it somewhere else and then edit the other:
Mac: <user name>/Library/Preferences/Adobe Illustrator CS4 Settings/en_US/Adobe Illustrator Prefs
Windows XP: C:\Documents and Settings\<user name>\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 (Mac) 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 directory. You will now have a second file 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 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”. I was able to find the exact line that matched the message. Delete it. Save the file and close.

This is what I deleted:

002a
A word about finding the correct offending command
According to Adobe, there are two things to be aware of…
1. Because 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. That means when you delete, block from %AI8_BeginPluginObject and end on %AI8_EndPluginObject. You can see that in the above image where I deleted where it says “BeginEncoding” up to where it says “EndEncoding”.

2. Sometimes, you can have a brush or pattern that can corrupt your file. In this case, you would look for these strings…
(Adobe Calligraphic Brush Tool)
(Adobe Scatter Brush Tool)
(Adobe ArtOnPath Brush Tool)
(Adobe Pattern Brush Tool)

If you find a string that does not match any one of the above, delete it.

Sometimes, you will have to search and delete every instance of the string. In my case, I just happened to find the exact 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

Advertisements

105 thoughts on “How to recover a corrupted Illustrator (AI) File

  1. Saved a product of two months worth of work!!

    Instead of the “true type” in the error message, I had a ((((((((((( and a bunch of coordinates.

    I skipped the “%AI8_BeginPluginObject” part and basically searched for some of the coordinates in my error message and removed the ((((((((((((( from two offending lines. Life is grand!

  2. I was hopeful this could fix the problem, but I didn’t even get an output string telling me what the offending command was – just some god-awful crash report. I now have had about 5 files that simply crash Illustrator before it even opens equaling hours of lost work. No solution in site for me yet.

  3. I know that happens when Enable Content Recovery is not selected. I’ve also been faced with deleting AREAS of a file and foregoing complete recovery with the understanding that I would rebuild parts missing. The trick to that is to delete complete postscript statements. But that’s only a good idea if you know you have copies of the missing pieces or are certain you can rebuild.
    Just a thought.

  4. Hi, thanks for the tutorial. I have a slightly different problem. File seems to be corrupted, and whenever I try to open the file, I get an error like “Cannot open the file because there’s insufficient memory (RAM)”. I emailed the file to a fried but he got the same error, so it’s most likely corrupted. This tutorial did not really work for me. When trying to open the file with underscore, I still get a similar error “There’s not enough memory to open the illustration”. Any ideas out there? Thanks!

  5. Hi,
    Without more in-depth information, I can only guess why this would be. Here are some suggestions from experience:
    1. Close all opened apps to give all available RAM to Illustrator.
    2. Assign a scratch disk to Illustrator. It will use vacant hard drive space as virtual RAM. Quit Illustrator and try opening again. You do not need to restart.
    3. Check your Startup Items and remove anything unnecessary. Close any extraneous fonts which if there’s quite a few can actually be using a significant amount of memory.

    If these do not work, go to 4 and 5. These will help speed your mac up and use memory more efficiently than before.

    4. Use Disk Utilities to Verify your Disk AND Repair Disk
    5. Reset your Perameter RAM. You can reset the PRAM by rebooting your Mac and then immediately hold down the Command+Option+P+R keys at the same time, you will hear the Mac reboot sound again, signifying your PRAM has been reset. You must hit the key combination before the grey screen appears otherwise it won’t work. Do this FIVE times. Then restart normally.

    You can also try emailing me the file at me.artboy@gmail.com.

    Let me know how this works out for you.

    Thanks
    Daxx

  6. Daxx, you have saved my life with this post, God bless your head!

    My problem was similar to Levi Crain’s, no true type error, but ((((((((((( and some numbers. I tried a deleting a number of different sections, but in the end the solution for me was to just erase the single line beginning %… and containing the brackets and digits. Relief! Thanks so much for sharing this tutorial, 8 hours work saved!

  7. This is amazing.

    I follow-through the detailed instructions carefully. Though my illegal operand was totally different mine was something like

    “((((((((((((( …133444…… %OR..”

    I was able to recover my file. 100% all working, multiple artboards, opacity, transparencies, linked files and etc.

    For people who might encounter same problem as mine just make sure you open the text editor to full screen width so that the text wont wrap.

    Each line should have “%” sign. Just delete each line that contains everything you see on the “illegal operand message dialog box”

    My case was a bit different because it has nothing to do with fonts.
    I’m really glad to the point that I’m commenting here.

    Cheers!

  8. The command+option+shift isn’t working for me. It just still opens the corrupt file, gives me the warning, and the new file isn’t created? I can’t figure out what I’m doing wrong.

  9. Saved my life. Had the same ((((((((((((( problem just searched the document and deleted all multiple brackets and it helped

    I typed (((((((((((((((((( then searched to remove this with notepad++
    repeted the operation removing one “(” every time to make sure I don’t leave a single “(” left out

  10. Illustrator has always had ways of recovering files built right into the programming. Only if you have been with AI for a long time, would that be common knowledge. For some reason, Adobe has chosen to keep the information, not so much as buried, but less obvious to it’s users. I’m glad it could help. I’ve been exactly where you are.

  11. Hi I have a similar problem as to all above users, only I am using CS6. the string mentioned is XMlnode-nodevalue and /dictionary. I located and changed my prefs file to enable recovery, however when opening corrupt file, with shortcut, i do not get a second version of the file with the underscore at the beginning. What can I be dong wrong…I have checked prefs file and all is as per the enable content recovery = 1. tried opening offending file in bean to look for string but, the file is blank… any help much appreciated!!

  12. Hello Dexter!

    Very good post it seems like you helped many save their efforts!
    I’m also facing the same problem but mine is full of ((((((((((( unlike your font error! Please let me know how to solve this!!!

  13. Sorry but I have had the time to explore the inner workings of CS6, and its quite possible that Adobe has altered the file structure again. It’s not vital if the file recovery adds an underscore in front of your file name or not, as long as you can open it.

    Thanks
    Daxx

  14. Worked for me. And there was much rejoicing. (Monty Python ref.)
    FYI, in CS5, AIPrefs is located at Users\yourusername\AppData\Roaming\Adobe\Adobe Illustrator CS5 Settings\en_US\AIPrefs

  15. Search for the name without the underscore. You should be able to locate both files. If you still cannot locate it, perform the recovery again.

    Thanks
    Daxx

  16. Please note: Adobe has removed the file recovery function from CS6. There are no plans so far to implement it. I won’t apologize for this, but Adobe should.
    Update: It turns out the ContentRecovery function has not been removed and still functions within CS6. It is however a good idea that once your file is recovered, duplicate it and use the copy as your working file. Keep the original as a backup in case something goes awry, as in Alexa’s case.

  17. Wow! Really? You’re using CS6? This is great news! From what I had read, Adobe had removed this function in CS6. I’m going to have to test this myself. Excellent… and, glad I could help. As a graphic designer, I’ve worked on files that can take days to complete, so I know the value in tips that can save you from losing hours and hours of work. Trust me, been there.

  18. I worked on my recovered file all day Friday. Goes to open it Monday, and getting the same error as before! Trying to recover again, but I’m so confused as to what happened. I’m going to outline all my fonts if I get this baby open again and move everything to a brand new file. 😦

  19. If you get it to recover again, I’d suggest you do a Save-As and work in the duped file. That way, if something screws up again; you’d at least have the recovered file always as a backup… just never work right in the recovered file itself. Let me know how it goes.

    Thanks
    Daxx

  20. I did Save-As…I think the second time around corruption was caused by being such a huge file. I had someone with an older version open up each page individually and it worked!

    But this process worked well for me on cs6.

    Thanks!
    Alexa

  21. Im working with CS6. Can’t find the path you mentioned. Even I haven’t the folder “AppData” inside the “username” folder, is that possible?. Anybody with CS6 can explain the steps please?.

  22. Thank you very much, i try to delete the corrupted linked jpg file, but doesn’t work, so i change the name the file it self and in the text edit file. well done it’s open as it’s, ididn’t lose anything.

    Nasser

  23. Thank you! could find it in the code. obviously its about this part

    (FillStyle) ,
    ; /Dict ;
    /Part ,
    ;
    /Part ,
    /BasicFilter :
    (Blend Style Filter) 0 0 /Filter ,
    1 /Visible ,
    /Dictionary : /NotRecorded ,
    /BlendStyle : 0 1 0 0 0 Xy
    0 J 0 j 1 w 10 M []0 d
    0 XR
    /Def ;
    (BlendStyle) ,
    ; /Dict ;
    /Part ,

    its about unnamed gradients i guess… but there are about 30.
    i am a bit lost. deleting those will help me?

    Ben

  24. Well depending on how complicated and extensive your file is, I would just delete this whole section. It won’t remove your entire file and you probably know what’s supposed to be there, so I wouldn’t fret about it too much. I’d just delete this section and rebuild it. Save yourself the sweat of learning PostScript. A tip would be to do this on a copy of your recovered file. The goal is to delete code in order to get your file to open. Once you can open it in AI, you can replace the removed items.

  25. Effing SWEET! This worked for me in CS6. Thank you! One thing though…since I did this, every Illustrator file I open now creates 2 extra files in the same directory: (my filename)_Read_undoFree.metro and (my filename)_Read.metro. Both appear to be just text files of code. Anyone else experience this? It’s pretty weird and a bit annoying! Thanks for any input.

  26. If you kept your original Illustrator prefs, I’d replace your edited version with it. It should change you back to Illustrators default mode and the double files should stop… except for the ones already generated.

  27. I put the original prefs back, and it still is writing the extra files. Have you encountered this before? Also, both people who routinely do Illustrator work here (myself and one other) are getting similar corruption issues periodically. I’ve been able to recover them using this technique, which is great, but we still need to figure out what’s causing it in the first place. Thanks again for any help.

  28. No. I haven’t encountered this before. Check the prefs file you are using and make sure Content Recovery is set to False.
    As far as finding the source of similar file corruption, it can be anything from a bad font you routinely use, or a bad raster file. I can’t see your files, so you must look for the patterns.
    Good luck.

  29. I got the extra files to stop. Apparently the .metro files are debug files, and I had changed a “0” to a “1” in a line that dictated those extra files to be generated. All good, thanks! As far as the source of corruption, still scratching our heads a bit as we can’t find any real patterns. However, we are upgrading from CS6 to Adobe Creative Cloud this week…so hopefully the corruptions will cease!

  30. Hi Brendan. Unfortunately you haven’t given me enough data to diagnose your problem. A typical postscript error looks like this…

    %%[Error: limitcheck; Offending command: image ]%%

    In this instance, the postscript engine has identified the problem as the image and you can clearly read that in the error response. A single comma is not listed in postscript dictionaries as a possible error message. Here’s a list of possible postscript errors and what they mean so you get an idea of the sort of thing you should be looking for:

    http://www.prepressure.com/postscript/troubleshooting/errors

    So here’s my suggestion:
    Think back to when you created the file. Did you use any cheap true-type font, or a standard font? Badly made true type fonts are more often the primary cause of most postscript errors. Second to that are images that have been reduced ridiculously small, or are too high in resolution. I would start there.
    You know how the file was created, so only you can answer those questions. If you think you can get away with deleting the code for the font or the image (providing you still have the original placed file), then do it. Make sure you block the beginning and the end of the block of code (look for “BeginEncoding” and “EndEncoding” and make sure you select the entire lines).

    An image or a font can always be added back later. Do this on a copy of your recovered file. If it doesn’t work, you will still have a backup to try again.

    Without more data, that’s the best I can offer you.
    Good luck.

  31. Hey Dax, if you can offer any help here, I’d greatly appreciate it.

    I’m getting the same (((((((( 1334441211….error. I can’t seem to figure out what to delete from the file in order to get the clean, repaired version to open. Here is the full error:

    Can’t open the illustration. The illustration ended unexpectedly.
    ((((((((((((((((((((((((( 1334441211((((((((((((((((((((((((( 1334441211
    ((((((((((((((((((((((((( Xa
    %_0 R
    %_0 0 0 0 1 1 1 XA
    %_-1 — -1 -1 -1 Xy
    %_0.5 w 10 M
    %_GX
    %_1 -1 5 5 -1 Gf
    %_0 O
    %_0.003998 0.005493 0.189029 0 1 0.976471 0.835294 Xa

    I tried just deleting the line with the ((((( and including the Xa but that didn’t work. I tried deleting the whole thing but that didn’t work.

    Any thoughts?

  32. Pingback: Illustrator CS6 can't open CS6 .ai; says it's i… » Timeclub

  33. Pingback: Illustrator file will not open » Timeclub

  34. I have a feeling this file is incomplete. I don’t believe this is actually a postscript error. I think what you have is a partial file error and Illustrator is showing you the back of the file where the code is missing. When Illustrator says “The illustration ended unexpectedly”, it’s telling you the end postscript codes that close off the file are missing. I think you are correct in about “((((((((((((((((((((((((( 1334441211((((((((((((((((((((((((( 1334441211
    ((((((((((((((((((((((((( Xa.” This is where the break in the file code occurred.

  35. Hello, Daxxter, I have also fallen prey to this strange bug in Illustrator. Firstly I do not know how this error suddenly appeared on my screen; I have been using the combination Illustrator/Mapublisher (plugin) for many years without this kind of problems. Surely it must be an ADOBE problem but apparently they never have made a workaround or bug-fix to counter it. I am trying to follow your route, have changed my Illustrator Preferences from 0 to 1, but when opening my file, it does not come up blank as you say, but with about half the information present but also many layers (especially text layers) missing. No new _myfile.ai is created either, so I am in a different league apparently. Would you have any suggestions for me? Can I send you my file (210Mb)? The Offending operator seems to be just a comma!

  36. Hi Andre,
    It sounds like your problem could possibly be a font based on your comment that text layers are missing. I don’t think the error is just a comma. I’ve run into people with this type of problem when they’re not using standard fonts, and usually it’s almost always Truetype. I would start there.

    Make sure you are using the Open command from inside Illustrator and NOT double clicking your problem file.

  37. Hi Daxxter,

    I just got the same error message. I have cs6. The error is foreign letters. I have windows 8 and I cannot seem to find Adobe Illustrator Prefs. I lack tech knowledge. Any advice on how to get that up in windows 8?

    Thank you

  38. Hello,
    You could be experiencing 1 of 2 scenarios:
    1. The file is actually NOT corrupt, in which case the keyboard command to recover the file will do nothing. There is nothing to recover.
    2. Illustrator’s file recovery option has NOT been enabled properly, which again will produce nothing if you invoke the recovery command.

  39. This post just keeps on giving! Saved me a days work and I can’t thank you enough!

    In my case I deleted all the lines of code with ((((((( in them. There were tons of lines and I thought it would break what I had done. But I opened in illustrator and all was there apart from one broken linked image. Phew!

  40. Thanks for the appreciation Rob. I’m glad this could help. Anyone who has worked in Illustrator understands exactly how much time could be involved in the creation of some AI files. Most other people will never come to fully comprehend the hours and hours some of these files can take to create. It’s too bad this feature isn’t widely known… hence this post.

  41. worked three days and right through the night on my file – first job after 10 years for a big company… so naturally, my unbacked up file won’t open and has corrupted on deadline day. It simply says something along the lines of ‘this file is damaged and can’t be mended’ so I’m guessing… It can’t be mended? Friends can’t open it on their computers either. Is there any hope for it? I haven’t got anytime to replace all that time and no roughs to go back to. Trouble is, I’ve got windows 7 and CS3 and I know nothing about code. I don’t think the instructions above are for my computer as I can’t find a documents and settings folder 😦 weeping!… profusely!!!
    xT

  42. Hi Tracey,
    First of all there are big gaps of information and detail missing in what you are saying. People like me can only help you with exact information. Paraphrasing an error message is so wrong on so many levels. We need the exact language… word for word. Without it, we are only guessing. Can your file be helped? I doubt it. It’s possible it wasn’t fully copied, or a part of the file sits in a bad sector, or a part of the file sit in a sector that got corrupted after it was copied to your computer etc etc. I’m don’t know. These are only guesses. If your friends cannot open your file using up-to-date computers, I’d use that as a rule of thumb and resign myself to your file unfortunately never coming back. Again, I can only guess.

  43. hi daxxter. thanx for you tutorial. but i am now stuck with the last part – deleting the offending command. can you help me on how to sort which things to delete?

  44. Hi Hilmi,
    Look for anything out of the ordinary… first I would search for the words “offending command”. That’s a dead giveaway. If you find one, delete the entire line, save your file and you’re done. If you don’t, I would be looking for partial, incomplete lines of code and those things stand out pretty clearly. I’d delete any of those. Otherwise, I’d be looking to make sure all the code is consistent and deleting any inconsistencies. I hope that helps.

  45. I don’t think there are enough thanks posted here for this. I almost lost a huge file at work. Definitely need to back up my stuff more often. Thank you!!

    My offending operator was: X+

    This is the block I deleted:
    %_/ArtDictionary :
    %_(0.054865) /String (BBAccumRotation) ,
    %_;
    %_
    0 0 Xd
    6 () XW
    /AI11Text :
    0 /FreeUndo ,
    0 /FrameIndex ,
    8 /StoryIndex ,
    /Art :
    X=
    1 An
    X+
    ; /ConfiningPath ,
    2 /TextAntialiasing ,
    ;

  46. Thanks Tiffany for the kind words. As a graphic artist, the hours we all invest into making our files perfect is the pain and agony we all suffer through. We do it because we love it. So when in a matter of seconds, our joy turns to horror, I fully realise the value of a tutorial such as this… and do you know why? Because I’ve been there. And thank you for sharing.

  47. For those wondering if this works for Adobe Illustrator CC (19), IT DOES. You just saved me hours of potential re-creation work, all because of one bad font in the file. Thanks so much!!

  48. Hello! I have a problem with Illustrator Cs6. I can´t open a projetc. When I try to open it in illustrator, this message appears:

    Can´t open the illustration. The illustration contains an incomplete or garbled description. ,”/’7*C4MR;$D0A-B/!A/A2B4A4;.>1B3

    I have opened the work in a text editor (wordpad) and I don´t find the sentence or the code of this messege. Daxxter, could you help me, please?

  49. Hi drexxter! I tried your steps and none of them worked. However I was able to open the corrupted AI file in Acrobat, then print to a PDF, and okay that in Illustrator. All of the layers were preserved.

    I wanted to share this with your readers in case any cannot fixed their corruption using your tips. 🙂

  50. I would guess it opened because Acrobat substituted your fonts. Acrobat can open any Illustrator .ai or .eps file. It won’t open a corrupted file, which means your problem was never about file corruption. It was actually a simple font issue that Illustrator wasn’t happy about.

  51. Hey Daxx I’m having trouble with the bellow error, I can’t figure out which lines to delete. you help would be greatly appreciated.

    Can’t open the illustration. The illustration contains an illegal operand.

    Offending operator: “p”
    Context:

    %
    9 () XW
    q
    0 Ap
    0 O
    (Unnamed Pattern 2) 0 0 1 1 0 0 0 0 0 [0.798462 0 0 0.810805 -716.618 1063.5918] p

  52. I simply deleted the whole string of contiguous brackets and nothing else. Then I saved the file with a new version number. EVERYTHING was recovered perfectly. Thank you daxxter. A big hug to you.
    Guy Miklos

  53. You are very welcome Guy. I’m still quite surprised that this isn’t a standard function of Illustrator. The sheer number of people that this single post has helped, speaks directly to the volatility of the postscript language. Actually, in reading that last sentence I think I’ve just answered my own question. Hahaha

  54. How do I get the back up file? After I relaunch AI
    Select click on File > Open> Highlight the file in which I want to open then hit down the Shift+Ctrl+Alt and Open
    Then it will load the file but the should the text import options is still present?
    If so where should I locate the _.aifile
    What do you meant by go back to the directory?

    FYI, I save the file on desktop.

    How should I go abt doing it?

  55. Hi Yvette,
    It sounds like you’ve gotten some instructions mixed up.

    You must make a backup copy of your Illustrator Preferences first.
    Then enable Content Recovery. (Follow the instructions)
    Once that’s done open the file while holding down the Shift+Ctrl+Alt and then close it without saving or altering. You must do this exactly as described.
    Go to the directory/folder where your original file is located. A new file with an underscore (_) in front of its name will appear. That’s the file you want to correct.

  56. hi daxxter…bro am in a serious trouble here…i tried your steps to recover my damaged ai file…but unfortunately i’m still lost somewhere i cannot repair this…please do help me…i edited the ai pref file as you said i made the 0 to 1 and saved it…and i relaunched ai and tried holding ctrl+shift+alt open but it’s still the error message displays as “the file is damaged and could not be repaired”. please help me to recover this file…it was a weak of overnight work i have put to this booklet work daxxter…if you want i can send you the relevant file….please help me out…thank you…

  57. Hold down the option key and click on the Go menu. There are two Library folders on your mac. The one you want is the one that is hidden. Holding down the option key when you click on Go makes it visible. Open THAT Library folder and open the Preferences folder found inside it. Follow this folder hierarchy to your preferences file…
    Library > Preferences > Adobe Illustrator CS6 Settings > en_US > Adobe Illustrator Prefs

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s