In Spain it is mandatory since this year. There's a free Java app by the government, FACTURAe, that is capable of generating the digital invoices and it's not that complicated to use. Electronic invoices have been mandatory for public administrations for 10 years already.