If you need the list of Diplomatic Representations and foreign Consulates in Spain, which allowed by their domestic law and being licensed by the Spanish Ministry of Foreign Affairs and Cooperation (MAEC), are authorized to issue certificates of criminal record (CAP) or acts registered in local Civil Registries, you can find it here. In addition, on 16th December 2014 the Delegation of the Government in Catalonia reported that Latvia is included in the list of the Countries with Authorized Consulates to issue Certificates of Civil Registry.