Try check your printer, whether it's damaged or not?
If printer is okay, you can check your Macintosh HD disk, use disk utility and verify disk, and repair if be told to. See if that fix the problem
If everything still stuck, you may try to reinstall your OSX with restore DVD provided with iMac. I hope you didn't lose it.
If that doesn't work, contact Apple Authorized Service to fix your problem.
Be cool and try to fix your problem from easiest method. You're not gonna say Ubuntu is suck because it suddenly hang up due to minor error, do you?
Undeniable, Mac is still just a computer, sometimes it hangs, fails and make some errors, but which one do that least
