I'm going to assume EAN is an attribute you added to your product. The
$item you're referring to is actually an invoice item and not a product so it doesn't have all the attributes available that a product would, it only has the things it needs for the invoice structure.
You can try doing the following:
I however suspect that wont work and you'll want to use:
->getAttributeRawValue( $item->getProductId() , 'ean', $order->getStoreId());
Using that you should be able to add the EAN to the
draw() method in the invoice class. Be aware that you will need to adjust the table header as well and add the EAN in there somewhere.