Print M&Ms with conveyor printing press
The problems involve the fact that M&Ms can melt and soften under heat, they are slightly different in size and the M is tiny!
M&M owner Mars wouldn’t spill the beans for years on how the M is actually put on the delicate chocolates but now they have decided it is OK that the world knows according to an article from The Straight Dope. Here is what the article says:
I would have guessed it was more like flexography, which involves a flexible printing plate, but Hans says no.) The “ink” is a simple vegetable dye. Blank M&Ms are run through the printing press on a special conveyor belt with rows of dimples on it — indentations, actually — to hold the little guys in place. The real trick, Hans says, is calibrating the press so it won’t smash the peanuts. (Peanuts, being a natural product, are given to some variation of dimension.) As is my habit in these matters, I promised I wouldn’t reveal the secret to the world, but believe me, you’d be amazed.
If you want to get an idea of how this printing style works check out this video (it may be a bit boring to watch the whole thing!).