Originally Posted by
enelym1978
The rule is to do it at your last exit point from the EU, which for you is DUB. You show your boarding passes/tickets at DUB that you are leaving the EU for good and they will stamp it there. Easiest would be those automatic kiosques that Spain, Portugal or France have for example.
The OP is flying DUB -> FRA -> YYZ so technically FRA is the last point of exit in the EU. But as mentioned above, it's possible and preferable to do it in DUB by declaring the items in checked baggage. FRA is annoying enough to make a correspondance in 1h, much less do any sort of paper work.